Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.3:Update
slurm.31097
U_01-Remove-unused-pmixp_fixrights.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File U_01-Remove-unused-pmixp_fixrights.patch of Package slurm.31097
From: Tim Wickberg <tim@schedmd.com> Date: Wed Oct 11 12:45:25 2023 -0600 Subject: [PATCH 1/19]Remove unused pmixp_fixrights(). Patch-mainline: Upstream Git-repo: https://github.com/SchedMD/slurm Git-commit: a6aa6a2a1f3679a9b900811530053353d7a6292f References: bsc#1216207,CVE-2023-41914 Signed-off-by: Egbert Eich <eich@suse.de> --- src/plugins/mpi/pmix/pmixp_client.c | 6 ---- src/plugins/mpi/pmix/pmixp_utils.c | 63 ------------------------------------- src/plugins/mpi/pmix/pmixp_utils.h | 1 - 3 files changed, 70 deletions(-) diff --git a/src/plugins/mpi/pmix/pmixp_client.c b/src/plugins/mpi/pmix/pmixp_client.c index c1cc1eee53..4323cc71e2 100644 --- a/src/plugins/mpi/pmix/pmixp_client.c +++ b/src/plugins/mpi/pmix/pmixp_client.c @@ -479,12 +479,6 @@ extern int pmixp_libpmix_init(void) /* TODO: must be deleted in future once info-key approach harden */ setenv(PMIXP_PMIXLIB_TMPDIR, pmixp_info_tmpdir_lib(), 1); - /* - if( pmixp_fixrights(pmixp_info_tmpdir_lib(), - (uid_t) pmixp_info_jobuid(), rights) ){ - } - */ - return 0; } diff --git a/src/plugins/mpi/pmix/pmixp_utils.c b/src/plugins/mpi/pmix/pmixp_utils.c index ea1bd5e337..314969030f 100644 --- a/src/plugins/mpi/pmix/pmixp_utils.c +++ b/src/plugins/mpi/pmix/pmixp_utils.c @@ -524,69 +524,6 @@ int pmixp_rmdir_recursively(char *path) return rc; } -static inline int _file_fix_rights(char *path, uid_t uid, mode_t mode) -{ - if (chmod(path, mode) < 0) { - PMIXP_ERROR("chown(%s): %m", path); - return errno; - } - - if (chown(path, uid, (gid_t) -1) < 0) { - PMIXP_ERROR("chown(%s): %m", path); - return errno; - } - return 0; -} - -int pmixp_fixrights(char *path, uid_t uid, mode_t mode) -{ - char nested_path[PATH_MAX]; - DIR *dp; - struct dirent *ent; - int rc; - - /* - * Make sure that "directory" exists and is a directory. - */ - if (1 != (rc = _is_dir(path))) { - PMIXP_ERROR("path=\"%s\" is not a directory", path); - return (rc == 0) ? -1 : rc; - } - - if ((dp = opendir(path)) == NULL) { - PMIXP_ERROR_STD("cannot open path=\"%s\"", path); - return -1; - } - - while ((ent = readdir(dp)) != NULL) { - if (0 == xstrcmp(ent->d_name, ".") - || 0 == xstrcmp(ent->d_name, "..")) { - /* skip special dir's */ - continue; - } - snprintf(nested_path, sizeof(nested_path), "%s/%s", path, - ent->d_name); - if (_is_dir(nested_path)) { - if ((rc = _file_fix_rights(nested_path, uid, mode))) { - PMIXP_ERROR_STD("cannot fix permissions for " - "\"%s\"", - nested_path); - return -1; - } - pmixp_rmdir_recursively(nested_path); - } else { - if ((rc = _file_fix_rights(nested_path, uid, mode))) { - PMIXP_ERROR_STD("cannot fix permissions for " - "\"%s\"", - nested_path); - return -1; - } - } - } - closedir(dp); - return 0; -} - int pmixp_mkdir(char *path, mode_t rights) { /* NOTE: we need user who owns the job to access PMIx usock diff --git a/src/plugins/mpi/pmix/pmixp_utils.h b/src/plugins/mpi/pmix/pmixp_utils.h index f25325282c..df70e6c6ca 100644 --- a/src/plugins/mpi/pmix/pmixp_utils.h +++ b/src/plugins/mpi/pmix/pmixp_utils.h @@ -61,7 +61,6 @@ int pmixp_p2p_send(const char *nodename, const char *address, const char *data, uint32_t len, unsigned int start_delay, unsigned int retry_cnt, int silent); int pmixp_rmdir_recursively(char *path); -int pmixp_fixrights(char *path, uid_t uid, mode_t mode); int pmixp_mkdir(char *path, mode_t rights); /* lightweight pmix list of pointers */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor