[pve-devel] [PATCH container v2 3/3] skip features when restoring an unprivileged container as privileged

Dominik Csapak d.csapak at proxmox.com
Wed Aug 4 12:51:09 CEST 2021


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/PVE/LXC/Create.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/PVE/LXC/Create.pm b/src/PVE/LXC/Create.pm
index e8233b6..eea7c0d 100644
--- a/src/PVE/LXC/Create.pm
+++ b/src/PVE/LXC/Create.pm
@@ -320,6 +320,11 @@ sub sanitize_and_merge_config {
 	# storage supports creating a template there
 	next if $key =~ /^template$/;
 
+	if ($restricted && $key eq 'features' && !$conf->{unprivileged} && $oldconf->{unprivileged}) {
+	    warn "changing from unprivileged to privileged, skipping features\n";
+	    next;
+	}
+
 	if ($key eq 'lxc' && $restricted) {
 	    my $lxc_list = $oldconf->{'lxc'};
 	    warn "skipping custom lxc options, restore manually as root:\n";
-- 
2.30.2






More information about the pve-devel mailing list