* [PATCH v3] cifs: dump Security Type info in DebugData
@ 2020-06-05 15:17 Kenneth D'souza
2020-06-09 5:01 ` Steve French
0 siblings, 1 reply; 3+ messages in thread
From: Kenneth D'souza @ 2020-06-05 15:17 UTC (permalink / raw)
To: linux-cifs; +Cc: smfrench, kdsouza, rbergant
Currently the end user is unaware with what sec type the
cifs share is mounted if no sec=<type> option is parsed.
With this patch one can easily check from DebugData.
Example:
1) Name: x.x.x.x Uses: 1 Capability: 0x8001f3fc Session Status: 1 Security type: RawNTLMSSP
Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
---
fs/cifs/cifs_debug.c | 4 ++++
fs/cifs/cifsglob.h | 18 ++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 916567d770f5..9caca784376b 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -375,6 +375,10 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
ses->ses_count, ses->serverOS, ses->serverNOS,
ses->capabilities, ses->status);
}
+
+ seq_printf(m,"Security type: %s\n",
+ get_security_type_str(server->ops->select_sectype(server, ses->sectype)));
+
if (server->rdma)
seq_printf(m, "RDMA\n\t");
seq_printf(m, "TCP status: %d Instance: %d\n\tLocal Users To "
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 39b708d9d86d..d8ef01039e71 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -1994,6 +1994,24 @@ extern struct smb_version_values smb302_values;
extern struct smb_version_operations smb311_operations;
extern struct smb_version_values smb311_values;
+static inline char *get_security_type_str(enum securityEnum sectype)
+{
+ switch (sectype) {
+ case RawNTLMSSP:
+ return "RawNTLMSSP";
+ case Kerberos:
+ return "Kerberos";
+ case NTLMv2:
+ return "NTLMv2";
+ case NTLM:
+ return "NTLM";
+ case LANMAN:
+ return "LANMAN";
+ default:
+ return "Unknown";
+ }
+}
+
static inline bool is_smb1_server(struct TCP_Server_Info *server)
{
return strcmp(server->vals->version_string, SMB1_VERSION_STRING) == 0;
--
2.21.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] cifs: dump Security Type info in DebugData
2020-06-05 15:17 [PATCH v3] cifs: dump Security Type info in DebugData Kenneth D'souza
@ 2020-06-09 5:01 ` Steve French
2020-06-09 5:02 ` Kenneth Dsouza
0 siblings, 1 reply; 3+ messages in thread
From: Steve French @ 2020-06-09 5:01 UTC (permalink / raw)
To: Kenneth D'souza; +Cc: CIFS, Roberto Bergantinos Corpas
the updated version of this one has been merged into cifs-2.6.git for-next
On Fri, Jun 5, 2020 at 10:17 AM Kenneth D'souza <kdsouza@redhat.com> wrote:
>
> Currently the end user is unaware with what sec type the
> cifs share is mounted if no sec=<type> option is parsed.
> With this patch one can easily check from DebugData.
>
> Example:
> 1) Name: x.x.x.x Uses: 1 Capability: 0x8001f3fc Session Status: 1 Security type: RawNTLMSSP
>
> Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
> Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
> ---
> fs/cifs/cifs_debug.c | 4 ++++
> fs/cifs/cifsglob.h | 18 ++++++++++++++++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
> index 916567d770f5..9caca784376b 100644
> --- a/fs/cifs/cifs_debug.c
> +++ b/fs/cifs/cifs_debug.c
> @@ -375,6 +375,10 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
> ses->ses_count, ses->serverOS, ses->serverNOS,
> ses->capabilities, ses->status);
> }
> +
> + seq_printf(m,"Security type: %s\n",
> + get_security_type_str(server->ops->select_sectype(server, ses->sectype)));
> +
> if (server->rdma)
> seq_printf(m, "RDMA\n\t");
> seq_printf(m, "TCP status: %d Instance: %d\n\tLocal Users To "
> diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
> index 39b708d9d86d..d8ef01039e71 100644
> --- a/fs/cifs/cifsglob.h
> +++ b/fs/cifs/cifsglob.h
> @@ -1994,6 +1994,24 @@ extern struct smb_version_values smb302_values;
> extern struct smb_version_operations smb311_operations;
> extern struct smb_version_values smb311_values;
>
> +static inline char *get_security_type_str(enum securityEnum sectype)
> +{
> + switch (sectype) {
> + case RawNTLMSSP:
> + return "RawNTLMSSP";
> + case Kerberos:
> + return "Kerberos";
> + case NTLMv2:
> + return "NTLMv2";
> + case NTLM:
> + return "NTLM";
> + case LANMAN:
> + return "LANMAN";
> + default:
> + return "Unknown";
> + }
> +}
> +
> static inline bool is_smb1_server(struct TCP_Server_Info *server)
> {
> return strcmp(server->vals->version_string, SMB1_VERSION_STRING) == 0;
> --
> 2.21.1
>
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] cifs: dump Security Type info in DebugData
2020-06-09 5:01 ` Steve French
@ 2020-06-09 5:02 ` Kenneth Dsouza
0 siblings, 0 replies; 3+ messages in thread
From: Kenneth Dsouza @ 2020-06-09 5:02 UTC (permalink / raw)
To: Steve French; +Cc: CIFS, Roberto Bergantinos Corpas
Thanks Steve :)
On Tue, Jun 9, 2020 at 10:31 AM Steve French <smfrench@gmail.com> wrote:
>
> the updated version of this one has been merged into cifs-2.6.git for-next
>
> On Fri, Jun 5, 2020 at 10:17 AM Kenneth D'souza <kdsouza@redhat.com> wrote:
> >
> > Currently the end user is unaware with what sec type the
> > cifs share is mounted if no sec=<type> option is parsed.
> > With this patch one can easily check from DebugData.
> >
> > Example:
> > 1) Name: x.x.x.x Uses: 1 Capability: 0x8001f3fc Session Status: 1 Security type: RawNTLMSSP
> >
> > Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
> > Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
> > ---
> > fs/cifs/cifs_debug.c | 4 ++++
> > fs/cifs/cifsglob.h | 18 ++++++++++++++++++
> > 2 files changed, 22 insertions(+)
> >
> > diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
> > index 916567d770f5..9caca784376b 100644
> > --- a/fs/cifs/cifs_debug.c
> > +++ b/fs/cifs/cifs_debug.c
> > @@ -375,6 +375,10 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
> > ses->ses_count, ses->serverOS, ses->serverNOS,
> > ses->capabilities, ses->status);
> > }
> > +
> > + seq_printf(m,"Security type: %s\n",
> > + get_security_type_str(server->ops->select_sectype(server, ses->sectype)));
> > +
> > if (server->rdma)
> > seq_printf(m, "RDMA\n\t");
> > seq_printf(m, "TCP status: %d Instance: %d\n\tLocal Users To "
> > diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
> > index 39b708d9d86d..d8ef01039e71 100644
> > --- a/fs/cifs/cifsglob.h
> > +++ b/fs/cifs/cifsglob.h
> > @@ -1994,6 +1994,24 @@ extern struct smb_version_values smb302_values;
> > extern struct smb_version_operations smb311_operations;
> > extern struct smb_version_values smb311_values;
> >
> > +static inline char *get_security_type_str(enum securityEnum sectype)
> > +{
> > + switch (sectype) {
> > + case RawNTLMSSP:
> > + return "RawNTLMSSP";
> > + case Kerberos:
> > + return "Kerberos";
> > + case NTLMv2:
> > + return "NTLMv2";
> > + case NTLM:
> > + return "NTLM";
> > + case LANMAN:
> > + return "LANMAN";
> > + default:
> > + return "Unknown";
> > + }
> > +}
> > +
> > static inline bool is_smb1_server(struct TCP_Server_Info *server)
> > {
> > return strcmp(server->vals->version_string, SMB1_VERSION_STRING) == 0;
> > --
> > 2.21.1
> >
>
>
> --
> Thanks,
>
> Steve
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-09 5:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 15:17 [PATCH v3] cifs: dump Security Type info in DebugData Kenneth D'souza
2020-06-09 5:01 ` Steve French
2020-06-09 5:02 ` Kenneth Dsouza
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.