Skip to content

Commit

Permalink
create separate sticky bit command
Browse files Browse the repository at this point in the history
  • Loading branch information
pretendWhale committed Feb 22, 2024
1 parent 6f1e500 commit fbd3e07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/autotest_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def _run_test_specs(
preexec_fn=set_rlimits_before_test,
universal_newlines=True,
env={**os.environ, **env_vars, **env},
executable='/bin/bash'
)
try:
settings_json = json.dumps({**settings, "test_data": test_data})
Expand Down Expand Up @@ -254,10 +255,13 @@ def _clear_working_directory(tests_path: str, test_username: str) -> None:
Run commands that clear the tests_path working directory
"""
if test_username != getpass.getuser():
chmod_cmd = f"sudo -u {test_username} -- bash -c 'chmod -Rf -t ugo+rwX {tests_path}'"
sticky_cmd = f"sudo -u {test_username} -- bash -c 'chmod -Rf -t {tests_path}'"
chmod_cmd = f"sudo -u {test_username} -- bash -c 'chmod -Rf ugo+rwX {tests_path}'"
else:
chmod_cmd = f"chmod -Rf -t ugo+rwX {tests_path}"
sticky_cmd = f"chmod -Rf -t {tests_path}"
chmod_cmd = f"chmod -Rf ugo+rwX {tests_path}"

subprocess.run(sticky_cmd, shell=True)
subprocess.run(chmod_cmd, shell=True)

# be careful not to remove the tests_path dir itself since we have to
Expand Down

0 comments on commit fbd3e07

Please sign in to comment.