we should probably check the current user just like when
bind/dev mountpoints are passed as regular parameters.
---
 src/PVE/API2/LXC.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 12aaffa..83afd56 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -353,6 +353,8 @@ __PACKAGE__->register_method({
                                my $type = $mountpoint->{type};
                                die "restoring rootfs to $type mount is only 
possible by specifying -rootfs manually!\n"
                                    if ($ms eq 'rootfs');
+                               die "restoring '$ms' to $type mount is only 
possible for root\n"
+                                   if $authuser ne 'root@pam';
 
                                if ($mountpoint->{backup}) {
                                    warn "WARNING - unsupported 
configuration!\n";
-- 
2.1.4


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to