2016-02-21 23:00:09 +01:00
|
|
|
From ef847479778cc58818e066b87aa1789ba1c4148b Mon Sep 17 00:00:00 2001
|
2016-02-21 23:00:08 +01:00
|
|
|
From: Johan Oudinet <johan.oudinet@gmail.com>
|
2016-02-21 23:00:09 +01:00
|
|
|
Date: Wed, 20 Jan 2016 09:34:07 -0500
|
2016-02-21 23:00:08 +01:00
|
|
|
Subject: [PATCH] fix install permissions
|
|
|
|
|
|
|
|
Without this patch, the makefile will try to install directories and
|
|
|
|
files with incompatible permissions for ejabberd, which run as an
|
|
|
|
ejabberd user.
|
2016-02-21 23:00:09 +01:00
|
|
|
|
|
|
|
Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
|
2015-01-12 10:32:20 +01:00
|
|
|
|
2015-07-08 11:54:14 +02:00
|
|
|
diff --git a/Makefile.in b/Makefile.in
|
2017-06-06 16:33:11 +02:00
|
|
|
index a0b4553d..2cae2db4 100644
|
2015-07-08 11:54:14 +02:00
|
|
|
--- a/Makefile.in
|
|
|
|
+++ b/Makefile.in
|
2017-06-06 16:33:11 +02:00
|
|
|
@@ -169,10 +169,8 @@ copy-files-sub: copy-files-sub2
|
2016-01-11 17:26:15 +01:00
|
|
|
install: all copy-files
|
2015-01-12 10:32:20 +01:00
|
|
|
#
|
|
|
|
# Configuration files
|
|
|
|
- $(INSTALL) -d -m 750 $(G_USER) $(ETCDIR)
|
2015-07-08 11:54:14 +02:00
|
|
|
- [ -f $(ETCDIR)/ejabberd.yml ] \
|
2015-01-12 10:32:20 +01:00
|
|
|
- && $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml-new \
|
|
|
|
- || $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml
|
2015-07-08 11:54:14 +02:00
|
|
|
+ $(INSTALL) -d $(ETCDIR)
|
2016-01-11 17:26:15 +01:00
|
|
|
+ $(INSTALL) -b -m 644 ejabberd.yml.example $(ETCDIR)/ejabberd.yml
|
2017-06-06 16:33:11 +02:00
|
|
|
$(SED) -e "s*{{rootdir}}*@prefix@*g" \
|
|
|
|
-e "s*{{installuser}}*@INSTALLUSER@*g" \
|
|
|
|
-e "s*{{bindir}}*@bindir@*g" \
|
|
|
|
@@ -183,53 +181,16 @@ install: all copy-files
|
|
|
|
-e "s*{{erl}}*@ERL@*g" \
|
|
|
|
-e "s*{{epmd}}*@EPMD@*g" ejabberdctl.template \
|
2015-01-12 10:32:20 +01:00
|
|
|
> ejabberdctl.example
|
2015-07-08 11:54:14 +02:00
|
|
|
- [ -f $(ETCDIR)/ejabberdctl.cfg ] \
|
2015-01-12 10:32:20 +01:00
|
|
|
- && $(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
|
2016-01-11 17:26:15 +01:00
|
|
|
- $(INSTALL) -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc
|
|
|
|
+ $(INSTALL) -b -m 644 ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
|
|
|
|
+ $(INSTALL) -b -m 644 inetrc $(ETCDIR)/inetrc
|
2015-01-12 10:32:20 +01:00
|
|
|
#
|
|
|
|
# Administration script
|
|
|
|
- [ -d $(SBINDIR) ] || $(INSTALL) -d -m 755 $(SBINDIR)
|
|
|
|
- $(INSTALL) -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
|
|
|
|
+ $(INSTALL) -D ejabberdctl.example $(SBINDIR)/ejabberdctl
|
2015-07-08 11:54:14 +02:00
|
|
|
# Elixir binaries
|
|
|
|
[ -d $(BINDIR) ] || $(INSTALL) -d -m 755 $(BINDIR)
|
2015-10-13 12:04:36 +02:00
|
|
|
[ -f deps/elixir/bin/iex ] && $(INSTALL) -m 550 $(G_USER) deps/elixir/bin/iex $(BINDIR)/iex || true
|
2017-06-06 16:33:11 +02:00
|
|
|
[ -f deps/elixir/bin/elixir ] && $(INSTALL) -m 550 $(G_USER) deps/elixir/bin/elixir $(BINDIR)/elixir || true
|
|
|
|
[ -f deps/elixir/bin/mix ] && $(INSTALL) -m 550 $(G_USER) deps/elixir/bin/mix $(BINDIR)/mix || true
|
|
|
|
- #
|
|
|
|
- # Init script
|
|
|
|
- $(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" \
|
|
|
|
- -e "s*@installuser@*$(INIT_USER)*g" ejabberd.init.template \
|
|
|
|
- > ejabberd.init
|
|
|
|
- chmod 755 ejabberd.init
|
|
|
|
- #
|
|
|
|
- # Service script
|
|
|
|
- $(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" ejabberd.service.template \
|
|
|
|
- > ejabberd.service
|
|
|
|
- chmod 644 ejabberd.service
|
2015-01-12 10:32:20 +01:00
|
|
|
- #
|
|
|
|
- # Spool directory
|
|
|
|
- $(INSTALL) -d -m 750 $(O_USER) $(SPOOLDIR)
|
|
|
|
- $(CHOWN_COMMAND) -R @INSTALLUSER@ $(SPOOLDIR) >$(CHOWN_OUTPUT)
|
|
|
|
- chmod -R 750 $(SPOOLDIR)
|
|
|
|
- [ ! -f $(COOKIEFILE) ] || { $(CHOWN_COMMAND) @INSTALLUSER@ $(COOKIEFILE) >$(CHOWN_OUTPUT) ; chmod 400 $(COOKIEFILE) ; }
|
|
|
|
- #
|
|
|
|
- # ejabberdctl lock directory
|
|
|
|
- $(INSTALL) -d -m 750 $(O_USER) $(CTLLOCKDIR)
|
|
|
|
- $(CHOWN_COMMAND) -R @INSTALLUSER@ $(CTLLOCKDIR) >$(CHOWN_OUTPUT)
|
|
|
|
- chmod -R 750 $(CTLLOCKDIR)
|
|
|
|
- #
|
|
|
|
- # Log directory
|
|
|
|
- $(INSTALL) -d -m 750 $(O_USER) $(LOGDIR)
|
|
|
|
- $(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT)
|
|
|
|
- chmod -R 750 $(LOGDIR)
|
2015-07-08 11:54:14 +02:00
|
|
|
- #
|
|
|
|
- # Documentation
|
|
|
|
- $(INSTALL) -d $(DOCDIR)
|
|
|
|
- [ -f doc/guide.html ] \
|
|
|
|
- && $(INSTALL) -m 644 doc/guide.html $(DOCDIR) \
|
|
|
|
- || echo "Documentation not included in sources"
|
|
|
|
- $(INSTALL) -m 644 COPYING $(DOCDIR)
|
2016-02-21 23:00:08 +01:00
|
|
|
|
2017-06-06 16:33:11 +02:00
|
|
|
uninstall: uninstall-binary
|