Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create separate sticky bit command #491

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading