Skip to contentSkip to conversation

cifs: show sec= option in /proc/mounts

PATCH In review Jeff Layton 2 participants 2 messages Jun 13, 2011 1 message not in the archive

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

PATCH 1/1 cifs: show sec= option in /proc/mounts

---
 fs/cifs/cifsfs.c |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)
fs/cifs/cifsfs.c +33 -0
index 989442d..e9def99 100644
@@ -352,6 +352,37 @@ cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server)
 	}
 }
 
+static void
+cifs_show_security(struct seq_file *s, struct TCP_Server_Info *server)
+{
+	seq_printf(s, ",sec=");
+
+	switch (server->secType) {
+	case LANMAN:
+		seq_printf(s, "lanman");
+		break;
+	case NTLMv2:
+		seq_printf(s, "ntlmv2");
+		break;
+	case NTLM:
+		seq_printf(s, "ntlm");
+		break;
+	case Kerberos:
+		seq_printf(s, "krb5");
+		break;
+	case RawNTLMSSP:
+		seq_printf(s, "ntlmssp");
+		break;
+	default:
+		/* shouldn't ever happen */
+		seq_printf(s, "unknown");
+		break;
+	}
+
+	if (server->sec_mode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
+		seq_printf(s, "i");
+}
+
 /*
  * cifs_show_options() is for displaying mount options in /proc/mounts.
  * Not all settable options are displayed but most of the important
@@ -365,6 +396,8 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
 	struct sockaddr *srcaddr;
 	srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr;
 
+	cifs_show_security(s, tcon->ses->server);
+
 	seq_printf(s, ",unc=%s", tcon->treeName);
 
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER)
Signature · 1 line
1.7.5.2

A message that is not in the archive (sent off-list or not yet received): 1307980241-2265-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#2 lore raw

seems reasonable to display this.

Merged.

Quoted 60 lines · Jeff Layton

---
 fs/cifs/cifsfs.c |   33 +++++++++++++++++++++++++++++++++

 1 files changed, 33 insertions(+), 0 deletions(-)
fs/cifs/cifsfs.c +33 -1
index 989442d..e9def99 100644
@@ -352,6 +352,37 @@ cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server)
        }
  }
 
+static void
+cifs_show_security(struct seq_file *s, struct TCP_Server_Info *server)
+{
+       seq_printf(s, ",sec=");
+
+       switch (server->secType) {
+       case LANMAN:
+               seq_printf(s, "lanman");
+               break;
+       case NTLMv2:
+               seq_printf(s, "ntlmv2");
+               break;
+       case NTLM:
+               seq_printf(s, "ntlm");
+               break;
+       case Kerberos:
+               seq_printf(s, "krb5");
+               break;
+       case RawNTLMSSP:
+               seq_printf(s, "ntlmssp");
+               break;
+       default:
+               /* shouldn't ever happen */
+               seq_printf(s, "unknown");
+               break;
+       }
+
+       if (server->sec_mode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
+               seq_printf(s, "i");
+}
+
  /*
  * cifs_show_options() is for displaying mount options in /proc/mounts.
  * Not all settable options are displayed but most of the important
@@ -365,6 +396,8 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
        struct sockaddr *srcaddr;
        srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr;
 
+       cifs_show_security(s, tcon->ses->server);
+
        seq_printf(s, ",unc=%s", tcon->treeName);
 
        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER)
--

1.7.5.2

Signature · 3 lines
Thanks,

Steve