[pve-devel] [PATCH v2 container] push/pull permissions: use octal by default

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Apr 20 14:04:23 CEST 2016


---
Changes to v1:
add '0' prefix in order to default to octal instead of decimal

 src/PVE/CLI/pct.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
index 1c04329..fb2ec70 100755
--- a/src/PVE/CLI/pct.pm
+++ b/src/PVE/CLI/pct.pm
@@ -369,7 +369,7 @@ __PACKAGE__->register_method({
 	    },
 	    perms => {
 		type => 'string',
-		description => 'File permissions to use.',
+		description => "File permissions to use (octal by default, prefix with '0x' for hexadecimal).",
 		optional => 1,
 	    },
 	},
@@ -388,6 +388,7 @@ __PACKAGE__->register_method({
 	my $dest = extract_param($param, 'destination');
 
 	my $perms = extract_param($param, 'perms');
+	$perms = '0'.$perms if defined($perms) && $perms !~m/^0/;
 	my $user = extract_param($param, 'user');
 	my $group = extract_param($param, 'group');
 
@@ -450,7 +451,7 @@ __PACKAGE__->register_method({
 	    },
 	    perms => {
 		type => 'string',
-		description => 'File permissions to use.',
+		description => "File permissions to use (octal by default, prefix with '0x' for hexadecimal).",
 		optional => 1,
 	    },
 	},
@@ -469,6 +470,7 @@ __PACKAGE__->register_method({
 	my $dest = extract_param($param, 'destination');
 
 	my $perms = extract_param($param, 'perms');
+	$perms = '0'.$perms if defined($perms) && $perms !~m/^0/;
 	my $user = extract_param($param, 'user');
 	my $group = extract_param($param, 'group');
 
-- 
2.1.4





More information about the pve-devel mailing list