Under Windows, assume that the keytab file is located in the Windows
authorTheodore Tso <tytso@mit.edu>
Sun, 25 Feb 1996 00:01:14 +0000 (00:01 +0000)
committerTheodore Tso <tytso@mit.edu>
Sun, 25 Feb 1996 00:01:14 +0000 (00:01 +0000)
directory.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7528 dc483132-0cff-0310-8789-dd5450dbe970

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

index bec11f9fb9076c2dce180e78f5a851ccf9001709..ce3b729afb23c53ebaa5bd759d95a3ae16306ad9 100644 (file)
@@ -1,3 +1,8 @@
+Sat Feb 24 18:57:56 1996  Theodore Y. Ts'o  <tytso@dcl>
+
+       * ktdefname.c (krb5_kt_default_name): Under Windows, assume that
+               the keytab file is located in the Windows directory.
+
 Thu Feb 22 13:16:16 1996  Ezra Peisach  <epeisach@kangaroo.mit.edu>
 
        * Makefile.in (check-unix): Set LD_LIBRARY_PATH for kdb5_anadd.
index 5db076f5a2c372f76ba210d61308e65451154a9e..b431b945cc8f81a9dbe2f218ada6c6f9e2efe642 100644 (file)
@@ -24,6 +24,8 @@
  * Return default keytab file name.
  */
 
+#define NEED_WINDOWS
+
 #include "k5-int.h"
 
 extern char *krb5_defkeyname;
@@ -42,9 +44,22 @@ krb5_kt_default_name(context, name, namesize)
        if (strlen(cp) >= (size_t) namesize)
            return KRB5_CONFIG_NOTENUFSPACE;
     } else {
+#if defined (_WINDOWS) || defined(WIN32)
+       {
+           char    defname[160];
+           int     len;
+
+           len= GetWindowsDirectory( defname, sizeof(defname)-2 );
+           defname[len]= '\0';
+           if ( (len + strlen(krb5_defkeyname) + 1) > namesize )
+               return KRB5_CONFIG_NOTENUFSPACE;
+           sprintf(name, krb5_defkeyname, defname);
+       }
+#else
        strncpy(name, krb5_defkeyname, namesize);
        if ((size_t) namesize < strlen(krb5_defkeyname))
            return KRB5_CONFIG_NOTENUFSPACE;
+#endif
     }
     return 0;
 }