Commit eceb9171 authored by Dietmar Maurer's avatar Dietmar Maurer

use C-wrapper for setgid perl script

Because perl-suid does not exist on wheezy.
parent 27aa457e
...@@ -5,7 +5,9 @@ DESTDIR= ...@@ -5,7 +5,9 @@ DESTDIR=
#SUBDIRS = bin lib www aplinfo #SUBDIRS = bin lib www aplinfo
SUBDIRS = aplinfo PVE bin www po SUBDIRS = aplinfo PVE bin www po
DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_all.deb ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb
all: ${SUBDIRS} all: ${SUBDIRS}
...@@ -43,7 +45,8 @@ ${DEB} deb: ...@@ -43,7 +45,8 @@ ${DEB} deb:
dpkg-deb --build dest dpkg-deb --build dest
mv dest.deb ${DEB} mv dest.deb ${DEB}
rm -rf dest rm -rf dest
lintian ${DEB} # supress lintian error: statically-linked-binary usr/bin/pvemailforward
lintian -X binaries ${DEB}
.PHONY: upload .PHONY: upload
upload: ${DEB} check upload: ${DEB} check
......
...@@ -13,6 +13,7 @@ SCRIPTS = \ ...@@ -13,6 +13,7 @@ SCRIPTS = \
pvedaemon \ pvedaemon \
pveversion \ pveversion \
pvesubscription \ pvesubscription \
pvemailforward.pl \
pveperf pveperf
MANS = \ MANS = \
...@@ -25,7 +26,7 @@ MANS = \ ...@@ -25,7 +26,7 @@ MANS = \
pvesubscription.1 \ pvesubscription.1 \
pveperf.1 pveperf.1
all: ${MANS} all: ${MANS} pvemailforward
%.1: %.1.pod %.1: %.1.pod
rm -f $@ rm -f $@
...@@ -46,12 +47,15 @@ pvesubscription.1.pod: pvesubscription ...@@ -46,12 +47,15 @@ pvesubscription.1.pod: pvesubscription
vzrestore.1.pod: vzrestore vzrestore.1.pod: vzrestore
perl -I.. ./vzrestore printmanpod >$@ perl -I.. ./vzrestore printmanpod >$@
pvemailforward: pvemailforward.c
gcc $< -o $@ -g -O2 -Wall -ldl -lc
.PHONY: install .PHONY: install
install: ${SCRIPTS} ${MANS} pvemailforward install: ${SCRIPTS} ${MANS} pvemailforward
perl -I.. ./pvesh verifyapi perl -I.. ./pvesh verifyapi
install -d ${BINDIR} install -d ${BINDIR}
install -m 0755 ${SCRIPTS} ${BINDIR} install -m 0755 ${SCRIPTS} ${BINDIR}
install -m 2755 -g www-data pvemailforward ${BINDIR} install -s -m 2755 -g www-data pvemailforward ${BINDIR}
install -d ${MAN1DIR} install -d ${MAN1DIR}
install -m 0644 ${MANS} ${MAN1DIR} install -m 0644 ${MANS} ${MAN1DIR}
install -d ${PODDIR} install -d ${PODDIR}
...@@ -67,5 +71,5 @@ distclean: clean ...@@ -67,5 +71,5 @@ distclean: clean
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf *~ ${MANS} *.1.pod rm -rf *~ ${MANS} *.1.pod pvemailforward
set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
/* see 'man perlsec'
*
*/
#include <unistd.h>
#include <stdio.h>
#define REAL_PATH "/usr/bin/pvemailforward.pl"
int main(ac, av)
char **av;
{
execv(REAL_PATH, av);
fprintf(stderr, "exec '%s' failed\n", REAL_PATH);
return -1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment