USE_DBM_LNAME isn't defined.
hst_realm.c (krb5_get_host_realm): Eliminate memory leak in the
unlikely case that gethostname fails.
If the krb.realms file isn't available, use the default
realm of the host.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5367
dc483132-0cff-0310-8789-
dd5450dbe970
+Fri Apr 14 22:15:00 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu>
+
+ * an_to_ln.c (dbm_an_to_ln): Don't compile dbm_an_to_ln() if
+ USE_DBM_LNAME isn't defined.
+
+Fri Apr 14 15:15:48 1995 <tytso@rsx-11.mit.edu>
+
+ * hst_realm.c (krb5_get_host_realm): Eliminate memory leak in the
+ unlikely case that gethostname fails.
+
+ If the krb.realms file isn't available, use the default
+ realm of the host.
+
Thu Apr 13 15:49:16 1995 Keith Vetter (keithv@fusion.com)
* *.[ch]: removed unneeded INTERFACE from non-api functions.
{
struct stat statbuf;
+#ifdef USE_DBM_LNAME
if (!stat(krb5_lname_file,&statbuf))
return dbm_an_to_ln(context, aname, lnsize, lname);
+#endif
if (krb5_lname_username_fallback)
return username_an_to_ln(context, aname, lnsize, lname);
return KRB5_LNAME_CANTOPEN;
}
+#ifdef USE_DBM_LNAME
/*
* Implementation: This version uses a DBM database, indexed by aname,
* to generate a lname.
(void) dbm_close(db);
return retval;
}
+#endif /* USE_DBM_LNAME */
#endif /* _MSDOS */
/*
char scanstring[7+2*16]; /* 7 chars + 16 for each decimal
conversion */
- if (!(retrealms = (char **)calloc(2, sizeof(*retrealms))))
- return ENOMEM;
if (!host) {
if (gethostname(local_host, sizeof(local_host)-1) == -1)
return errno;
}
domain = strchr(host, '.');
+ if (!(retrealms = (char **)calloc(2, sizeof(*retrealms))))
+ return ENOMEM;
+
/* prepare default */
if (domain) {
char *cp;
krb5_find_config_files();
if ((trans_file = fopen(krb5_trans_file, "r")) == (FILE *) 0) {
- krb5_xfree(retrealms[0]);
- krb5_xfree(retrealms);
- return KRB5_TRANS_CANTOPEN;
+ *realmsp = retrealms;
+ return 0;
}
(void) sprintf(scanstring, "%%%ds %%%ds",
sizeof(trans_host)-1,sizeof(trans_realm)-1);