+Fri Apr 7 15:32:04 1995 Keith Vetter (keithv@fusion.com)
+
+ * ccdefname.c:
+ changed windows stored filename syntax--dropped the 'FILE:' part.
+ changed buffer from malloc to static since we don't want it
+ ever to fail, and nobody checks it for errors.
+
Wed Apr 5 16:32:07 1995 Keith Vetter (keithv@fusion.com)
* get_krbh.c: better error handling--old return values were
krb5_context context;
{
char *name = getenv(KRB5_ENV_CCNAME);
- static char *name_buf;
+ static char name_buf[160];
if (name == 0) {
- if (name_buf == 0)
- name_buf = malloc (160);
-
+
#ifdef HAVE_MACSOCK_H
strcpy (name_buf, "STDIO:krb5cc");
#else
{
char defname[160]; /* Default value */
- strcpy (defname, "FILE:");
- GetWindowsDirectory (defname+5, 160-5-7);
+ GetWindowsDirectory (defname, sizeof(defname)-7);
strcat (defname, "\\krb5cc");
+ strcpy (name_buf, "FILE:");
GetPrivateProfileString(INI_FILES, INI_KRB_CCACHE, defname,
- name_buf, 160, KERBEROS_INI);
+ name_buf+5, sizeof(name_buf)-5, KERBEROS_INI);
}
#else
sprintf(name_buf, "FILE:/tmp/krb5cc_%d", getuid());