Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:Update
slurm.32299
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.32299
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: 42e85a473d377c9f5734c85a6fd9f6febc13b7a7 References: CVE-2022-29500, bsc#1216207 Signed-off-by: Egbert Eich <eich@suse.de> --- src/plugins/mpi/pmix/pmixp_client.c | 6 ---- src/plugins/mpi/pmix/pmixp_utils.c | 65 ------------------------------------- src/plugins/mpi/pmix/pmixp_utils.h | 1 - 3 files changed, 72 deletions(-) diff --git a/src/plugins/mpi/pmix/pmixp_client.c b/src/plugins/mpi/pmix/pmixp_client.c index e56c784e5b..489314c129 100644 --- a/src/plugins/mpi/pmix/pmixp_client.c +++ b/src/plugins/mpi/pmix/pmixp_client.c @@ -521,12 +521,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 4218629524..0083dad640 100644 --- a/src/plugins/mpi/pmix/pmixp_utils.c +++ b/src/plugins/mpi/pmix/pmixp_utils.c @@ -539,71 +539,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 = 0; - - /* - * 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); - goto exit; - } - 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); - goto exit; - } - } - } - -exit: - closedir(dp); - return rc; -} - 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 4e61081ad0..f27ff20128 100644 --- a/src/plugins/mpi/pmix/pmixp_utils.h +++ b/src/plugins/mpi/pmix/pmixp_utils.h @@ -63,7 +63,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