]> git.proxmox.com Git - pve-access-control.git/blobdiff - PVE/RPCEnvironment.pm
remote_viewer_config: brackets around ipv6 http address
[pve-access-control.git] / PVE / RPCEnvironment.pm
index 765008eee5c63a5ee0b3ae591c25da372f770153..52c5f64ce0cf577b1785ba390afef9a97a179e43 100644 (file)
@@ -14,7 +14,6 @@ use PVE::INotify;
 use PVE::Cluster;
 use PVE::ProcFSTools;
 use PVE::AccessControl;
-use Cwd 'abs_path';
 
 # we use this singleton class to pass RPC related environment values
 
@@ -287,11 +286,9 @@ sub check_volume_access {
 
     # test if we have read access to volid
 
-    my $path;
     my ($sid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
     if ($sid) {
-       my ($ownervm, $vtype);
-       ($path, $ownervm, $vtype) = PVE::Storage::path($storecfg, $volid);
+       my ($vtype, undef, $ownervm) = PVE::Storage::parse_volname($storecfg, $volid);
        if ($vtype eq 'iso' || $vtype eq 'vztmpl') {
            # we simply allow access 
        } elsif (defined($ownervm) && defined($vmid) && ($ownervm == $vmid)) {
@@ -306,13 +303,9 @@ sub check_volume_access {
     } else {
        die "Only root can pass arbitrary filesystem paths."
            if $user ne 'root@pam';
-
-       $path = abs_path($volid);
-       if ($path =~ m|^(/.+)$|) {
-           $path = $1; # untaint any path
-       }
     }
-    return $path;
+
+    return undef;
 }
 
 sub is_group_member {