From ef6c17851bb2c30eaa63def86b29ba022763f049 Mon Sep 17 00:00:00 2001 From: Mira Limbeck Date: Mon, 11 Nov 2024 16:01:02 +0100 Subject: [PATCH] iscsi: disallow slashes in volname MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The last part of an iSCSI volname is assumed to be a stable name found in /dev/disk/by-id. These are not allowed to have `/` in their names. Reported-by: Friedrich Weber Signed-off-by: Mira Limbeck Tested-by: Friedrich Weber Reviewed-by: Fabian Grünbichler --- src/PVE/Storage/ISCSIPlugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/Storage/ISCSIPlugin.pm b/src/PVE/Storage/ISCSIPlugin.pm index 0211bbe..5f5cbf7 100644 --- a/src/PVE/Storage/ISCSIPlugin.pm +++ b/src/PVE/Storage/ISCSIPlugin.pm @@ -316,7 +316,7 @@ sub options { sub parse_volname { my ($class, $volname) = @_; - if ($volname =~ m!^\d+\.\d+\.\d+\.(\S+)$!) { + if ($volname =~ m!^\d+\.\d+\.\d+\.([^/\s]+)$!) { return ('images', $1, undef, undef, undef, undef, 'raw'); }