From 7baafe4f4151d0a62a32d2bd47bcb5de3d312e94 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 8 Jan 2010 16:00:31 -0500 Subject: [PATCH] Require that the hostname we are joining as is fully-qualified --- ipa-client/ipa-join.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ipa-client/ipa-join.c b/ipa-client/ipa-join.c index 0fef6fd79..7cc03157f 100644 --- a/ipa-client/ipa-join.c +++ b/ipa-client/ipa-join.c @@ -541,6 +541,12 @@ join(const char *server, const char *hostname, const char *bindpw, const char *k 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) rval = join_ldap(ipaserver, hostname, &hostdn, bindpw, &princ, quiet); else {