diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2013-06-28 16:06:38 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-07-11 00:27:07 +0200 |
commit | f65eb572cbc8796fefaad52e36a9a6cea0cf51bd (patch) | |
tree | dddbf4814b0bae568d81acb5b017cf582e1b927c /src/providers/krb5 | |
parent | d6a0c882565367df62540bf584662c767ffb89d1 (diff) | |
download | sssd-f65eb572cbc8796fefaad52e36a9a6cea0cf51bd.tar.gz sssd-f65eb572cbc8796fefaad52e36a9a6cea0cf51bd.tar.xz sssd-f65eb572cbc8796fefaad52e36a9a6cea0cf51bd.zip |
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
Diffstat (limited to 'src/providers/krb5')
-rw-r--r-- | src/providers/krb5/krb5_utils.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c index 1f7ed0745..468ceb84f 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); |