Skip to content
Snippets Groups Projects
Commit 50eaa012 authored by Michael Hinton's avatar Michael Hinton Committed by Tim Wickberg
Browse files

auth/munge - truncate FQDN to shortname for AllocNodes.

gethostbyaddr() can potentially return a fully-qualified domain name,
which breaks backwards compatibility with the shortname AllocNodes
expected pre 19.05.

Bug 7653.
parent 0ec1ba42
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,9 @@ documents those changes that are of interest to users and administrators.
-- slurmctld - fix memory leak when using DebugFlags=Reservation.
-- Reset --mem and --mem-per-cpu options correctly when using --mem-per-gpu.
-- Use correct function signature for step_set_env() in gres plugin interface.
-- Restore pre-19.05 hostname handling behavior for AllocNodes by always
truncating to just the host portion and dropping any domain name portion
returned by gethostbyaddr().
 
* Changes in Slurm 19.05.3-2
============================
......
......@@ -318,9 +318,13 @@ char *slurm_auth_get_host(slurm_auth_credential_t *cred)
he = get_host_by_addr((char *)&cred->addr.s_addr,
sizeof(cred->addr.s_addr),
AF_INET, (void *)&h_buf, sizeof(h_buf), &h_err);
if (he)
if (he && he->h_name) {
/* Truncate the hostname to a short name */
char *sep = strchr(he->h_name, '.');
if (sep)
*sep = '\0';
hostname = xstrdup(he->h_name);
else {
} else {
slurm_addr_t addr = { .sin_addr.s_addr = cred->addr.s_addr };
uint16_t port;
error("%s: Lookup failed: %s", __func__, host_strerror(h_err));
......
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