Skip to content
Snippets Groups Projects
Commit 4b862252 authored by Danny Auble's avatar Danny Auble
Browse files

Add sanity check for NULL cluster names trying to register.

parent 480a744f
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,7 @@ documents those changes that are of interest to users and admins. ...@@ -35,6 +35,7 @@ documents those changes that are of interest to users and admins.
-- Purge vestigial job scripts when the slurmd cold starts or slurmstepd -- Purge vestigial job scripts when the slurmd cold starts or slurmstepd
terminates abnormally. terminates abnormally.
-- Add support for FreeBSD. -- Add support for FreeBSD.
-- Add sanity check for NULL cluster names trying to register.
* Changes in Slurm 2.5.4 * Changes in Slurm 2.5.4
======================== ========================
......
...@@ -1733,6 +1733,7 @@ static int _init_conn(slurmdbd_conn_t *slurmdbd_conn, ...@@ -1733,6 +1733,7 @@ static int _init_conn(slurmdbd_conn_t *slurmdbd_conn,
debug("DBD_INIT: CLUSTER:%s VERSION:%u UID:%u IP:%s CONN:%u", debug("DBD_INIT: CLUSTER:%s VERSION:%u UID:%u IP:%s CONN:%u",
init_msg->cluster_name, init_msg->version, init_msg->uid, init_msg->cluster_name, init_msg->version, init_msg->uid,
slurmdbd_conn->ip, slurmdbd_conn->newsockfd); slurmdbd_conn->ip, slurmdbd_conn->newsockfd);
slurmdbd_conn->cluster_name = xstrdup(init_msg->cluster_name); slurmdbd_conn->cluster_name = xstrdup(init_msg->cluster_name);
slurmdbd_conn->db_conn = acct_storage_g_get_connection( slurmdbd_conn->db_conn = acct_storage_g_get_connection(
false, slurmdbd_conn->newsockfd, init_msg->rollback, false, slurmdbd_conn->newsockfd, init_msg->rollback,
...@@ -2704,6 +2705,17 @@ static int _register_ctld(slurmdbd_conn_t *slurmdbd_conn, ...@@ -2704,6 +2705,17 @@ static int _register_ctld(slurmdbd_conn_t *slurmdbd_conn,
debug2("DBD_REGISTER_CTLD: called for %s(%u)", debug2("DBD_REGISTER_CTLD: called for %s(%u)",
slurmdbd_conn->cluster_name, register_ctld_msg->port); slurmdbd_conn->cluster_name, register_ctld_msg->port);
/* Just to make sure we don't allow a NULL cluster name to attempt
to connect. This should never happen, but here just for
sanity check.
*/
if (!slurmdbd_conn->cluster_name) {
comment = "Must have a cluster name to register it";
error("CONN:%u %s", slurmdbd_conn->newsockfd, comment);
rc = ESLURM_BAD_NAME;
goto end_it;
}
debug2("slurmctld at ip:%s, port:%d", debug2("slurmctld at ip:%s, port:%d",
slurmdbd_conn->ip, register_ctld_msg->port); slurmdbd_conn->ip, register_ctld_msg->port);
......
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