diff options
author | Jeffrey Altman <jaltman@secure-endpoints.com> | 2004-04-13 20:08:40 +0000 |
---|---|---|
committer | Jeffrey Altman <jaltman@secure-endpoints.com> | 2004-04-13 20:08:40 +0000 |
commit | 94b8a9d6c5a339fb579077b0b3d19e541c95a5a5 (patch) | |
tree | 3856ca8805858905408d7d374987687d8981d4dd | |
parent | 543635807e1d3d516fe22fc37a82d85aeb22d65b (diff) | |
download | krb5-94b8a9d6c5a339fb579077b0b3d19e541c95a5a5.zip krb5-94b8a9d6c5a339fb579077b0b3d19e541c95a5a5.tar.gz krb5-94b8a9d6c5a339fb579077b0b3d19e541c95a5a5.tar.bz2 |
Treat keytab and ccache names without prefixes as type FILE:
on Windows if there is a drive letter found at the beginning
of the name.
ticket: new
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16246 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/lib/krb5/ccache/ChangeLog | 8 | ||||
-rw-r--r-- | src/lib/krb5/ccache/ccbase.c | 25 | ||||
-rw-r--r-- | src/lib/krb5/keytab/ChangeLog | 6 | ||||
-rw-r--r-- | src/lib/krb5/keytab/ktbase.c | 28 |
4 files changed, 50 insertions, 17 deletions
diff --git a/src/lib/krb5/ccache/ChangeLog b/src/lib/krb5/ccache/ChangeLog index afafc17..d24e8e1 100644 --- a/src/lib/krb5/ccache/ChangeLog +++ b/src/lib/krb5/ccache/ChangeLog @@ -1,6 +1,14 @@ 2004-04-13 Jeffrey Altman <jaltman@mit.edu> * ccbase.c: + On Windows, if there is a ccache name provided without + a prefix but which appears to start with a drive letter, + treat it as a FILE: ccache instead of failing with a + ccache type unknown error. + +2004-04-13 Jeffrey Altman <jaltman@mit.edu> + + * ccbase.c: krb5_cc_resolve() defines a function pointer ccresolver which must be of type KRB5_CALLCONV diff --git a/src/lib/krb5/ccache/ccbase.c b/src/lib/krb5/ccache/ccbase.c index 47ada50..35032a5 100644 --- a/src/lib/krb5/ccache/ccbase.c +++ b/src/lib/krb5/ccache/ccbase.c @@ -119,14 +119,27 @@ krb5_cc_resolve (krb5_context context, const char *name, krb5_ccache *cache) pfxlen = cp - name; - resid = name + pfxlen + 1; +#if defined(_WIN32) + if ( pfxlen == 1 && isalpha(name[0]) ) { + /* We found a drive letter not a prefix - use FILE: */ + pfx = strdup("FILE:"); + if (!pfx) + return ENOMEM; + + resid = name; + } else { +#endif + resid = name + pfxlen + 1; - pfx = malloc (pfxlen+1); - if (!pfx) - return ENOMEM; + pfx = malloc (pfxlen+1); + if (!pfx) + return ENOMEM; - memcpy (pfx, name, pfxlen); - pfx[pfxlen] = '\0'; + memcpy (pfx, name, pfxlen); + pfx[pfxlen] = '\0'; +#if defined(_WIN32) + } +#endif *cache = (krb5_ccache) 0; diff --git a/src/lib/krb5/keytab/ChangeLog b/src/lib/krb5/keytab/ChangeLog index 6d84ccd..dd07ca6 100644 --- a/src/lib/krb5/keytab/ChangeLog +++ b/src/lib/krb5/keytab/ChangeLog @@ -1,3 +1,9 @@ +2004-04-13 Jeffrey Altman <jaltman@mit.edu> + + * ktbase.c: On Windows, improve the treat drive letter + prefix string as a FILE: keytab change to work if the + default keytab type was changed to not be of type FILE: + 2004-04-08 Jeffrey Altman <jaltman@mit.edu> * ktbase.c: Restore the thread safety fixes diff --git a/src/lib/krb5/keytab/ktbase.c b/src/lib/krb5/keytab/ktbase.c index 95a0739..6c5d02a 100644 --- a/src/lib/krb5/keytab/ktbase.c +++ b/src/lib/krb5/keytab/ktbase.c @@ -114,20 +114,26 @@ krb5_kt_resolve (krb5_context context, const char *name, krb5_keytab *ktid) pfxlen = cp - name; #if defined(_WIN32) - if ( pfxlen == 1 ) { - /* We found a drive letter not a prefix */ - return (*krb5_kt_dfl_ops.resolve)(context, name, ktid); - } + if ( pfxlen == 1 && isalpha(name[0]) ) { + /* We found a drive letter not a prefix - use FILE: */ + pfx = strdup("FILE:"); + if (!pfx) + return ENOMEM; + + resid = name; + } else { #endif - - resid = name + pfxlen + 1; + resid = name + pfxlen + 1; - pfx = malloc (pfxlen+1); - if (!pfx) - return ENOMEM; + pfx = malloc (pfxlen+1); + if (!pfx) + return ENOMEM; - memcpy (pfx, name, pfxlen); - pfx[pfxlen] = '\0'; + memcpy (pfx, name, pfxlen); + pfx[pfxlen] = '\0'; +#if defined(_WIN32) + } +#endif *ktid = (krb5_keytab) 0; |