diff mbox series

cifs: fix mount option display for sec=krb5i

Message ID 20200210093814.24198-1-petr.pavlu@suse.com
State New
Headers show
Series cifs: fix mount option display for sec=krb5i | expand

Commit Message

Petr Pavlu Feb. 10, 2020, 9:38 a.m. UTC
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")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
---
 fs/cifs/cifsfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Steve French Feb. 10, 2020, 3:12 p.m. UTC | #1
merged into cifs-2.6.git for-next

On Mon, Feb 10, 2020 at 3:40 AM Petr Pavlu <petr.pavlu@suse.com> wrote:
>
> 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")
> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> ---
>  fs/cifs/cifsfs.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
> index 5492b9860baa..92b9c8221f07 100644
> --- a/fs/cifs/cifsfs.c
> +++ b/fs/cifs/cifsfs.c
> @@ -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
>
diff mbox series

Patch

diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 5492b9860baa..92b9c8221f07 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -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