]> git.proxmox.com Git - pve-container.git/blobdiff - src/PVE/LXC.pm
style fix
[pve-container.git] / src / PVE / LXC.pm
index 3ed5d92fd5ecaf4acc44a32c8cd2ee1905dcaf7f..0365996388486ac76c14debe8b074567d5189588 100644 (file)
@@ -1073,6 +1073,11 @@ sub mountpoint_mount {
            }
            return wantarray ? ($path, 0, undef) : $path;
        } elsif ($format eq 'raw' || $format eq 'iso') {
+           # NOTE: 'mount' performs canonicalization without the '-c' switch, which for
+           # 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
            my $domount = sub {
                my ($path) = @_;
                if ($mount_path) {
@@ -1105,7 +1110,7 @@ sub mountpoint_mount {
            die "unsupported image format '$format'\n";
        }
     } elsif ($type eq 'device') {
-                       push @extra_opts, '-o', 'ro' if $readonly;
+       push @extra_opts, '-o', 'ro' if $readonly;
        PVE::Tools::run_command(['mount', @extra_opts, $volid, $mount_path]) if $mount_path;
        return wantarray ? ($volid, 0, $volid) : $volid;
     } elsif ($type eq 'bind') {