aboutsummaryrefslogtreecommitdiffstats
path: root/glougloud
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-12-02 21:55:06 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-12-02 21:55:06 +0100
commit71a01a5d3b88341b0b3efdf9195a69142f8d6d91 (patch)
tree9405465ea93d369120a9eaed0600c7c67fac7ea5 /glougloud
parentuse libglouglou droppriv to user _glougloud, and create group/user (diff)
downloadglouglou-71a01a5d3b88341b0b3efdf9195a69142f8d6d91.tar.xz
glouglou-71a01a5d3b88341b0b3efdf9195a69142f8d6d91.zip
use a variable to store dedicated USER _glougloud
Diffstat (limited to 'glougloud')
-rw-r--r--glougloud/Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/glougloud/Makefile b/glougloud/Makefile
index 6e66791..5308f40 100644
--- a/glougloud/Makefile
+++ b/glougloud/Makefile
@@ -2,6 +2,7 @@ PROG = glougloud
OBJS = glougloud.o
CFLAGS+=-Wall -g
LDFLAGS=-levent -lglouglou
+USER = _glougloud
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
@@ -11,14 +12,14 @@ all:
$(CC) $(OBJS) -o $(PROG) $(LDFLAGS)
install: $(PROG)
- @echo "creating group and user _glougloud"
+ @echo "creating group and user $(USER)"
@uname -a |grep -i linux >/dev/null ;\
if [ $$? -eq 0 ]; then \
- cmdg="groupadd -r _glougloud" ;\
- cmdu="useradd -r -g _glougloud -d /var/empty/ -s /sbin/nologin _glougloud" ;\
+ cmdg="groupadd -r $(USER)" ;\
+ cmdu="useradd -r -g $(USER) -d /var/empty/ -s /sbin/nologin $(USER)" ;\
else \
cmdg="" ;\
- cmdu="useradd -g =uid -d /var/empty/ -s /sbin/nologin _glougloud" ;\
+ cmdu="useradd -g =uid -d /var/empty/ -s /sbin/nologin $(USER)" ;\
fi ;\
echo $$cmdg; $$($$cmdg) ;\
echo $$cmdu; $$($$cmdu) ;\