From 783deea7bde657e0fc2f46c4dcb18ee2cd03933a Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sun, 25 Feb 1996 00:01:14 +0000 Subject: [PATCH] Under Windows, assume that the keytab file is located in the Windows directory. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7528 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 5 +++++ src/lib/krb5/os/ktdefname.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index bec11f9fb..ce3b729af 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,8 @@ +Sat Feb 24 18:57:56 1996 Theodore Y. Ts'o + + * 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 * Makefile.in (check-unix): Set LD_LIBRARY_PATH for kdb5_anadd. diff --git a/src/lib/krb5/os/ktdefname.c b/src/lib/krb5/os/ktdefname.c index 5db076f5a..b431b945c 100644 --- a/src/lib/krb5/os/ktdefname.c +++ b/src/lib/krb5/os/ktdefname.c @@ -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; } -- 2.26.2