summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1996-02-25 00:01:14 +0000
committerTheodore Tso <tytso@mit.edu>1996-02-25 00:01:14 +0000
commit783deea7bde657e0fc2f46c4dcb18ee2cd03933a (patch)
tree3e7cc958b3ab671a7357b2e4d25942c8b6527538 /src/lib
parent354078fdef236a452fd5bb0893164f00a1a94a73 (diff)
downloadkrb5-783deea7bde657e0fc2f46c4dcb18ee2cd03933a.tar.gz
krb5-783deea7bde657e0fc2f46c4dcb18ee2cd03933a.tar.xz
krb5-783deea7bde657e0fc2f46c4dcb18ee2cd03933a.zip
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
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/krb5/os/ChangeLog5
-rw-r--r--src/lib/krb5/os/ktdefname.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog
index bec11f9fb9..ce3b729afb 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 <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.
diff --git a/src/lib/krb5/os/ktdefname.c b/src/lib/krb5/os/ktdefname.c
index 5db076f5a2..b431b945cc 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;
}