[pve-devel] [PATCH v2 container 2/2] fix a possible undefined value error

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Jul 11 12:19:15 CEST 2016


---
 src/PVE/LXC.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 6cd4c71..84f13f9 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1215,7 +1215,9 @@ sub mountpoint_mount {
 	    # device-mapper devices is special-cased to use the /dev/mapper symlinks.
 	    # Our autodev hook expects the /dev/dm-* device currently
 	    # and will create the /dev/mapper symlink accordingly
-	    ($path) = (Cwd::realpath($path) =~ /^(.*)$/s); # realpath() taints
+	    $path = Cwd::realpath($path);
+	    die "failed to get device path\n" if !$path;
+	    ($path) = ($path =~ /^(.*)$/s); #untaint
 	    my $domount = sub {
 		my ($path) = @_;
 		if ($mount_path) {
-- 
2.1.4





More information about the pve-devel mailing list