Avoid dscl commands entirely if not root

Apparently Crowdstrike only cares that the shell script being executed
mentions 'dscl' and 'Password', regardless of whether it's in a
conditional branch that never gets executed.

See: https://trac.macports.org/ticket/69187
This commit is contained in:
Joshua Root
2025-07-30 09:24:12 +10:00
parent 2a7829df70
commit a215377381
4 changed files with 9 additions and 5 deletions
Vendored
+4 -2
View File
@@ -705,6 +705,7 @@ MPFRAMEWORKSDIR
MPAPPLICATIONSDIR
MTREE_GNAME
DSTMODE
NO_ROOTPRIVS
RUNUSR
DSTGRP
DSTUSR
@@ -7060,11 +7061,11 @@ printf "%s\n" "$mpconfigdir" >&6; }
# Check whether --with-no-root-privileges was given.
if test ${with_no_root_privileges+y}
then :
withval=$with_no_root_privileges; ROOTPRIVS=$withval
withval=$with_no_root_privileges; NO_ROOTPRIVS=$withval
fi
if test "${ROOTPRIVS+set}" = set; then
if test "${NO_ROOTPRIVS+set}" = set; then
# Set install-user to current user
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for install user" >&5
printf %s "checking for install user... " >&6; }
@@ -7092,6 +7093,7 @@ printf "%s\n" "$RUNUSR" >&6; }
# Check for install ownership