linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cifs: fix mount option display for sec=krb5i
@ 2020-02-10  9:38 Petr Pavlu
  2020-02-10 15:12 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Pavlu @ 2020-02-10  9:38 UTC (permalink / raw)
  To: stfrench, linux-cifs; +Cc: 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")
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cifs: fix mount option display for sec=krb5i
  2020-02-10  9:38 [PATCH] cifs: fix mount option display for sec=krb5i Petr Pavlu
@ 2020-02-10 15:12 ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2020-02-10 15:12 UTC (permalink / raw)
  To: Petr Pavlu; +Cc: Steve French, CIFS

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
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-10 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10  9:38 [PATCH] cifs: fix mount option display for sec=krb5i Petr Pavlu
2020-02-10 15:12 ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).