summaryrefslogtreecommitdiffstats
path: root/ipa-client/ipa-join.c
diff options
context:
space:
mode:
authorOndrej Hamada <ohamada@redhat.com>2012-01-20 13:44:48 +0100
committerRob Crittenden <rcritten@redhat.com>2012-01-22 22:01:40 -0500
commitf7b4eb6a0918c0b73d4b98f47dcd76fa4e8072f5 (patch)
tree4c1fa254d67165f3d5d1d4ab42d5678eb4426d37 /ipa-client/ipa-join.c
parentf3b606b627ea317e87b89ffb6ce2f0fb745f38aa (diff)
downloadfreeipa-f7b4eb6a0918c0b73d4b98f47dcd76fa4e8072f5.tar.gz
freeipa-f7b4eb6a0918c0b73d4b98f47dcd76fa4e8072f5.tar.xz
freeipa-f7b4eb6a0918c0b73d4b98f47dcd76fa4e8072f5.zip
localhost.localdomain clients refused to join
Machines with hostname 'localhost' or 'localhost.localdomain' are refused from joining IPA domain and proper error message is shown. The hostname check is done both in 'ipa-client-install' script and in 'ipa-join'. https://fedorahosted.org/freeipa/ticket/2112
Diffstat (limited to 'ipa-client/ipa-join.c')
-rw-r--r--ipa-client/ipa-join.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ipa-client/ipa-join.c b/ipa-client/ipa-join.c
index c174e2c15..57c7bcb28 100644
--- a/ipa-client/ipa-join.c
+++ b/ipa-client/ipa-join.c
@@ -937,6 +937,12 @@ join(const char *server, const char *hostname, const char *bindpw, const char *b
goto cleanup;
}
+ if ((!strcmp(host, "localhost")) || (!strcmp(host, "localhost.localdomain"))){
+ fprintf(stderr, _("The hostname must not be: %s\n"), host);
+ rval = 16;
+ goto cleanup;
+ }
+
if (bindpw)
rval = join_ldap(ipaserver, host, &hostdn, bindpw, basedn, &princ, &subject, quiet);
else {