[pve-devel] [PATCH RFC container] fix #1225: restore without config changes for VMUser

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Dec 15 16:16:15 CET 2016


On Thu, Dec 15, 2016 at 04:10:55PM +0100, Fabian Grünbichler wrote:
> this makes the behaviour similar to VM restore operations
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> ---
>  src/PVE/API2/LXC.pm | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
> index 423c90e..cb8df4a 100644
> --- a/src/PVE/API2/LXC.pm
> +++ b/src/PVE/API2/LXC.pm
> @@ -218,13 +218,13 @@ __PACKAGE__->register_method({
>  	    raise_perm_exc();
>  	}
>  
> -	PVE::LXC::check_ct_modify_config_perm($rpcenv, $authuser, $vmid, $pool, $param, []);
> -
> +	my $ostemplate = extract_param($param, 'ostemplate');
>  	my $storage = extract_param($param, 'storage') // 'local';
>  
> +	PVE::LXC::check_ct_modify_config_perm($rpcenv, $authuser, $vmid, $pool, $param, []);
> +
>  	my $storage_cfg = cfs_read_file("storage.cfg");
>  
> -	my $ostemplate = extract_param($param, 'ostemplate');
>  
>  	my $archive;
>  
> -- 
> 2.1.4

RFC because IMHO this behaviour is not optimal (for both containers and
VMs). If a VMUser has more than one VM but no VM.Config.Options
permission, they can effectively copy the configuration of one guest
system (e.g. the one with the most powerful HW) to the other ones with
Backup & Restore. If a VMAdmin changes the configuration of a guest
system but misses an old Backup of the guest, the VMUser could also
restore the backup and old configuration, thus undoing the change.

does anyone see other options besides diffing the backed up and current
configurations and checking the permissions for the changes? that seems
very cumbersome and error-prone..




More information about the pve-devel mailing list