[pve-devel] [PATCH container] prevent snapshot name 'vzdump' from user
Dominik Csapak
d.csapak at proxmox.com
Wed Feb 10 15:04:11 CET 2016
if someone makes a snapshot named 'vzdump', it would get deleted
when using vzdump in snapshot mode, since we use that name for
making a temporary one
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
src/PVE/API2/LXC/Snapshot.pm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/PVE/API2/LXC/Snapshot.pm b/src/PVE/API2/LXC/Snapshot.pm
index 7e3bf49..36bbbf7 100644
--- a/src/PVE/API2/LXC/Snapshot.pm
+++ b/src/PVE/API2/LXC/Snapshot.pm
@@ -123,6 +123,9 @@ __PACKAGE__->register_method({
die "unable to use snapshot name 'current' (reserved name)\n"
if $snapname eq 'current';
+ die "unable to use snapshot name 'vzdump' (reserved name)\n"
+ if $snapname eq 'vzdump';
+
my $realcmd = sub {
PVE::Cluster::log_msg('info', $authuser, "snapshot container $vmid: $snapname");
PVE::LXC::snapshot_create($vmid, $snapname, $param->{description});
--
2.1.4
More information about the pve-devel
mailing list