aboutsummaryrefslogtreecommitdiffstats
path: root/glougloud/Makefile
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-12-02 21:49:19 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-12-02 21:49:19 +0100
commit2438eadd49b3d0d1153498ffc883d8c0c3e6ecba (patch)
tree8245c87648df66094c281bbe706ebd618b656620 /glougloud/Makefile
parentwording (diff)
downloadglouglou-2438eadd49b3d0d1153498ffc883d8c0c3e6ecba.tar.xz
glouglou-2438eadd49b3d0d1153498ffc883d8c0c3e6ecba.zip
use libglouglou droppriv to user _glougloud, and create group/user
during make install
Diffstat (limited to 'glougloud/Makefile')
-rw-r--r--glougloud/Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/glougloud/Makefile b/glougloud/Makefile
index f3ac56c..6e66791 100644
--- a/glougloud/Makefile
+++ b/glougloud/Makefile
@@ -11,6 +11,18 @@ all:
$(CC) $(OBJS) -o $(PROG) $(LDFLAGS)
install: $(PROG)
+ @echo "creating group and user _glougloud"
+ @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" ;\
+ else \
+ cmdg="" ;\
+ cmdu="useradd -g =uid -d /var/empty/ -s /sbin/nologin _glougloud" ;\
+ fi ;\
+ echo $$cmdg; $$($$cmdg) ;\
+ echo $$cmdu; $$($$cmdu) ;\
+ echo done
@echo "installation of $(PROG)"
mkdir -p $(BINDIR)
install -m 0755 $(PROG) $(BINDIR)