krb5_get_host_realm does something sane when passed in a
hostname which doesn't have a default domain.
hst_realm.c (krb5_get_host_realm): If an hostname does not have
a domain, don't try to get a domain default (which
results in a strange error being returned).
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6651
dc483132-0cff-0310-8789-
dd5450dbe970
Fri Sep 1 00:47:27 1995 Theodore Y. Ts'o <tytso@dcl>
+ * Makefile.in (check-unix): Add a test case to make sure
+ krb5_get_host_realm does something sane when passed in a
+ hostname which doesn't have a default domain.
+
+ * hst_realm.c (krb5_get_host_realm): If an hostname does not have
+ a domain, don't try to get a domain default (which
+ results in a strange error being returned).
+
* toffset.c: Added new file which implements the abstract
interfaces for manipulating the time offset fields in the
os context.
-k IGGY.ORG -k DEFAULT_REALM.TST \
-D DEFAULT_REALM.TST -r bad.idea -r itar.bad.idea \
-r really.BAD.IDEA. -r clipper.bad.idea -r KeYEsCrOW.BaD.IDea \
- -r pgp.good.idea > test.out
+ -r pgp.good.idea -r no_domain > test.out
cmp test.out $(srcdir)/ref_std_conf.out
$(RM) test.out
}
}
- retval = profile_get_string(context->profile, "domain_realm", domain,
- 0, default_realm, &realm);
- free(default_realm);
- if (retval)
- return retval;
- default_realm = realm;
+ if (domain) {
+ retval = profile_get_string(context->profile, "domain_realm",
+ domain, 0, default_realm, &realm);
+ free(default_realm);
+ if (retval)
+ return retval;
+ default_realm = realm;
+ }
retval = profile_get_string(context->profile, "domain_realm", local_host,
0, default_realm, &realm);
krb_get_host_realm(clipper.bad.idea) returned: 'NIST.GOV'
krb_get_host_realm(KeYEsCrOW.BaD.IDea) returned: 'NSA.GOV'
krb_get_host_realm(pgp.good.idea) returned: 'GOOD.IDEA'
+krb_get_host_realm(no_domain) returned: 'NEW.DEFAULT.REALM'