From 4ff6b0009c6331eff73cf5c6cce36da8d078aaea Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 30 Oct 2023 15:05:35 +1100 Subject: [PATCH] Restore nopasswd sudo rule on Mac OS X. --- .github/setup_ci.sh | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/setup_ci.sh b/.github/setup_ci.sh index 98329eed5d7a..76d5137d9099 100755 --- a/.github/setup_ci.sh +++ b/.github/setup_ci.sh @@ -35,20 +35,24 @@ if [ -x "`which lsb_release 2>&1`" ]; then lsb_release -a fi -# Ubuntu 22.04 defaults to private home dirs which prevent the -# agent-getpeerid test from running ssh-add as nobody. See -# https://github.com/actions/runner-images/issues/6106 -if [ ! -z "$SUDO" ] && ! "$SUDO" -u nobody test -x ~; then - echo ~ is not executable by nobody, adding perms. - chmod go+x ~ -fi - -if [ ! -z "$SUDO" ] && ! "$SUDO" -S -u nobody true /dev/null; then + echo "Restoring runner nopasswd rule to sudoers." + echo 'runner ALL=(ALL) NOPASSWD: ALL' |$SUDO tee -a /etc/sudoers + fi + if ! "$SUDO" -u nobody test -x ~; then + echo "Still can't sudo to nobody." + exit 1 + fi fi if [ "${TARGETS}" = "kitchensink" ]; then