From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 04CC11FF0ED for ; Fri, 31 Jul 2026 14:00:01 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D3D4121571; Fri, 31 Jul 2026 13:59:50 +0200 (CEST) From: Elias Huhsovitz To: pve-devel@lists.proxmox.com Subject: [PATCH container v3 0/2] fix #7164: restore: apply password and ssh keys Date: Fri, 31 Jul 2026 13:59:41 +0200 Message-ID: <20260731115943.94756-1-e.huhsovitz@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785499176224 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.117 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: MR4EA4YNWGM44Q2EOJEXEKS742YMXDMV X-Message-ID-Hash: MR4EA4YNWGM44Q2EOJEXEKS742YMXDMV X-MailFrom: e.huhsovitz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Elias Huhsovitz X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This patch series fixes Bug #7164. When restoring a container via `pct restore`, the options `--password` and `--ssh-public-keys` are silently ignored. Patch 1/2 fixes the bug by introducing a new `post_restore_hook` to the LXC setup plugin architecture. This hook applies the provided credentials if they are provided. Patch 2/2 adds a `check_systemd_nesting` call to the new restore hook for consistency with container creation and cloning. Note: This might cause a `die` in some edge cases and is not essential to fixing bug #7164. Therefore consider patch 2/2 optional. Changes v2 -> v3: ----------------- * Split `check_systemd_nesting()` addition into optional second patch. * Replace `defined` check for ssh keys with truthy check to match creation logic. * Shorten commit message. * Fix formatting in commit message. Changes v1 -> v2: ----------------- * Move logic into new function `post_restore_hook`. * Do not call `post_create_hook` unconditionally. * Conditionally call functions to: - set password - set ssh keys * Call `check_systemd_nesting()` for pct restore. Previous Versions ----------------- v2: https://lore.proxmox.com/pve-devel/20260729082545.17885-1-e.huhsovitz@proxmox.com/ v1: https://lore.proxmox.com/pve-devel/20260716153959.183045-1-e.huhsovitz@proxmox.com/ Summary of Changes ------------------ Elias Huhsovitz (2): fix #7164: restore: apply password and ssh keys restore: check systemd nesting src/PVE/API2/LXC.pm | 2 +- src/PVE/LXC/Setup.pm | 9 +++++++++ src/PVE/LXC/Setup/Base.pm | 9 +++++++++ src/PVE/LXC/Setup/Plugin.pm | 5 +++++ src/PVE/LXC/Setup/Unmanaged.pm | 4 ++++ 5 files changed, 28 insertions(+), 1 deletion(-) -- 2.47.3