From 33e2fb87ee8cdc1dcaed4db9e072e79d28cb12ae Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Tue, 9 Feb 1999 02:50:11 +0000 Subject: [PATCH] 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11154 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 9 +++++++++ src/lib/krb5/os/ccdefname.c | 14 +++++++++++--- src/lib/krb5/os/realm_dom.c | 2 +- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 76f267930..2f0490267 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,12 @@ +Fri Feb 5 01:05:43 1999 Theodore Y. Ts'o + + * 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 * read_pwd.c: Remove reference to CPP symbol "unix". diff --git a/src/lib/krb5/os/ccdefname.c b/src/lib/krb5/os/ccdefname.c index ca82c9c58..be88f695d 100644 --- a/src/lib/krb5/os/ccdefname.c +++ b/src/lib/krb5/os/ccdefname.c @@ -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 diff --git a/src/lib/krb5/os/realm_dom.c b/src/lib/krb5/os/realm_dom.c index e6afa3188..8880c589d 100644 --- a/src/lib/krb5/os/realm_dom.c +++ b/src/lib/krb5/os/realm_dom.c @@ -42,7 +42,7 @@ #include #include -krb5_error_code +KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_get_realm_domain(context, realm, domain) krb5_context context; const char *realm; -- 2.26.2