From e66a632415dc73bb63768eb72c2178d14846b182 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 12 Apr 2024 12:25:23 -0600 Subject: [PATCH] kill: Fix test-admins' ability to kill By testing access to /bin/true, we were getting false negatives as we meant to be testing for access to /bin/kill. With our configuration, any sudo access indicates access to /bin/kill. Signed-off-by: Zack Cerza --- teuthology/kill.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teuthology/kill.py b/teuthology/kill.py index 8e14109fa..f5fb4d400 100755 --- a/teuthology/kill.py +++ b/teuthology/kill.py @@ -195,7 +195,7 @@ def kill_processes(run_name, pids=None): log.info("Killing Pids: " + str(to_kill)) sudo_works = False if pids_need_sudo: - sudo_works = subprocess.Popen(['sudo', '-n', 'true']).wait() == 0 + sudo_works = subprocess.Popen(['sudo', '-n', '-l']).wait() == 0 if not sudo_works: log.debug("Passwordless sudo not configured; not using sudo") for pid in to_kill: