diff options
author | Badlop <badlop@process-one.net> | 2008-07-14 10:06:13 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2008-07-14 10:06:13 +0000 |
commit | 3f87768c8cd4d72fcbc3650c6802e1a0c9d570ac (patch) | |
tree | 537a7f07214502100433b4b0bbab7bafd453b59a /src | |
parent | * src/Makefile.in: Fix docdir so it recognizes prefix. If sbin dir (diff) |
* doc/guide.tex: Update what permissions does enable-user grant
* doc/guide.html: Likewise
* src/configure.ac: Don't explicitely put root privileges when a
user is not explicitely enabled
* src/configure: Likewise
* src/Makefile.in: Likewise
SVN Revision: 1443
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.in | 41 | ||||
-rwxr-xr-x | src/configure | 9 | ||||
-rw-r--r-- | src/configure.ac | 11 |
3 files changed, 41 insertions, 20 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index cef4707b..beab1e66 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -14,6 +14,20 @@ ERLANG_LIBS = @ERLANG_LIBS@ ASN_FLAGS = -bber_bin +der +compact_bit_string +optimize +noobj +INSTALLUSER=@INSTALLUSER@ +# if no user was enabled, don't set privileges or ownership +ifeq ($(INSTALLUSER),) + O_USER= + G_USER= + CHOWN_COMMAND=echo + CHOWN_OUTPUT=/dev/null +else + O_USER=-o $(INSTALLUSER) + G_USER=-g $(INSTALLUSER) + CHOWN_COMMAND=chown + CHOWN_OUTPUT=&1 +endif + EFLAGS += @ERLANG_SSL39@ EFLAGS += -I ../include @@ -44,7 +58,7 @@ endif INSTALL_EPAM= ifeq (@pam@, pam) - INSTALL_EPAM=install -m 750 -o @INSTALLUSER@ epam $(PBINDIR) + INSTALL_EPAM=install -m 750 $(O_USER) epam $(PBINDIR) endif prefix = @prefix@ @@ -145,12 +159,13 @@ $(ERLSHLIBS): %.so: %.c $(DYNAMIC_LIB_CFLAGS) install: all + echo "AA: '$(AA)'" # # Configuration files - install -d -m 750 -g @INSTALLUSER@ $(ETCDIR) + install -d -m 750 $(G_USER) $(ETCDIR) [ -f $(ETCDIR)/ejabberd.cfg ] \ - && install -b -m 640 -g @INSTALLUSER@ ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg-new \ - || install -b -m 640 -g @INSTALLUSER@ ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg + && install -b -m 640 $(G_USER) ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg-new \ + || install -b -m 640 $(G_USER) ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg sed -e "s*@rootdir@*@prefix@*" \ -e "s*@installuser@*@INSTALLUSER@*" \ -e "s*@LIBDIR@*@libdir@*" \ @@ -159,13 +174,13 @@ install: all -e "s*@erl@*@ERL@*" ejabberdctl.template \ > ejabberdctl.example [ -f $(ETCDIR)/ejabberdctl.cfg ] \ - && install -b -m 640 -g @INSTALLUSER@ ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \ - || install -b -m 640 -g @INSTALLUSER@ ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg - install -b -m 644 -g @INSTALLUSER@ inetrc $(ETCDIR)/inetrc + && install -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \ + || install -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg + install -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc # # Administration script [ -d $(SBINDIR) ] || install -d 750 $(SBINDIR) - install -m 550 -g @INSTALLUSER@ ejabberdctl.example $(SBINDIR)/ejabberdctl + install -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl # # Binary Erlang files install -d $(BEAMDIR) @@ -190,14 +205,14 @@ install: all install -m 644 msgs/*.msg $(MSGSDIR) # # Spool directory - install -d -m 750 -o @INSTALLUSER@ $(SPOOLDIR) - chown -R @INSTALLUSER@ $(SPOOLDIR) + install -d -m 750 $(O_USER) $(SPOOLDIR) + $(CHOWN_COMMAND) -R @INSTALLUSER@ $(SPOOLDIR) >$(CHOWN_OUTPUT) chmod -R 750 $(SPOOLDIR) - [ ! -f $(COOKIEFILE) ] || { chown @INSTALLUSER@ $(COOKIEFILE) ; chmod 400 $(COOKIEFILE) ; } + [ ! -f $(COOKIEFILE) ] || { $(CHOWN_COMMAND) @INSTALLUSER@ $(COOKIEFILE) >$(CHOWN_OUTPUT) ; chmod 400 $(COOKIEFILE) ; } # # Log directory - install -d -m 750 -o @INSTALLUSER@ $(LOGDIR) - chown -R @INSTALLUSER@ $(LOGDIR) + install -d -m 750 $(O_USER) $(LOGDIR) + $(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT) chmod -R 750 $(LOGDIR) # # Documentation diff --git a/src/configure b/src/configure index f77db635..6ce0e31f 100755 --- a/src/configure +++ b/src/configure @@ -5909,18 +5909,21 @@ fi -ENABLEUSER=root +ENABLEUSER="" # Check whether --enable-user was given. if test "${enable_user+set}" = set; then enableval=$enable_user; case "${enableval}" in yes) ENABLEUSER=`whoami` ;; + no) ENABLEUSER="" ;; *) ENABLEUSER=$enableval esac - echo "allow this system user to start ejabberd: $ENABLEUSER" fi -INSTALLUSER=$ENABLEUSER +if test "$ENABLEUSER" != ""; then + echo "allow this system user to start ejabberd: $ENABLEUSER" + INSTALLUSER=$ENABLEUSER +fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure diff --git a/src/configure.ac b/src/configure.ac index ee19d9c5..ba638463 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -122,15 +122,18 @@ else fi AC_CHECK_HEADER(krb5.h,,) -ENABLEUSER=root +ENABLEUSER="" AC_ARG_ENABLE(user, [AS_HELP_STRING([--enable-user[[[[=USER]]]]], [allow this system user to start ejabberd (default: no)])], [case "${enableval}" in yes) ENABLEUSER=`whoami` ;; + no) ENABLEUSER="" ;; *) ENABLEUSER=$enableval - esac - echo "allow this system user to start ejabberd: $ENABLEUSER"], + esac], []) -AC_SUBST([INSTALLUSER], [$ENABLEUSER]) +if test "$ENABLEUSER" != ""; then + echo "allow this system user to start ejabberd: $ENABLEUSER" + AC_SUBST([INSTALLUSER], [$ENABLEUSER]) +fi AC_OUTPUT |