Skip to content

Commit

Permalink
Windows: krb5_cc_get_prefix_ops test drive letter
Browse files Browse the repository at this point in the history
If the prefix starts with a drive letter then it is a FILE ccache.

Change-Id: I03399f8f512d555481608d2fc90c8d6ecaba73ad
  • Loading branch information
jaltman committed Sep 15, 2013
1 parent bc7a153 commit d0b8bb2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/krb5/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,9 +979,17 @@ krb5_cc_get_prefix_ops(krb5_context context, const char *prefix)

if (prefix == NULL)
return KRB5_DEFAULT_CCTYPE;

/* Is absolute path? Or UNC path? */
if (ISPATHSEP(prefix[0]))
return &krb5_fcc_ops;

#ifdef _WIN32
/* Is drive letter? */
if (isalpha(prefix[0]) && prefix[1] == ':')
return &krb5_fcc_ops;
#endif

p = strdup(prefix);
if (p == NULL) {
krb5_enomem(context);
Expand Down

0 comments on commit d0b8bb2

Please sign in to comment.