set /www-data access only if sudo

This commit is contained in:
Olof hagsand 2018-07-29 20:22:20 +02:00
parent e48f8dd00e
commit f9a97c57ca

View file

@ -99,9 +99,13 @@ distclean: clean
# Put other executables in libexec/ # Put other executables in libexec/
# Also create a libexec/ directory for writeable/temporary files. # Also create a libexec/ directory for writeable/temporary files.
# Put config file in etc/ # Put config file in etc/
# Shouldnt www-dir be owned by www-data? # Also a rule for letting www-dir be owned by www-data, which only orks for sudo
install: install-lib $(APPL) install: install-lib $(APPL)
ifeq ($(shell whoami),root)
install -d -m 0755 -o $(wwwuser) -g $(wwwuser) $(DESTDIR)$(wwwdir) install -d -m 0755 -o $(wwwuser) -g $(wwwuser) $(DESTDIR)$(wwwdir)
else
install -d -m 0755 $(DESTDIR)$(wwwdir)
endif
install -m 0755 $(INSTALLFLAGS) $(APPL) $(DESTDIR)$(wwwdir) install -m 0755 $(INSTALLFLAGS) $(APPL) $(DESTDIR)$(wwwdir)
install-lib: $(MYLIB) install-lib: $(MYLIB)