Skip to contentSkip to conversation

cifs: fix mount option display for sec=krb5i

PATCH Applied Petr Pavlu 2 participants 2 messages Feb 10, 2020

Subsystems (2)
lore
Share & tools
lore

Petr Pavlu

author
#0 lore raw

PATCH 1/1 cifs: fix mount option display for sec=krb5i

Fix display for sec=krb5i which was wrongly interleaved by cruid, resulting in string "sec=krb5,cruid=<...>i" instead of "sec=krb5i,cruid=<...>".

Fixes 96281b9e46eb ("smb3: for kerberos mounts display the credential uid used")
---
 fs/cifs/cifsfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/cifs/cifsfs.c +5 -1
index 5492b9860baa..92b9c8221f07 100644
@@ -414,7 +414,7 @@ cifs_show_security(struct seq_file *s, struct cifs_ses *ses)
 		seq_puts(s, "ntlm");
 		break;
 	case Kerberos:
-		seq_printf(s, "krb5,cruid=%u", from_kuid_munged(&init_user_ns,ses->cred_uid));
+		seq_puts(s, "krb5");
 		break;
 	case RawNTLMSSP:
 		seq_puts(s, "ntlmssp");
@@ -427,6 +427,10 @@ cifs_show_security(struct seq_file *s, struct cifs_ses *ses)
 
 	if (ses->sign)
 		seq_puts(s, "i");
+
+	if (ses->sectype == Kerberos)
+		seq_printf(s, ",cruid=%u",
+			   from_kuid_munged(&init_user_ns, ses->cred_uid));
 }
 
 static void
Signature · 1 line
2.16.4
Applied
#1 lore raw

merged into cifs-2.6.git for-next

Quoted 38 lines · Petr Pavlu

Fix display for sec=krb5i which was wrongly interleaved by cruid, resulting in string "sec=krb5,cruid=<...>i" instead of "sec=krb5i,cruid=<...>".

Fixes 96281b9e46eb ("smb3: for kerberos mounts display the credential uid used")
---
 fs/cifs/cifsfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/cifs/cifsfs.c +5 -2
index 5492b9860baa..92b9c8221f07 100644
@@ -414,7 +414,7 @@ cifs_show_security(struct seq_file *s, struct cifs_ses *ses)
                seq_puts(s, "ntlm");
                break;
        case Kerberos:
-               seq_printf(s, "krb5,cruid=%u", from_kuid_munged(&init_user_ns,ses->cred_uid));
+               seq_puts(s, "krb5");
                break;
        case RawNTLMSSP:
                seq_puts(s, "ntlmssp");
@@ -427,6 +427,10 @@ cifs_show_security(struct seq_file *s, struct cifs_ses *ses)
 
        if (ses->sign)
                seq_puts(s, "i");
+
+       if (ses->sectype == Kerberos)
+               seq_printf(s, ",cruid=%u",
+                          from_kuid_munged(&init_user_ns, ses->cred_uid));
 }
 
 static void
--

2.16.4

Signature · 3 lines
Thanks,

Steve