summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-03-12 12:04:10 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-03-12 12:04:10 -0700
commit995be66f0f0d26d1a96cbb8dfb429c3941157771 (patch)
treebdfcd011288f3ee5ca2ae228c5830f8d11b9f41f /lib-src
parentf7040f5b1615162845c84f41125f008a5eb604f3 (diff)
downloademacs-995be66f0f0d26d1a96cbb8dfb429c3941157771.tar.gz
Install update-game-score only on request
Most distributions do not install update-game-score properly due to setuid/setgid complications, so install it only when the installer specifies a user or group (Bug#25895). * .gitattributes: Remove lib-src/update-game-score.exe.manifest. * Makefile.in (gameuser, gamegroup, use_gamedir, PATH_GAME): New vars. (epaths-force): Use PATH_GAME. (uninstall): Remove snake-scores and tetris-scores only if shared. * configure.ac: Default --with-gameuser to 'no'. (UPDATE_MANIFEST): Remove. * etc/NEWS: Mention this. * lib-src/Makefile.in (UPDATE_MANIFEST): Remove. (use_gamedir): New macro. (UTILITIES): Remove update-game-score unless use_gamedir. (SCRIPTS): Remove $(UPDATE_MANIFEST). ($(DESTDIR)${archlibdir}): Install game directory program and data only if use_gamedir. * lib-src/update-game-score.exe.manifest: Remove, as update-game-score is no longer installed on MS-Windows. * lisp/play/gamegrid.el (gamegrid-add-score-with-update-game-score): Use auxiliary program only if setuid or setgid. * make-dist: Do not distribute update-game-score.exe.manifest. * src/callproc.c (init_callproc): Set Vshared_game_score_directory based on PATH_GAME, not DOS_NT. (syms_of_callproc): Remove unnecessary initialization of Vshared_game_score_directory.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/Makefile.in50
-rw-r--r--lib-src/update-game-score.exe.manifest10
2 files changed, 23 insertions, 37 deletions
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 88f62805765..d0aa9cc7c27 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -40,7 +40,6 @@ C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
PROFILING_CFLAGS = @PROFILING_CFLAGS@
WARN_CFLAGS = @WARN_CFLAGS@
WERROR_CFLAGS = @WERROR_CFLAGS@
-UPDATE_MANIFEST = @UPDATE_MANIFEST@
# Program name transformation.
TRANSFORM = @program_transform_name@
@@ -130,9 +129,15 @@ abs_top_srcdir=@abs_top_srcdir@
# to '../configure'.
archlibdir=@archlibdir@
-gamedir=@gamedir@
+# User or group of the auxiliary program update-game-score, which is
+# installed on platforms with a game directory shared by multiple users.
+# On other platforms Emacs can update the score files itself.
gameuser=@gameuser@
gamegroup=@gamegroup@
+# Where to install game score files, if gameuser or gamegroup is nonempty.
+gamedir=@gamedir@
+# Nonempty if and only if a shared gamedir is used.
+use_gamedir=$(gameuser)$(gamegroup)
# ==================== Utility Programs for the Build =================
@@ -156,13 +161,13 @@ INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} $(CLIENTW) \
# Things that Emacs runs internally, or during the build process,
# which should not be installed in bindir.
UTILITIES = profile${EXEEXT} movemail${EXEEXT} hexl${EXEEXT} \
- update-game-score${EXEEXT}
+ $(and $(use_gamedir), update-game-score${EXEEXT})
DONT_INSTALL= make-docfile${EXEEXT}
# Like UTILITIES, but they're not system-dependent, and should not be
# deleted by the distclean target.
-SCRIPTS= rcs2log $(UPDATE_MANIFEST)
+SCRIPTS= rcs2log
# All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
@@ -258,9 +263,6 @@ maybe-blessmail: $(BLESSMAIL_TARGET)
## Install the internal utilities. Until they are installed, we can
## just run them directly from lib-src.
-## If the chown/chmod commands fail, that is not a big deal.
-## update-game-score will detect at runtime that it is not setuid,
-## and handle things accordingly.
$(DESTDIR)${archlibdir}: all
@echo
@echo "Installing utilities run internally by Emacs."
@@ -272,28 +274,22 @@ $(DESTDIR)${archlibdir}: all
"$(DESTDIR)${archlibdir}/$$file" || exit; \
done ; \
fi
- umask 022 && ${MKDIR_P} "$(DESTDIR)${gamedir}" && \
+ ifneq (,$(use_gamedir))
+ umask 022 && ${MKDIR_P} "$(DESTDIR)${gamedir}"
touch "$(DESTDIR)${gamedir}/snake-scores" \
"$(DESTDIR)${gamedir}/tetris-scores"
-ifneq ($(gameuser),)
- if chown ${gameuser} \
- "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && \
- chmod u+s,go-r \
- "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; \
- then \
- chown ${gameuser} "$(DESTDIR)${gamedir}" && \
- chmod u=rwx,g=rx,o=rx "$(DESTDIR)${gamedir}"; \
- fi
-else ifneq ($(gamegroup),)
- if chgrp ${gamegroup} \
- "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}" && \
- chmod g+s,o-r \
- "$(DESTDIR)${archlibdir}/update-game-score${EXEEXT}"; \
- then \
- chgrp ${gamegroup} "$(DESTDIR)${gamedir}" && \
- chmod u=rwx,g=rwx,o=rx "$(DESTDIR)${gamedir}"; \
- fi
-endif
+ 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
+ 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
+ endif
exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd` && \
if [ "$$exp_archlibdir" != "`cd ${srcdir} && /bin/pwd`" ]; then \
for file in ${SCRIPTS}; do \
diff --git a/lib-src/update-game-score.exe.manifest b/lib-src/update-game-score.exe.manifest
deleted file mode 100644
index 1db836bec6b..00000000000
--- a/lib-src/update-game-score.exe.manifest
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
- <v3:trustInfo xmlns:v3="urn:schemas-microsoft-com:asm.v3">
- <v3:security>
- <v3:requestedPrivileges>
- <v3:requestedExecutionLevel level="asInvoker" />
- </v3:requestedPrivileges>
- </v3:security>
- </v3:trustInfo>
-</assembly>