#include <netdb.h>
#include <strings.h>
+#include <ctype.h>
#include <stdio.h>
#include "admin_err.h"
bcopy((char *)hp->h_addr, (char *)&admin_addr.sin_addr, hp->h_length);
admin_addr.sin_port = sp->s_port;
+ /* lowercase & truncate hostname becuase it will be used as an
+ * instance name.
+ */
+ {
+ char *s;
+ for (s = krbhost; *s && *s != '.'; s++)
+ if (isupper(*s))
+ *s = tolower(*s);
+ *s = 0;
+ }
inited = 1;
}
return 0;
* find our session key.
*/
- if (status = krb_get_cred("changepw", "kerberos", krbrlm, &cred)) {
+ if (status = krb_get_cred("changepw", krbhost, krbrlm, &cred)) {
status += krb_err_base;
goto bad;
}
* and know who we are.
*/
- if (status = krb_mk_req(&authent, "changepw", "kerberos", krbrlm,
+ if (status = krb_mk_req(&authent, "changepw", krbhost, krbrlm,
checksum)) {
status += krb_err_base;
goto bad;