>From cb62cfb023f90da9bf53bfcd0243245e7ce6acef Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Fri, 28 Jun 2013 16:06:38 +0200 Subject: [PATCH] Return right directory name for dircache Dircache can be either file or directory. Wrong value was used when dircache was itself directory. https://fedorahosted.org/sssd/ticket/2002 --- src/providers/krb5/krb5_utils.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c index 4811a736ce9bfcb772d0d8abd44eed05b214463a..860c71b00d8364b80d8fef3ae953631bb46bb572 100644 --- a/src/providers/krb5/krb5_utils.c +++ b/src/providers/krb5/krb5_utils.c @@ -1046,12 +1046,16 @@ cc_dir_check_existing(const char *location, uid_t uid, goto done; } - dir = dirname(tmp); - if (!dir) { - DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot base get directory of %s\n", location)); - ret = EINVAL; - goto done; + if (0 == strncmp(location, "DIR::", 5)) { + dir = dirname(tmp); + if (!dir) { + DEBUG(SSSDBG_CRIT_FAILURE, + ("Cannot get base directory of %s.\n", tmp)); + ret = EINVAL; + goto done; + } + } else { + dir = tmp; } ret = cc_residual_is_used(uid, dir, SSS_KRB5_TYPE_DIR, &active); -- 1.8.3.1