diff options
author | Niklas Cassel <niklas.cassel@axis.com> | 2015-01-22 08:16:34 -0500 |
---|---|---|
committer | Steve French <steve.french@primarydata.com> | 2015-01-26 20:38:26 -0500 |
commit | 7a1ceba071709d11271ebd921310b5a18404dd33 (patch) | |
tree | 15af02690777a0333af178c4e1df7510ec1f0c0f /fs/cifs/cifs_debug.c | |
parent | ca7df8e0bb2a5ec79691de8a1a4c0e611fe04e60 (diff) |
cifs: fix MUST SecurityFlags filtering
If CONFIG_CIFS_WEAK_PW_HASH is not set, CIFSSEC_MUST_LANMAN
and CIFSSEC_MUST_PLNTXT is defined as 0.
When setting new SecurityFlags without any MUST flags,
your flags would be overwritten with CIFSSEC_MUST_LANMAN (0).
Signed-off-by: Niklas Cassel <niklass@axis.com>
Signed-off-by: Steve French <steve.french@primarydata.com>
Diffstat (limited to 'fs/cifs/cifs_debug.c')
-rw-r--r-- | fs/cifs/cifs_debug.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 9c56ef776407..7febcf2475c5 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -606,9 +606,11 @@ cifs_security_flags_handle_must_flags(unsigned int *flags) | |||
606 | *flags = CIFSSEC_MUST_NTLMV2; | 606 | *flags = CIFSSEC_MUST_NTLMV2; |
607 | else if ((*flags & CIFSSEC_MUST_NTLM) == CIFSSEC_MUST_NTLM) | 607 | else if ((*flags & CIFSSEC_MUST_NTLM) == CIFSSEC_MUST_NTLM) |
608 | *flags = CIFSSEC_MUST_NTLM; | 608 | *flags = CIFSSEC_MUST_NTLM; |
609 | else if ((*flags & CIFSSEC_MUST_LANMAN) == CIFSSEC_MUST_LANMAN) | 609 | else if (CIFSSEC_MUST_LANMAN && |
610 | (*flags & CIFSSEC_MUST_LANMAN) == CIFSSEC_MUST_LANMAN) | ||
610 | *flags = CIFSSEC_MUST_LANMAN; | 611 | *flags = CIFSSEC_MUST_LANMAN; |
611 | else if ((*flags & CIFSSEC_MUST_PLNTXT) == CIFSSEC_MUST_PLNTXT) | 612 | else if (CIFSSEC_MUST_PLNTXT && |
613 | (*flags & CIFSSEC_MUST_PLNTXT) == CIFSSEC_MUST_PLNTXT) | ||
612 | *flags = CIFSSEC_MUST_PLNTXT; | 614 | *flags = CIFSSEC_MUST_PLNTXT; |
613 | 615 | ||
614 | *flags |= signflags; | 616 | *flags |= signflags; |