File U_15-Remove-previously-vulnerable-chown-chmod.patch of Package slurm.31080
From: Alejandro Sanchez <alex@schedmd.com>
Date: Wed Oct 11 12:45:25 2023 -0600
Subject: [PATCH 15/19]Remove (previously-vulnerable) chown() + chmod().
Patch-mainline: Upstream
Git-repo: https://github.com/SchedMD/slurm
Git-commit: 6aea475a9982584ac1260690c9ea1665b0283680
References: bsc#1216207
Signed-off-by: Egbert Eich <eich@suse.de>
After previous commit, the H5Fcreate() will create the .h5 file as the user,
removing the need to try to chown()/chmod() the resulting file.
---
src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c b/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c
index d5a972d7c3..283928a348 100644
--- a/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c
+++ b/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c
@@ -455,11 +455,6 @@ extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job)
return SLURM_ERROR;
}
- if (chown(profile_file_name, (uid_t)g_job->uid,
- (gid_t)g_job->gid) < 0)
- error("chown(%s): %m", profile_file_name);
- if (chmod(profile_file_name, 0600) < 0)
- error("chmod(%s): %m", profile_file_name);
xfree(profile_file_name);
if (file_id < 1) {