From 8a5ebbc121b7c7aff3f729ec07eb93c1ea5e5967 Mon Sep 17 00:00:00 2001 From: Danny Auble <da@llnl.gov> Date: Thu, 26 Mar 2009 18:10:09 +0000 Subject: [PATCH] change to make things work correctly on a reconfig --- src/plugins/crypto/munge/crypto_munge.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/plugins/crypto/munge/crypto_munge.c b/src/plugins/crypto/munge/crypto_munge.c index b0bb8e8d954..2021d6cd53e 100644 --- a/src/plugins/crypto/munge/crypto_munge.c +++ b/src/plugins/crypto/munge/crypto_munge.c @@ -106,7 +106,7 @@ enum local_error_code { ESIG_BAD_USERID, }; -static uid_t slurm_user = (uid_t)NO_VAL; +static uid_t slurm_user = 0; /* * init() is called when the plugin is loaded, before any other functions @@ -140,15 +140,12 @@ crypto_read_private_key(const char *path) { munge_ctx_t ctx; munge_err_t err; - static uid_t slurmd_user = (uid_t)NO_VAL; if ((ctx = munge_ctx_create()) == NULL) { error ("crypto_read_private_key: munge_ctx_create failed"); return (NULL); } - if(slurmd_user == (uid_t)NO_VAL) - slurmd_user = slurm_get_slurmd_user_id(); /* * Only allow slurmd_user (usually root) to decode job * credentials created by @@ -156,7 +153,8 @@ crypto_read_private_key(const char *path) * as non-privileged users cannot get at the contents of job * credentials. */ - err = munge_ctx_set(ctx, MUNGE_OPT_UID_RESTRICTION, slurmd_user); + err = munge_ctx_set(ctx, MUNGE_OPT_UID_RESTRICTION, + slurm_get_slurmd_user_id()); if (err != EMUNGE_SUCCESS) { error("Unable to set uid restriction on munge credentials: %s", @@ -174,8 +172,7 @@ crypto_read_public_key(const char *path) /* * Get slurm user id once. We use it later to verify credentials. */ - if(slurm_user == (uid_t)NO_VAL) - slurm_user = slurm_get_slurm_user_id(); + slurm_user = slurm_get_slurm_user_id(); return (void *) munge_ctx_create(); } -- GitLab