From: Keith Vetter Date: Fri, 7 Apr 1995 22:39:16 +0000 (+0000) Subject: Changed syntax for windows on the stored ccache file name X-Git-Tag: krb5-1.0-beta5~385 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1e419f5ba93bb3a8067dd4b55c996d3b9d08bf68;p=krb5.git Changed syntax for windows on the stored ccache file name git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5345 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 58e9fe645..75cb1dcb2 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,10 @@ +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 diff --git a/src/lib/krb5/os/ccdefname.c b/src/lib/krb5/os/ccdefname.c index a08a66e58..dd20f171b 100644 --- a/src/lib/krb5/os/ccdefname.c +++ b/src/lib/krb5/os/ccdefname.c @@ -33,12 +33,10 @@ krb5_cc_default_name(context) 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 @@ -46,11 +44,11 @@ krb5_cc_default_name(context) { 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());