You've already forked macports-base
mirror of
https://github.com/macports/macports-base.git
synced 2026-07-12 18:18:43 -07:00
Makefile: be more cautious changing RUNUSR home dir
Don't update the home dir unless the user otherwise appears to be the one that we created. Also warn if it has a login shell set. Closes: https://trac.macports.org/ticket/70938
This commit is contained in:
+6
-1
@@ -69,7 +69,12 @@ ifeq ($(DESTDIR),)
|
||||
${DSCL} -q . -create "/Users/${RUNUSR}" UserShell /usr/bin/false ; \
|
||||
fi ; \
|
||||
RUNUSR_UID=$$(${DSCL} -q . -read "/Users/${RUNUSR}" UniqueID | /usr/bin/awk '{print $$2}'); \
|
||||
if test "$$RUNUSR_UID" -gt 500; then \
|
||||
RUNUSR_NAME=$$(${DSCL} -q . -read "/Users/${RUNUSR}" RealName | /usr/bin/awk '{print $$2}'); \
|
||||
RUNUSR_SHELL=$$(${DSCL} -q . -read "/Users/${RUNUSR}" UserShell | /usr/bin/awk '{print $$2}'); \
|
||||
if test "$$RUNUSR_SHELL" != "/usr/bin/false"; then \
|
||||
echo "Warning: user '${RUNUSR}' appears to be a login user (should be unprivileged)" ; \
|
||||
fi ; \
|
||||
if test "$$RUNUSR_UID" -gt 500 -a "$$RUNUSR_SHELL" = "/usr/bin/false" -a "$$RUNUSR_NAME" = "MacPorts" ; then \
|
||||
if test "$$(${DSCL} -q . -read "/Users/${RUNUSR}" NFSHomeDirectory)" != "NFSHomeDirectory: ${localstatedir}/macports/home" ; then \
|
||||
echo "Updating home directory location for user \"${RUNUSR}\"" ; \
|
||||
${DSCL} -q . -create "/Users/${RUNUSR}" NFSHomeDirectory "${localstatedir}/macports/home" ; \
|
||||
|
||||
Reference in New Issue
Block a user