Changed syntax for windows on the stored ccache file name
authorKeith Vetter <keithv@fusion.com>
Fri, 7 Apr 1995 22:39:16 +0000 (22:39 +0000)
committerKeith Vetter <keithv@fusion.com>
Fri, 7 Apr 1995 22:39:16 +0000 (22:39 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5345 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/ccdefname.c

index 58e9fe6453b41296f6a81943a7e125e41bf01b8c..75cb1dcb2102873ea83cfa4655e3bc4e2053360e 100644 (file)
@@ -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 
index a08a66e5818d65bf890f69539b41d61ac6fbec23..dd20f171be8418227c53916600efcd462363238a 100644 (file)
@@ -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());