From 39e9ef6a0a742c6cc92cccb43da0f80ce23d7f7b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 16 Nov 2023 16:35:22 +0000 Subject: [PATCH] Run as non-root user. --- test/travis_before_linux.sh | 5 +++++ test/travis_run_linux.sh | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/test/travis_before_linux.sh b/test/travis_before_linux.sh index 113db0a4e85..7859793c3d5 100755 --- a/test/travis_before_linux.sh +++ b/test/travis_before_linux.sh @@ -1,5 +1,10 @@ #!/bin/bash -xe +if [ $EUID = 0 ]; then + useradd user + su - user -- $0 $* +fi + if test -v CLEAR_CACHE; then rm -rf $HOME/root fi diff --git a/test/travis_run_linux.sh b/test/travis_run_linux.sh index 1465a304bd8..59a1ca33459 100755 --- a/test/travis_run_linux.sh +++ b/test/travis_run_linux.sh @@ -1,5 +1,9 @@ #!/bin/bash -ex +if [ $EUID = 0 ]; then + su - user -- $0 $* +fi + # Test for APLOGNO() macro errors (duplicates, empty args) etc. For # trunk, run the updater script to see if it fails. If it succeeds # and changes any files (because there was a missing argument), the