diff options
author | Ulrich Müller <ulm@gentoo.org> | 2015-01-16 09:25:25 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2015-01-21 21:33:17 +0100 |
commit | 20f66485526b69eb26f2e70bd835a5e1333559d5 (patch) | |
tree | 2571c73468acb238fbae55f3655e757ff284319f /lib-src/Makefile.in | |
parent | 59e7fe6d0c6988687b53c279941c9ebb3f887eed (diff) | |
download | emacs-20f66485526b69eb26f2e70bd835a5e1333559d5.tar.gz |
Allow update-game-score to run sgid instead of suid.
* configure.ac (gamegroup): New AC_SUBST.
(--with-gameuser): Allow to specify a group instead of a user.
In the default case, check at configure time if a 'games' user
exists.
* lib-src/update-game-score.c: Allow the program to run sgid
instead of suid, in order to match common practice for most games.
(main): Check if we are running sgid. Pass appropriate file
permission bits to 'write_scores'.
(write_scores): New 'mode' argument, instead of hardcoding 0644.
(get_prefix): Update error message.
* lib-src/Makefile.in (gamegroup): New variable, set by configure.
($(DESTDIR)${archlibdir}): Handle both suid or sgid when
installing the 'update-game-score' program.
* lisp/play/gamegrid.el (gamegrid-add-score-with-update-game-score):
Allow the 'update-game-score' helper program to run suid or sgid.
Diffstat (limited to 'lib-src/Makefile.in')
-rw-r--r-- | lib-src/Makefile.in | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 01592bd21a5..2997f1b35a8 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -122,6 +122,7 @@ archlibdir=@archlibdir@ gamedir=@gamedir@ gameuser=@gameuser@ +gamegroup=@gamegroup@ # ==================== Utility Programs for the Build ================= @@ -263,10 +264,17 @@ $(DESTDIR)${archlibdir}: all umask 022; ${MKDIR_P} "$(DESTDIR)${gamedir}"; \ touch "$(DESTDIR)${gamedir}/snake-scores"; \ touch "$(DESTDIR)${gamedir}/tetris-scores" - -if chown ${gameuser} "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && chmod u+s "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; then \ - chown ${gameuser} "$(DESTDIR)${gamedir}"; \ - chmod u=rwx,g=rwx,o=rx "$(DESTDIR)${gamedir}"; \ - fi +ifneq ($(gameuser),) + chown ${gameuser} "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" + chmod u+s,go-r "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" + chown ${gameuser} "$(DESTDIR)${gamedir}" + chmod u=rwx,g=rx,o=rx "$(DESTDIR)${gamedir}" +else ifneq ($(gamegroup),) + chgrp ${gamegroup} "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" + chmod g+s,o-r "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" + chgrp ${gamegroup} "$(DESTDIR)${gamedir}" + chmod u=rwx,g=rwx,o=rx "$(DESTDIR)${gamedir}" +endif exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \ if [ "$$exp_archlibdir" != "`cd ${srcdir} && /bin/pwd`" ]; then \ for file in ${SCRIPTS}; do \ |