Skip to contentSkip to conversation

cifs.upcall: unset $KRB5CCNAME when creating new credcache from keytab

PATCH New Jeff Layton 1 participant 1 message Feb 23, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs.upcall: unset $KRB5CCNAME when creating new credcache from keytab

We don't want to trust $KRB5CCNAME since we could be operating under the wrong credentials. Always create new credcaches in the default location instead.

---
 cifs.upcall.c | 6 ++++++
 1 file changed, 6 insertions(+)
cifs.upcall.c +6 -0
index f766a8b5799e..dbdfe7aff681 100644
@@ -365,6 +365,12 @@ init_cc_from_keytab(const char *keytab_name, const char *user)
 
 	memset((char *) &my_creds, 0, sizeof(my_creds));
 
+	/*
+	 * Unset the environment variable, if any. If we're creating our own
+	 * credcache here, stick it in the default location.
+	 */
+	unsetenv(ENV_NAME);
+
 	if (keytab_name)
 		ret = krb5_kt_resolve(context, keytab_name, &keytab);
 	else
Signature · 1 line
2.9.3