Skip Menu |
 

Date: Mon, 01 Jan 2007 05:54:31 -0500
From: Norbert Thiebaud <norbert@infotelcorp.com>
To: krb5-bugs@mit.edu
Subject: error on gethostbyname is tested on errno instead of h_errno
Download (untitled) / with headers
text/plain 1.2KiB

The symptom is that kdb5_util create -s terminate without error (just oddly
indicating that gethostbyname was sucessfull, which would not normally alarm a user)
but none of the 'default' principals, like kadmin/admin or kadim/chagepw are
created....
this is usually detected, either if one do a control listprincs just after
creation, or more likely when one try to create a keytab for these
administrative principals.
This can be quite frustrating, and an error message would be a nice things to do.
since herror() is marked (obsolete) on my man pages, I did not use it and merely
printed the error value.

Norbert Thiebaud
norbert@infotelcorp.com



diff -ur krb5-1.4.3/src/kadmin/dbutil/kadm5_create.c
krb5-1.4.3-gethostbyname/src/kadmin/dbutil/kadm5_create.c
--- krb5-1.4.3/src/kadmin/dbutil/kadm5_create.c 2004-06-16 05:11:54.000000000 +0200
+++ krb5-1.4.3-gethostbyname/src/kadmin/dbutil/kadm5_create.c 2007-01-01
11:31:15.000000000 +0100
@@ -184,8 +184,8 @@
}
hp = gethostbyname(localname);
if (hp == NULL) {
- ret = errno;
- perror("gethostbyname");
+ ret = h_errno;
+ fprintf(stderr, "gethostbyname error: %i\n", ret);
goto clean_and_exit;
}
sprintf(service_name, "kadmin/%s", hp->h_name);
From: raeburn@mit.edu
Subject: SVN Commit
* kadm5_create.c: Include fake-addrinfo.h.
(add_admin_princs): Use getaddrinfo instead of gethostbyname. Report
the correct message on getaddrinfo errors, and return EINVAL to
caller.

Commit By: raeburn



Revision: 19226
Changed Files:
U trunk/src/kadmin/dbutil/kadm5_create.c
From: tlyu@mit.edu
Subject: SVN Commit
pull up r19226 from trunk

r19226@cathode-dark-space: raeburn | 2007-03-13 21:52:23 -0400
ticket: 5257

* kadm5_create.c: Include fake-addrinfo.h.
(add_admin_princs): Use getaddrinfo instead of gethostbyname. Report
the correct message on getaddrinfo errors, and return EINVAL to
caller.



Commit By: tlyu



Revision: 19413
Changed Files:
_U branches/krb5-1-6/
U branches/krb5-1-6/src/kadmin/dbutil/kadm5_create.c