Linux-CIFS Archive on lore.kernel.org
 help / color / 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	[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, back to index

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

Linux-CIFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-cifs/0 linux-cifs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-cifs linux-cifs/ https://lore.kernel.org/linux-cifs \
		linux-cifs@vger.kernel.org
	public-inbox-index linux-cifs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-cifs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git