krb5: Make FILE ccache type a collection type!

This commit is contained in:
Nicolas Williams
2020-03-11 13:42:30 -05:00
parent f70ccfa967
commit f3e6c4ffd4
4 changed files with 469 additions and 63 deletions

View File

@@ -410,9 +410,22 @@ krb5_cc_resolve_for(krb5_context context,
ret = krb5_unparse_name(context, principal, &p);
if (ret)
return ret;
/* Subsidiary components cannot have ':'s in them */
for (s = strchr(p, ':'); s; s = strchr(s + 1, ':'))
*s = '-';
/*
* Subsidiary components cannot have various chars in them that are used as
* separators. ':' is used for subsidiary separators in all ccache types
* except FILE, where '+' is used instead because we can't use ':' in file
* paths on Windows and because ':' is not in the POSIX safe set.
*/
for (s = p; *s; s++) {
switch (s[0]) {
case ':':
case '+':
case '/':
case '\\':
s[0] = '-';
default: break;
}
}
ret = krb5_cc_resolve_sub(context, cctype, name, p, id);
free(p);
return ret;