diff --git a/compute_endpoint/globus_compute_endpoint/endpoint/endpoint_manager.py b/compute_endpoint/globus_compute_endpoint/endpoint/endpoint_manager.py index 24fea7bd1..022f584c1 100644 --- a/compute_endpoint/globus_compute_endpoint/endpoint/endpoint_manager.py +++ b/compute_endpoint/globus_compute_endpoint/endpoint/endpoint_manager.py @@ -1018,7 +1018,7 @@ def cmd_start_endpoint( log.debug("Convey credentials; redirect stdout, stderr (to '%s')", ep_log) log_fd_flags = os.O_CREAT | os.O_WRONLY | os.O_APPEND | os.O_SYNC - log_fd = os.open(ep_log, log_fd_flags, mode=0o200) + log_fd = os.open(ep_log, log_fd_flags, mode=0o600) with os.fdopen(log_fd, "w") as log_f: if os.dup2(log_f.fileno(), 1) != 1: raise OSError(f"Unable to redirect stdout to {ep_log}") diff --git a/compute_endpoint/tests/unit/test_endpointmanager_unit.py b/compute_endpoint/tests/unit/test_endpointmanager_unit.py index 5dddb29bb..03dcc8c31 100644 --- a/compute_endpoint/tests/unit/test_endpointmanager_unit.py +++ b/compute_endpoint/tests/unit/test_endpointmanager_unit.py @@ -1972,6 +1972,7 @@ def test_redirect_stdstreams_to_user_log( a, k = next((a, k) for a, k in mock_os.open.call_args_list if a[0] == ep_log) assert a[1] == exp_flags, "Expect replacement stdout/stderr: append, wronly, sync" + assert k["mode"] == 0o600, "Expect default to writable *and* readable" @pytest.mark.parametrize("debug", (True, False))