summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-06-28 16:06:38 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-07-11 00:23:46 +0200
commite2e9c08851e8fe2b7d843c8fabc7cbc0fb298536 (patch)
tree3ca6a72c2b4b7ee298074d1fb524c5c158c36906 /src/providers
parentf6693151b0959f079271f5ab3976befb02ea91a9 (diff)
downloadsssd-e2e9c08851e8fe2b7d843c8fabc7cbc0fb298536.tar.gz
sssd-e2e9c08851e8fe2b7d843c8fabc7cbc0fb298536.tar.xz
sssd-e2e9c08851e8fe2b7d843c8fabc7cbc0fb298536.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')
-rw-r--r--src/providers/krb5/krb5_utils.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index 4811a736c..860c71b00 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);