Skip to content

Commit

Permalink
kill: Fix test-admins' ability to kill
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
zmc committed Apr 12, 2024
1 parent b1dac55 commit e66a632
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion teuthology/kill.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e66a632

Please sign in to comment.