summaryrefslogtreecommitdiff
path: root/apps/compiler/includes
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2025-09-27 13:36:14 +0200
committerGitHub <noreply@github.com>2025-09-27 13:36:14 +0200
commitb950c610d4e41ee6bbfc9476020546548c20100d (patch)
tree172f74f8e19655119fd4c5b0d3979380423fb79c /apps/compiler/includes
parent815d99250aba4fbedf39eecd1c5c32ce1493a0e2 (diff)
feat(bash): test command in dashboard + fix tests (#23030)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Diffstat (limited to 'apps/compiler/includes')
-rw-r--r--apps/compiler/includes/functions.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/compiler/includes/functions.sh b/apps/compiler/includes/functions.sh
index 5f9581e7ce..c608cff24d 100644
--- a/apps/compiler/includes/functions.sh
+++ b/apps/compiler/includes/functions.sh
@@ -1,7 +1,14 @@
#!/usr/bin/env bash
# Set SUDO variable - one liner
-SUDO=$([ "$EUID" -ne 0 ] && echo "sudo" || echo "")
+SUDO=""
+
+IS_SUDO_ENABLED=${AC_ENABLE_ROOT_CMAKE_INSTALL:-0}
+
+# Allow callers to opt-out from privilege escalation during install/perms adjustments
+if [[ $IS_SUDO_ENABLED == 1 ]]; then
+ SUDO=$([ "$EUID" -ne 0 ] && echo "sudo" || echo "")
+fi
function comp_clean() {
DIRTOCLEAN=${BUILDPATH:-var/build/obj}
@@ -143,9 +150,13 @@ function comp_compile() {
popd >> /dev/null || exit 1
# set all aplications SUID bit
- echo "Setting permissions on binary files"
- find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec $SUDO chown root:root -- {} +
- find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec $SUDO chmod u+s -- {} +
+ if [[ $IS_SUDO_ENABLED == 0 ]]; then
+ echo "Skipping root ownership and SUID changes (IS_SUDO_ENABLED=0)"
+ else
+ echo "Setting permissions on binary files"
+ find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec $SUDO chown root:root -- {} +
+ find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec $SUDO chmod u+s -- {} +
+ fi
[[ -f "$confDir/worldserver.conf.dist" ]] && \
cp -v --no-clobber "$confDir/worldserver.conf.dist" "$confDir/worldserver.conf"