[pbs-devel] [PATCH manager 3/4] remove pvemailforward binary

Fiona Ebner f.ebner at proxmox.com
Fri Oct 21 15:02:51 CEST 2022


which was replaced by proxmox-mail-forward living in its own package.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 bin/Makefile             | 11 +++-------
 bin/pvemailforward.c     | 17 ---------------
 bin/pvemailforward.pl    | 45 ----------------------------------------
 debian/lintian-overrides |  4 ----
 debian/rules             |  2 +-
 5 files changed, 4 insertions(+), 75 deletions(-)
 delete mode 100644 bin/pvemailforward.c
 delete mode 100755 bin/pvemailforward.pl

diff --git a/bin/Makefile b/bin/Makefile
index fb475be3..55e5f20d 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -14,7 +14,6 @@ SCRIPTS =  			\
 	${CLITOOLS}		\
 	pvebanner		\
 	pveversion		\
-	pvemailforward.pl	\
 	pveupgrade		\
 	pveupdate		\
 	pveperf			\
@@ -37,7 +36,7 @@ ZSH_COMPLETIONS =						\
 	$(addsuffix .service-zsh-completion, ${SERVICES}) 	\
 	$(addsuffix .zsh-completion, ${CLITOOLS})		\
 
-all: ${SERVICE_MANS} ${CLI_MANS} pvemailforward
+all: ${SERVICE_MANS} ${CLI_MANS}
 
 %.1: %.1.pod
 	rm -f $@
@@ -56,20 +55,16 @@ pveversion.1.pod: pveversion
 pveupgrade.1.pod: pveupgrade
 pvereport.1.pod: pvereport
 
-pvemailforward: pvemailforward.c
-	$(CC) $(CPPFLAGS) $(CFLAGS) -Wall -g -O2 $< -o $@
-
 .PHONY: check
 check: $(addsuffix .service-api-verified, ${SERVICES}) $(addsuffix .api-verified, ${CLITOOLS})
 	rm -f *.service-api-verified *.api-verified
 
 .PHONY: install
-install: ${SCRIPTS} ${CLI_MANS} ${SERVICE_MANS} pvemailforward ${BASH_COMPLETIONS} ${ZSH_COMPLETIONS}
+install: ${SCRIPTS} ${CLI_MANS} ${SERVICE_MANS} ${BASH_COMPLETIONS} ${ZSH_COMPLETIONS}
 	install -d ${BINDIR}
 	install -m 0755 ${SCRIPTS} ${BINDIR}
 	install -d ${USRSHARE}/helpers
 	install -m 0755 pve-startall-delay ${USRSHARE}/helpers
-	install -s -m 2755 -g www-data pvemailforward ${BINDIR}
 	install -d ${MAN1DIR}
 	install -m 0644 ${CLI_MANS} ${MAN1DIR}
 	install -d ${MAN8DIR}
@@ -82,7 +77,7 @@ install: ${SCRIPTS} ${CLI_MANS} ${SERVICE_MANS} pvemailforward ${BASH_COMPLETION
 .PHONY: clean
 clean:
 	make cleanup-docgen
-	rm -rf *~ *.tmp ${CLI_MANS} ${SERVICE_MANS} *.1.pod *.8.pod pvemailforward  \
+	rm -rf *~ *.tmp ${CLI_MANS} ${SERVICE_MANS} *.1.pod *.8.pod		    \
 	    *.bash-completion *.service-bash-completion				    \
 	    *.zsh-completion *.service-zsh-completion				    \
 	    *.api-verified *.service-api-verified
diff --git a/bin/pvemailforward.c b/bin/pvemailforward.c
deleted file mode 100644
index 06013a63..00000000
--- a/bin/pvemailforward.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* see 'man perlsec'
- *
- */ 
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#define REAL_PATH "/usr/bin/pvemailforward.pl"
-
-int main(int argc, char **argv)
-{
-    execv(REAL_PATH, argv);
- 
-    fprintf(stderr, "exec '%s' failed\n", REAL_PATH);
-
-    exit(-1);
-}
diff --git a/bin/pvemailforward.pl b/bin/pvemailforward.pl
deleted file mode 100755
index 18a57497..00000000
--- a/bin/pvemailforward.pl
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/perl -T
-
-use strict;
-use warnings;
-use PVE::Tools;
-use PVE::SafeSyslog;
-use PVE::AccessControl;
-use PVE::Cluster qw (cfs_read_file);
-use PVE::DataCenterConfig;
-
-# NOTE: we need to run this with setgid www-data
-# else we cant read /etc/pve/user.cfg
-
-$( = $); # $GID = $EGID
-
-$ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
-
-initlog('pvemailforward');
-
-
-PVE::Cluster::cfs_update();
-
-eval {
-    my $usercfg = cfs_read_file("user.cfg");
-    my $rootcfg = $usercfg->{users}->{'root at pam'} || {};
-    my $mailto = $rootcfg->{email};
-
-    my $dcconf = cfs_read_file('datacenter.cfg');
-    my $mailfrom = $dcconf->{email_from} || "root";
-
-    die "user 'root\@pam' does not have a email address\n" if !$mailto;
-
-    syslog("info", "forward mail to <$mailto>");
-
-    # we never send DSN (avoid mail loops)
-    open(CMD, "|sendmail -bm -N never -f $mailfrom $mailto") ||
-	die "can't exec sendmail - $!\n";
-    while (<>) { print CMD $_; }
-    close(CMD);
-};
-if (my $err = $@) {
-    syslog('err', "mail forward failed: $err");
-}
-
-exit(0);
diff --git a/debian/lintian-overrides b/debian/lintian-overrides
index fba73dcf..e30e7054 100644
--- a/debian/lintian-overrides
+++ b/debian/lintian-overrides
@@ -1,11 +1,7 @@
 pve-manager: mail-transport-agent-dependency-does-not-specify-default-mta *
 pve-manager: no-manual-page usr/bin/pvebanner
-pve-manager: no-manual-page usr/bin/pvemailforward
-pve-manager: no-manual-page usr/bin/pvemailforward.pl
 pve-manager: no-manual-page usr/bin/pveupdate
 pve-manager: non-standard-dir-perm var/log/pveproxy/ 0700 != 0755
 pve-manager: package-installs-apt-sources etc/apt/sources.list.d/pve-enterprise.list
 pve-manager: privacy-breach-generic usr/share/pve-manager/touch/sencha-touch-all-debug.js *
-pve-manager: script-with-language-extension usr/bin/pvemailforward.pl
-pve-manager: setgid-binary usr/bin/pvemailforward 2755 root/www-data
 pve-manager: systemd-service-file-refers-to-unusual-wantedby-target lib/systemd/system/pvebanner.service getty.target
diff --git a/debian/rules b/debian/rules
index ec49d52d..f28352e1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,4 +13,4 @@ override_dh_strip_nondeterminism:
 	dh_strip_nondeterminism -X.png
 
 override_dh_fixperms:
-	dh_fixperms -Xpvemailforward -Xvar/log/pveproxy
+	dh_fixperms -Xvar/log/pveproxy
-- 
2.30.2






More information about the pbs-devel mailing list