+Fri Jul 28 23:28:11 1995 Sam Hartman <hartmans@tertius.mit.edu>
+
+ * sn2princ.c (krb5_sname_to_principal): GDon't use default realm
+ just because we are on local machine. Instead, go through normal
+ translations.
Fri Jul 7 16:32:41 EDT 1995 Paul Park (pjpark@mit.edu)
* Makefile.in - Find com_err in TOPLIBD.
krb5_error_code retval;
register char *cp;
char localname[MAXHOSTNAMELEN];
- int use_local_realm = 0;
+
if ((type == KRB5_NT_UNKNOWN) ||
(type == KRB5_NT_SRV_HST)) {
if (!hostname) {
- use_local_realm = 1;
/* convenience hack: if hostname is NULL, use gethostname() */
if (gethostname(localname, MAXHOSTNAMELEN))
return errno;
return ENOMEM;
}
} else /* type == KRB5_NT_UNKNOWN */ {
- remote_host = strdup(hostname);
+ remote_host = strdup((char *) hostname);
}
if (!remote_host)
return ENOMEM;
if (isupper(*cp))
*cp = tolower(*cp);
- if (use_local_realm) {
- if (retval = krb5_get_default_realm(context, &realm)) {
- free(remote_host);
- return retval;
- }
- } else {
if (retval = krb5_get_host_realm(context, remote_host, &hrealms)) {
free(remote_host);
return retval;
return KRB5_ERR_HOST_REALM_UNKNOWN;
}
realm = hrealms[0];
- }
+
retval = krb5_build_principal(context, ret_princ, strlen(realm),
realm, sname, remote_host,
krb5_princ_type(context, *ret_princ) = type;
free(remote_host);
- if (!use_local_realm)
- krb5_free_host_realm(context, hrealms);
+
+ krb5_free_host_realm(context, hrealms);
return retval;
} else {
return KRB5_SNAME_UNSUPP_NAMETYPE;