ccdefname.c (get_from_os): On the Windows platform, automatically
authorTheodore Tso <tytso@mit.edu>
Tue, 9 Feb 1999 02:50:11 +0000 (02:50 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 9 Feb 1999 02:50:11 +0000 (02:50 +0000)
generate the correct default cache name based on what krb5_cc_dfl_ops
is set to.

realm_dom.c (krb5_get_realm_domain): Add modifiers so that this
function can get exported in a Windows DLL.

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

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

index 76f2679303364259ff9156d98eed4c4bb5fee6e2..2f04902673ea1bded2bbd08274556088adbea9f4 100644 (file)
@@ -1,3 +1,12 @@
+Fri Feb  5 01:05:43 1999  Theodore Y. Ts'o  <tytso@mit.edu>
+
+       * ccdefname.c (get_from_os): On the Windows platform,
+               automatically generate the correct default cache name
+               based on what krb5_cc_dfl_ops is set to.
+
+       * realm_dom.c (krb5_get_realm_domain): Add modifiers so that this
+               function can get exported in a Windows DLL.
+
 Tue Feb  2 16:01:58 1999  Tom Yu  <tlyu@mit.edu>
 
        * read_pwd.c: Remove reference to CPP symbol "unix".
index ca82c9c589d0726ecf5ca12f2d0ab2eb6854f83f..be88f695d85e1a4e636addd6f624b12613f128a7 100644 (file)
@@ -89,11 +89,19 @@ static krb5_error_code get_from_os(char *name_buf, int name_size)
 static krb5_error_code get_from_os(char *name_buf, int name_size)
 {
        char defname[160];                  /* Default value */
+       char *prefix = krb5_cc_dfl_ops->prefix;
+       int len;
 
-       strcpy (defname, "default_cache_name");
-       strcpy (name_buf, "API:");
+       if (!strcmp(prefix, "FILE") || !strcmp(prefix, "STDIO")) {
+               GetWindowsDirectory (defname, sizeof(defname)-7);
+               strcat (defname, "\\krb5cc");
+       } else {
+               strcpy (defname, "default_cache_name");
+       }
+       sprintf(name_buf, "%s:", prefix);
+       len = strlen(name_buf);
        GetPrivateProfileString(INI_FILES, INI_KRB_CCACHE, defname,
-                               name_buf+4, name_size-4, KERBEROS_INI);
+                               name_buf+len, name_size-len, KERBEROS_INI);
        return 0;
 }
 #endif
index e6afa318868691d7ce7b4557105d7b7a1c8f914d..8880c589d522da2f70c1d4e981580c621bb02e73 100644 (file)
@@ -42,7 +42,7 @@
 #include <ctype.h>
 #include <stdio.h>
 
-krb5_error_code
+KRB5_DLLIMP krb5_error_code KRB5_CALLCONV
 krb5_get_realm_domain(context, realm, domain)
     krb5_context context;
     const char *realm;