diff options
author | Nalin Dahyabhai <nalin@redhat.com> | 2012-08-23 11:14:45 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@samba.org> | 2012-08-23 07:46:28 -0400 |
commit | d006986221b7f1aad50e894851dc573650b7611c (patch) | |
tree | b12f75497ac3f5c06dec511ce9ee49aa3ebc251a | |
parent | 377898e63a8689b0e8c5c656ce9cfa98223cf74b (diff) | |
download | cifs-utils-d006986221b7f1aad50e894851dc573650b7611c.tar.gz cifs-utils-d006986221b7f1aad50e894851dc573650b7611c.tar.bz2 cifs-utils-d006986221b7f1aad50e894851dc573650b7611c.zip |
cifs.upcall: also consider DIR:-type ccaches
If we encounter a subdirectory while scanning a directory for a user's
ccache, check if it's a "DIR" ccache. Otherwise, continue as before,
checking if it's a "FILE" ccache if it looks like a regular file.
-rw-r--r-- | cifs.upcall.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cifs.upcall.c b/cifs.upcall.c index eef461d..6f95c1c 100644 --- a/cifs.upcall.c +++ b/cifs.upcall.c @@ -292,6 +292,11 @@ static char *find_krb5_cc(const char *dirname, uid_t uid) free(namelist[i]); continue; } + if (S_ISDIR(sbuf.st_mode)) { + snprintf(ccname, sizeof(ccname), "DIR:%s/%s", dirname, + namelist[i]->d_name); + credpath = ccname + 4; + } else if (!S_ISREG(sbuf.st_mode)) { syslog(LOG_DEBUG, "%s: %s is not a regular file", __func__, credpath); |