summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Layton <jlayton@samba.org>2013-09-17 11:39:13 -0400
committerJeff Layton <jlayton@samba.org>2013-09-17 11:39:13 -0400
commitf03c51bbbbc5169fdf9431afd1f30f372531a6be (patch)
tree19786dc99f1dfb2686a425a999b99d28c2865630
parent92262eafa12b4e11fca1d6f3647cfdeff2f4281c (diff)
downloadcifs-utils-f03c51bbbbc5169fdf9431afd1f30f372531a6be.tar.gz
cifs-utils-f03c51bbbbc5169fdf9431afd1f30f372531a6be.tar.bz2
cifs-utils-f03c51bbbbc5169fdf9431afd1f30f372531a6be.zip
cifs.upcall: try to use default credcache if we didn't find one
Fedora is in the process of moving to KEYRING: credcaches which are not currently handled by cifs.upcall. We could try to detect when they're in use, but it's simpler and more robust to just try to use the default credcache whenever we don't find a FILE: or DIR: cache. Signed-off-by: Jeff Layton <jlayton@samba.org>
-rw-r--r--cifs.upcall.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/cifs.upcall.c b/cifs.upcall.c
index 20b562f..cc65824 100644
--- a/cifs.upcall.c
+++ b/cifs.upcall.c
@@ -382,11 +382,20 @@ cifs_krb5_get_req(const char *host, const char *ccname,
return ret;
}
- ret = krb5_cc_resolve(context, ccname, &ccache);
- if (ret) {
- syslog(LOG_DEBUG, "%s: unable to resolve %s to ccache\n",
- __func__, ccname);
- goto out_free_context;
+ if (ccname) {
+ ret = krb5_cc_resolve(context, ccname, &ccache);
+ if (ret) {
+ syslog(LOG_DEBUG, "%s: unable to resolve %s to ccache\n",
+ __func__, ccname);
+ goto out_free_context;
+ }
+ } else {
+ ret = krb5_cc_default(context, &ccache);
+ if (ret) {
+ syslog(LOG_DEBUG, "%s: krb5_cc_default: %d",
+ __func__, (int)ret);
+ goto out_free_context;
+ }
}
memset(&in_creds, 0, sizeof(in_creds));