]> git.proxmox.com Git - pve-container.git/commitdiff
clone: check storage permissions
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 20 Mar 2018 11:19:13 +0000 (12:19 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 20 Mar 2018 13:27:21 +0000 (14:27 +0100)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
src/PVE/API2/LXC.pm

index 128a89b6b923c921aca76da0aee4206bdcad9014..0c9ee40c7834369b902dd4fe03d8ebe533b69531 100644 (file)
@@ -1326,6 +1326,13 @@ __PACKAGE__->register_method({
 
                        if ($mp->{type} eq 'volume') {
                            my $volid = $mp->{volume};
+
+                           my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
+                           $sid = $storage if defined($storage);
+                           my $scfg = PVE::Storage::storage_config($storecfg, $sid);
+
+                           $rpcenv->check($authuser, "/storage/$sid", ['Datastore.AllocateSpace']);
+
                            if ($full) {
                                die "Cannot do full clones on a running container without snapshots\n"
                                    if $running && !defined($snapname);