提交 04912d6a 编写于 作者: J Jeff Layton 提交者: Steve French

cifs: rename "extended_security" to "global_secflags"

...since that more accurately describes what that variable holds.
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 d00c28de
...@@ -716,7 +716,7 @@ static const struct file_operations cifs_multiuser_mount_proc_fops = { ...@@ -716,7 +716,7 @@ static const struct file_operations cifs_multiuser_mount_proc_fops = {
static int cifs_security_flags_proc_show(struct seq_file *m, void *v) static int cifs_security_flags_proc_show(struct seq_file *m, void *v)
{ {
seq_printf(m, "0x%x\n", extended_security); seq_printf(m, "0x%x\n", global_secflags);
return 0; return 0;
} }
...@@ -744,10 +744,10 @@ static ssize_t cifs_security_flags_proc_write(struct file *file, ...@@ -744,10 +744,10 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
/* single char or single char followed by null */ /* single char or single char followed by null */
c = flags_string[0]; c = flags_string[0];
if (c == '0' || c == 'n' || c == 'N') { if (c == '0' || c == 'n' || c == 'N') {
extended_security = CIFSSEC_DEF; /* default */ global_secflags = CIFSSEC_DEF; /* default */
return count; return count;
} else if (c == '1' || c == 'y' || c == 'Y') { } else if (c == '1' || c == 'y' || c == 'Y') {
extended_security = CIFSSEC_MAX; global_secflags = CIFSSEC_MAX;
return count; return count;
} else if (!isdigit(c)) { } else if (!isdigit(c)) {
cERROR(1, "invalid flag %c", c); cERROR(1, "invalid flag %c", c);
...@@ -771,12 +771,12 @@ static ssize_t cifs_security_flags_proc_write(struct file *file, ...@@ -771,12 +771,12 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
return -EINVAL; return -EINVAL;
} }
/* flags look ok - update the global security flags for cifs module */ /* flags look ok - update the global security flags for cifs module */
extended_security = flags; global_secflags = flags;
if (extended_security & CIFSSEC_MUST_SIGN) { if (global_secflags & CIFSSEC_MUST_SIGN) {
/* requiring signing implies signing is allowed */ /* requiring signing implies signing is allowed */
extended_security |= CIFSSEC_MAY_SIGN; global_secflags |= CIFSSEC_MAY_SIGN;
cFYI(1, "packet signing now required"); cFYI(1, "packet signing now required");
} else if ((extended_security & CIFSSEC_MAY_SIGN) == 0) { } else if ((global_secflags & CIFSSEC_MAY_SIGN) == 0) {
cFYI(1, "packet signing disabled"); cFYI(1, "packet signing disabled");
} }
/* BB should we turn on MAY flags for other MUST options? */ /* BB should we turn on MAY flags for other MUST options? */
......
...@@ -291,7 +291,7 @@ void calc_lanman_hash(const char *password, const char *cryptkey, bool encrypt, ...@@ -291,7 +291,7 @@ void calc_lanman_hash(const char *password, const char *cryptkey, bool encrypt,
if (password) if (password)
strncpy(password_with_pad, password, CIFS_ENCPWD_SIZE); strncpy(password_with_pad, password, CIFS_ENCPWD_SIZE);
if (!encrypt && extended_security & CIFSSEC_MAY_PLNTXT) { if (!encrypt && global_secflags & CIFSSEC_MAY_PLNTXT) {
memset(lnm_session_key, 0, CIFS_SESS_KEY_SIZE); memset(lnm_session_key, 0, CIFS_SESS_KEY_SIZE);
memcpy(lnm_session_key, password_with_pad, memcpy(lnm_session_key, password_with_pad,
CIFS_ENCPWD_SIZE); CIFS_ENCPWD_SIZE);
......
...@@ -61,7 +61,7 @@ unsigned int experimEnabled = 0; ...@@ -61,7 +61,7 @@ unsigned int experimEnabled = 0;
unsigned int linuxExtEnabled = 1; unsigned int linuxExtEnabled = 1;
unsigned int lookupCacheEnabled = 1; unsigned int lookupCacheEnabled = 1;
unsigned int multiuser_mount = 0; unsigned int multiuser_mount = 0;
unsigned int extended_security = CIFSSEC_DEF; unsigned int global_secflags = CIFSSEC_DEF;
/* unsigned int ntlmv2_support = 0; */ /* unsigned int ntlmv2_support = 0; */
unsigned int sign_CIFS_PDUs = 1; unsigned int sign_CIFS_PDUs = 1;
static const struct super_operations cifs_super_ops; static const struct super_operations cifs_super_ops;
......
...@@ -717,7 +717,7 @@ GLOBAL_EXTERN unsigned int multiuser_mount; /* if enabled allows new sessions ...@@ -717,7 +717,7 @@ GLOBAL_EXTERN unsigned int multiuser_mount; /* if enabled allows new sessions
GLOBAL_EXTERN unsigned int oplockEnabled; GLOBAL_EXTERN unsigned int oplockEnabled;
GLOBAL_EXTERN unsigned int experimEnabled; GLOBAL_EXTERN unsigned int experimEnabled;
GLOBAL_EXTERN unsigned int lookupCacheEnabled; GLOBAL_EXTERN unsigned int lookupCacheEnabled;
GLOBAL_EXTERN unsigned int extended_security; /* if on, session setup sent GLOBAL_EXTERN unsigned int global_secflags; /* if on, session setup sent
with more secure ntlmssp2 challenge/resp */ with more secure ntlmssp2 challenge/resp */
GLOBAL_EXTERN unsigned int sign_CIFS_PDUs; /* enable smb packet signing */ GLOBAL_EXTERN unsigned int sign_CIFS_PDUs; /* enable smb packet signing */
GLOBAL_EXTERN unsigned int linuxExtEnabled;/*enable Linux/Unix CIFS extensions*/ GLOBAL_EXTERN unsigned int linuxExtEnabled;/*enable Linux/Unix CIFS extensions*/
......
...@@ -372,7 +372,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) ...@@ -372,7 +372,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
if (ses->overrideSecFlg & (~(CIFSSEC_MUST_SIGN | CIFSSEC_MUST_SEAL))) if (ses->overrideSecFlg & (~(CIFSSEC_MUST_SIGN | CIFSSEC_MUST_SEAL)))
secFlags = ses->overrideSecFlg; /* BB FIXME fix sign flags? */ secFlags = ses->overrideSecFlg; /* BB FIXME fix sign flags? */
else /* if override flags set only sign/seal OR them with global auth */ else /* if override flags set only sign/seal OR them with global auth */
secFlags = extended_security | ses->overrideSecFlg; secFlags = global_secflags | ses->overrideSecFlg;
cFYI(1, "secFlags 0x%x", secFlags); cFYI(1, "secFlags 0x%x", secFlags);
......
...@@ -2748,7 +2748,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, ...@@ -2748,7 +2748,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
by Samba (not sure whether other servers allow by Samba (not sure whether other servers allow
NTLMv2 password here) */ NTLMv2 password here) */
#ifdef CONFIG_CIFS_WEAK_PW_HASH #ifdef CONFIG_CIFS_WEAK_PW_HASH
if ((extended_security & CIFSSEC_MAY_LANMAN) && if ((global_secflags & CIFSSEC_MAY_LANMAN) &&
(ses->server->secType == LANMAN)) (ses->server->secType == LANMAN))
calc_lanman_hash(tcon->password, ses->server->cryptKey, calc_lanman_hash(tcon->password, ses->server->cryptKey,
ses->server->secMode & ses->server->secMode &
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册