Skip to content
Snippets Groups Projects
Commit 02cf898f authored by Moe Jette's avatar Moe Jette
Browse files

Correct argument to slurm_ping() in scontrol.

Don't authenticate most RPCs processed by backup controller (only
check SHUTDOWN, etc.).
parent 329f0a98
No related branches found
No related tags found
No related merge requests found
...@@ -2327,27 +2327,28 @@ static int _background_process_msg(slurm_msg_t * msg) ...@@ -2327,27 +2327,28 @@ static int _background_process_msg(slurm_msg_t * msg)
{ {
int error_code = SLURM_SUCCESS; int error_code = SLURM_SUCCESS;
uid_t uid; uid_t uid;
bool super_user = false;
uid = g_slurm_auth_get_uid(msg->cred); uid = g_slurm_auth_get_uid(msg->cred);
if ((uid != 0) && (uid != getuid())) { if ((uid == 0) || (uid == getuid()))
error("Security violation, SHUTDOWN RPC from uid %u", super_user = true;
(unsigned int) uid);
error_code = ESLURM_USER_ID_MISSING;
}
if (error_code == SLURM_SUCCESS) { if (error_code == SLURM_SUCCESS) {
if (msg->msg_type == REQUEST_PING) { if (msg->msg_type == REQUEST_PING) {
; ;
} else if (msg->msg_type == REQUEST_SHUTDOWN_IMMEDIATE) { } else if (super_user &&
debug3 (msg->msg_type == REQUEST_SHUTDOWN_IMMEDIATE)) {
("Performing RPC: REQUEST_SHUTDOWN_IMMEDIATE"); debug3("Performing RPC: REQUEST_SHUTDOWN_IMMEDIATE");
} else if (msg->msg_type == REQUEST_SHUTDOWN) { } else if (super_user &&
(msg->msg_type == REQUEST_SHUTDOWN)) {
debug("Performing RPC: REQUEST_SHUTDOWN"); debug("Performing RPC: REQUEST_SHUTDOWN");
pthread_kill(thread_id_sig, SIGTERM); pthread_kill(thread_id_sig, SIGTERM);
} else if (msg->msg_type == REQUEST_CONTROL) { } else if (super_user &&
(msg->msg_type == REQUEST_CONTROL)) {
debug3("Ignoring RPC: REQUEST_CONTROL"); debug3("Ignoring RPC: REQUEST_CONTROL");
} else { } else {
error("Invalid RPC received %d", msg->msg_type); error("Invalid RPC received %d from uid %u",
msg->msg_type, uid);
error_code = SLURM_COMMUNICATIONS_RECEIVE_ERROR; error_code = SLURM_COMMUNICATIONS_RECEIVE_ERROR;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment