From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 4EC6D1FF17C for ; Wed, 25 Jun 2025 14:20:01 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2E61513AC6; Wed, 25 Jun 2025 14:20:30 +0200 (CEST) From: Lukas Wagner To: pve-devel@lists.proxmox.com Date: Wed, 25 Jun 2025 14:20:12 +0200 Message-Id: <20250625122012.226237-3-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250625122012.226237-1-l.wagner@proxmox.com> References: <20250625122012.226237-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.019 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH proxmox-mail-forward 1/1] install to /usr/libexec instead of /usr/bin X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" /usr/libexec is intended for binaries which are not intended to be called by users manually. proxmox-mail-forwarded is only ever supposed to be called by Postfix via the forwarding mechanism in /root/.forward, so the binary should be located in /usr/libexec. The postinst script will automatically migrate the contents of /root/.forward if needed. Signed-off-by: Lukas Wagner --- Makefile | 2 -- debian/lintian-overrides | 2 +- debian/proxmox-mail-forward.postinst | 13 ++++++++++--- debian/rules | 9 ++++++++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 719a865..8b0f728 100644 --- a/Makefile +++ b/Makefile @@ -53,9 +53,7 @@ cargo-build: --bin proxmox-mail-forward install: cargo-build - install -dm755 $(DESTDIR)/usr/bin $(CARGO) install - chmod u+s $(DESTDIR)/usr/bin/$(PACKAGE) .PHONY: upload upload: $(DEBS) diff --git a/debian/lintian-overrides b/debian/lintian-overrides index bde570e..e8955c1 100644 --- a/debian/lintian-overrides +++ b/debian/lintian-overrides @@ -1 +1 @@ -proxmox-mail-forward: elevated-privileges 4755 root/root [usr/bin/proxmox-mail-forward] +proxmox-mail-forward: elevated-privileges 4755 root/root [usr/libexec/proxmox-mail-forward] diff --git a/debian/proxmox-mail-forward.postinst b/debian/proxmox-mail-forward.postinst index c4b8741..af4af8f 100755 --- a/debian/proxmox-mail-forward.postinst +++ b/debian/proxmox-mail-forward.postinst @@ -4,9 +4,16 @@ set -e case "$1" in configure) - # pve-manager is responsible for switching over, so skip when detecting pvemailforward - if ! test -f /root/.forward || ! grep -E -q '\|/usr/bin/(proxmox-mail-|pvemail)forward' /root/.forward; then - echo '|/usr/bin/proxmox-mail-forward' >>/root/.forward + # Always try to clean old entry, even when the + # /usr/libexec/proxmox-mail-forward entry is already present. This + # ensures it will still be cleaned after an upgrade following a + # downgrade. + if test -f /root/.forward; then + sed -i '\!|/usr/bin/proxmox-mail-forward!d' /root/.forward + fi + + if ! test -f /root/.forward || ! grep -q '|/usr/libexec/proxmox-mail-forward' /root/.forward; then + echo '|/usr/libexec/proxmox-mail-forward' >>/root/.forward fi ;; diff --git a/debian/rules b/debian/rules index c9fa5cd..cc2ec17 100755 --- a/debian/rules +++ b/debian/rules @@ -25,9 +25,16 @@ override_dh_auto_configure: $(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system dh_auto_configure +execute_after_dh_auto_install: + # Install the binary to /usr/libexec, not /usr/bin. Inspired by virtiofsd's d/rules + mkdir -p debian/proxmox-mail-forward/usr/libexec + mv debian/proxmox-mail-forward/usr/bin/proxmox-mail-forward debian/proxmox-mail-forward/usr/libexec/ + chmod u+s debian/proxmox-mail-forward/usr/libexec/proxmox-mail-forward + rmdir debian/proxmox-mail-forward/usr/bin + override_dh_fixperms: dh_fixperms --exclude proxmox-mail-forward override_dh_strip: dh_strip - patchelf --remove-needed librt.so.1 debian/proxmox-mail-forward/usr/bin/proxmox-mail-forward + patchelf --remove-needed librt.so.1 debian/proxmox-mail-forward/usr/libexec/proxmox-mail-forward -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel