[cifs-utils PATCH 9/8] cifs.upcall: use a MEMORY: ccache when instantiating from a keytab

Jeff Layton jlayton at samba.org
Fri Feb 24 15:53:22 UTC 2017

Using a more permanent ccache is potentially problematic when we're
instantiating a new one. We might be operating under different creds
than expected. Just use a MEMORY: ccache since we don't need it to
last longer than the life of the upcall anyway.

Signed-off-by: Jeff Layton <jlayton at samba.org>
 cifs.upcall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cifs.upcall.c b/cifs.upcall.c
index e0d372408233..89563fd42adc 100644
--- a/cifs.upcall.c
+++ b/cifs.upcall.c
@@ -410,9 +410,9 @@ init_cc_from_keytab(const char *keytab_name, const char *user)
 		goto icfk_cleanup;
-	ret = krb5_cc_default(context, &cc);
+	ret = krb5_cc_resolve(context, "MEMORY:", &cc);
 	if (ret) {
-		syslog(LOG_DEBUG, "krb5_cc_default: %d", (int)ret);
+		syslog(LOG_DEBUG, "krb5_cc_resolve: %d", (int)ret);
 		goto icfk_cleanup;

More information about the samba-technical mailing list