Commit 9312f675 authored by Steve French's avatar Steve French

[CIFS] Fix mask so can set new cifs security flags properly

Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 254e55ed
...@@ -860,8 +860,6 @@ security_flags_write(struct file *file, const char __user *buffer, ...@@ -860,8 +860,6 @@ security_flags_write(struct file *file, const char __user *buffer,
char flags_string[12]; char flags_string[12];
char c; char c;
cERROR(1,("size %ld",count)); /* BB removeme BB */
if((count < 1) || (count > 11)) if((count < 1) || (count > 11))
return -EINVAL; return -EINVAL;
...@@ -883,14 +881,14 @@ security_flags_write(struct file *file, const char __user *buffer, ...@@ -883,14 +881,14 @@ security_flags_write(struct file *file, const char __user *buffer,
flags = simple_strtoul(flags_string, NULL, 0); flags = simple_strtoul(flags_string, NULL, 0);
cERROR(1,("sec flags 0x%x", flags)); /* BB FIXME make cFYI */ cFYI(1,("sec flags 0x%x", flags));
if(flags <= 0) { if(flags <= 0) {
cERROR(1,("invalid security flags %s",flags_string)); cERROR(1,("invalid security flags %s",flags_string));
return -EINVAL; return -EINVAL;
} }
if((flags & CIFSSEC_MASK) != CIFSSEC_MASK) { if(flags & ~CIFSSEC_MASK) {
cERROR(1,("attempt to set unsupported security flags 0x%d", cERROR(1,("attempt to set unsupported security flags 0x%d",
flags & ~CIFSSEC_MASK)); flags & ~CIFSSEC_MASK));
return -EINVAL; return -EINVAL;
......
...@@ -339,9 +339,10 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, ...@@ -339,9 +339,10 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
return -EOPNOTSUPP; return -EOPNOTSUPP;
#endif #endif
wct = 10; /* lanman 2 style sessionsetup */ wct = 10; /* lanman 2 style sessionsetup */
} else if((type == NTLM) || (type == NTLMv2)) /* NTLMv2 may retry NTLM */ } else if((type == NTLM) || (type == NTLMv2)) {
/* For NTLMv2 failures eventually may need to retry NTLM */
wct = 13; /* old style NTLM sessionsetup */ wct = 13; /* old style NTLM sessionsetup */
else /* same size for negotiate or auth, NTLMSSP or extended security */ } else /* same size for negotiate or auth, NTLMSSP or extended security */
wct = 12; wct = 12;
rc = small_smb_init_no_tc(SMB_COM_SESSION_SETUP_ANDX, wct, ses, rc = small_smb_init_no_tc(SMB_COM_SESSION_SETUP_ANDX, wct, ses,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment