summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/ccache/ccbase.c
diff options
context:
space:
mode:
authorJeffrey Altman <jaltman@secure-endpoints.com>2004-04-13 20:08:40 +0000
committerJeffrey Altman <jaltman@secure-endpoints.com>2004-04-13 20:08:40 +0000
commit94b8a9d6c5a339fb579077b0b3d19e541c95a5a5 (patch)
tree3856ca8805858905408d7d374987687d8981d4dd /src/lib/krb5/ccache/ccbase.c
parent543635807e1d3d516fe22fc37a82d85aeb22d65b (diff)
downloadkrb5-94b8a9d6c5a339fb579077b0b3d19e541c95a5a5.tar.gz
krb5-94b8a9d6c5a339fb579077b0b3d19e541c95a5a5.tar.xz
krb5-94b8a9d6c5a339fb579077b0b3d19e541c95a5a5.zip
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
Diffstat (limited to 'src/lib/krb5/ccache/ccbase.c')
-rw-r--r--src/lib/krb5/ccache/ccbase.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/lib/krb5/ccache/ccbase.c b/src/lib/krb5/ccache/ccbase.c
index 47ada5080b..35032a5d19 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;