Require that the hostname we are joining as is fully-qualified

This commit is contained in:
Rob Crittenden 2010-01-08 16:00:31 -05:00
parent 0b0cd7872f
commit 7baafe4f41

View File

@ -541,6 +541,12 @@ join(const char *server, const char *hostname, const char *bindpw, const char *k
hostname = strdup(uinfo.nodename); hostname = strdup(uinfo.nodename);
} }
if (NULL == strstr(hostname, ".")) {
fprintf(stderr, "The hostname must be fully-qualified: %s\n", hostname);
rval = 16;
goto cleanup;
}
if (bindpw) if (bindpw)
rval = join_ldap(ipaserver, hostname, &hostdn, bindpw, &princ, quiet); rval = join_ldap(ipaserver, hostname, &hostdn, bindpw, &princ, quiet);
else { else {