diff options
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r-- | fs/cifs/cifsglob.h | 71 |
1 files changed, 47 insertions, 24 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 006eb33bff5f..6d7cf5f3bc0b 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -88,7 +88,8 @@ enum statusEnum { | |||
88 | }; | 88 | }; |
89 | 89 | ||
90 | enum securityEnum { | 90 | enum securityEnum { |
91 | NTLM = 0, /* Legacy NTLM012 auth with NTLM hash */ | 91 | LANMAN = 0, /* Legacy LANMAN auth */ |
92 | NTLM, /* Legacy NTLM012 auth with NTLM hash */ | ||
92 | NTLMv2, /* Legacy NTLM auth with NTLMv2 hash */ | 93 | NTLMv2, /* Legacy NTLM auth with NTLMv2 hash */ |
93 | RawNTLMSSP, /* NTLMSSP without SPNEGO */ | 94 | RawNTLMSSP, /* NTLMSSP without SPNEGO */ |
94 | NTLMSSP, /* NTLMSSP via SPNEGO */ | 95 | NTLMSSP, /* NTLMSSP via SPNEGO */ |
@@ -157,7 +158,7 @@ struct TCP_Server_Info { | |||
157 | /* 16th byte of RFC1001 workstation name is always null */ | 158 | /* 16th byte of RFC1001 workstation name is always null */ |
158 | char workstation_RFC1001_name[SERVER_NAME_LEN_WITH_NULL]; | 159 | char workstation_RFC1001_name[SERVER_NAME_LEN_WITH_NULL]; |
159 | __u32 sequence_number; /* needed for CIFS PDU signature */ | 160 | __u32 sequence_number; /* needed for CIFS PDU signature */ |
160 | char mac_signing_key[CIFS_SESSION_KEY_SIZE + 16]; | 161 | char mac_signing_key[CIFS_SESS_KEY_SIZE + 16]; |
161 | }; | 162 | }; |
162 | 163 | ||
163 | /* | 164 | /* |
@@ -179,10 +180,13 @@ struct cifsUidInfo { | |||
179 | struct cifsSesInfo { | 180 | struct cifsSesInfo { |
180 | struct list_head cifsSessionList; | 181 | struct list_head cifsSessionList; |
181 | struct semaphore sesSem; | 182 | struct semaphore sesSem; |
183 | #if 0 | ||
182 | struct cifsUidInfo *uidInfo; /* pointer to user info */ | 184 | struct cifsUidInfo *uidInfo; /* pointer to user info */ |
185 | #endif | ||
183 | struct TCP_Server_Info *server; /* pointer to server info */ | 186 | struct TCP_Server_Info *server; /* pointer to server info */ |
184 | atomic_t inUse; /* # of mounts (tree connections) on this ses */ | 187 | atomic_t inUse; /* # of mounts (tree connections) on this ses */ |
185 | enum statusEnum status; | 188 | enum statusEnum status; |
189 | unsigned overrideSecFlg; /* if non-zero override global sec flags */ | ||
186 | __u16 ipc_tid; /* special tid for connection to IPC share */ | 190 | __u16 ipc_tid; /* special tid for connection to IPC share */ |
187 | __u16 flags; | 191 | __u16 flags; |
188 | char *serverOS; /* name of operating system underlying server */ | 192 | char *serverOS; /* name of operating system underlying server */ |
@@ -194,7 +198,7 @@ struct cifsSesInfo { | |||
194 | char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for | 198 | char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for |
195 | TCP names - will ipv6 and sctp addresses fit? */ | 199 | TCP names - will ipv6 and sctp addresses fit? */ |
196 | char userName[MAX_USERNAME_SIZE + 1]; | 200 | char userName[MAX_USERNAME_SIZE + 1]; |
197 | char domainName[MAX_USERNAME_SIZE + 1]; | 201 | char * domainName; |
198 | char * password; | 202 | char * password; |
199 | }; | 203 | }; |
200 | /* session flags */ | 204 | /* session flags */ |
@@ -209,12 +213,12 @@ struct cifsTconInfo { | |||
209 | struct list_head openFileList; | 213 | struct list_head openFileList; |
210 | struct semaphore tconSem; | 214 | struct semaphore tconSem; |
211 | struct cifsSesInfo *ses; /* pointer to session associated with */ | 215 | struct cifsSesInfo *ses; /* pointer to session associated with */ |
212 | char treeName[MAX_TREE_SIZE + 1]; /* UNC name of resource (in ASCII not UTF) */ | 216 | char treeName[MAX_TREE_SIZE + 1]; /* UNC name of resource in ASCII */ |
213 | char *nativeFileSystem; | 217 | char *nativeFileSystem; |
214 | __u16 tid; /* The 2 byte tree id */ | 218 | __u16 tid; /* The 2 byte tree id */ |
215 | __u16 Flags; /* optional support bits */ | 219 | __u16 Flags; /* optional support bits */ |
216 | enum statusEnum tidStatus; | 220 | enum statusEnum tidStatus; |
217 | atomic_t useCount; /* how many mounts (explicit or implicit) to this share */ | 221 | atomic_t useCount; /* how many explicit/implicit mounts to share */ |
218 | #ifdef CONFIG_CIFS_STATS | 222 | #ifdef CONFIG_CIFS_STATS |
219 | atomic_t num_smbs_sent; | 223 | atomic_t num_smbs_sent; |
220 | atomic_t num_writes; | 224 | atomic_t num_writes; |
@@ -254,7 +258,7 @@ struct cifsTconInfo { | |||
254 | spinlock_t stat_lock; | 258 | spinlock_t stat_lock; |
255 | #endif /* CONFIG_CIFS_STATS */ | 259 | #endif /* CONFIG_CIFS_STATS */ |
256 | FILE_SYSTEM_DEVICE_INFO fsDevInfo; | 260 | FILE_SYSTEM_DEVICE_INFO fsDevInfo; |
257 | FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if file system name truncated */ | 261 | FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if fs name truncated */ |
258 | FILE_SYSTEM_UNIX_INFO fsUnixInfo; | 262 | FILE_SYSTEM_UNIX_INFO fsUnixInfo; |
259 | unsigned retry:1; | 263 | unsigned retry:1; |
260 | unsigned nocase:1; | 264 | unsigned nocase:1; |
@@ -305,7 +309,6 @@ struct cifsFileInfo { | |||
305 | atomic_t wrtPending; /* handle in use - defer close */ | 309 | atomic_t wrtPending; /* handle in use - defer close */ |
306 | struct semaphore fh_sem; /* prevents reopen race after dead ses*/ | 310 | struct semaphore fh_sem; /* prevents reopen race after dead ses*/ |
307 | char * search_resume_name; /* BB removeme BB */ | 311 | char * search_resume_name; /* BB removeme BB */ |
308 | unsigned int resume_name_length; /* BB removeme - field renamed and moved BB */ | ||
309 | struct cifs_search_info srch_inf; | 312 | struct cifs_search_info srch_inf; |
310 | }; | 313 | }; |
311 | 314 | ||
@@ -391,9 +394,9 @@ struct mid_q_entry { | |||
391 | struct smb_hdr *resp_buf; /* response buffer */ | 394 | struct smb_hdr *resp_buf; /* response buffer */ |
392 | int midState; /* wish this were enum but can not pass to wait_event */ | 395 | int midState; /* wish this were enum but can not pass to wait_event */ |
393 | __u8 command; /* smb command code */ | 396 | __u8 command; /* smb command code */ |
394 | unsigned multiPart:1; /* multiple responses to one SMB request */ | ||
395 | unsigned largeBuf:1; /* if valid response, is pointer to large buf */ | 397 | unsigned largeBuf:1; /* if valid response, is pointer to large buf */ |
396 | unsigned multiResp:1; /* multiple trans2 responses for one request */ | 398 | unsigned multiRsp:1; /* multiple trans2 responses for one request */ |
399 | unsigned multiEnd:1; /* both received */ | ||
397 | }; | 400 | }; |
398 | 401 | ||
399 | struct oplock_q_entry { | 402 | struct oplock_q_entry { |
@@ -430,15 +433,35 @@ struct dir_notify_req { | |||
430 | #define CIFS_LARGE_BUFFER 2 | 433 | #define CIFS_LARGE_BUFFER 2 |
431 | #define CIFS_IOVEC 4 /* array of response buffers */ | 434 | #define CIFS_IOVEC 4 /* array of response buffers */ |
432 | 435 | ||
433 | /* Type of session setup needed */ | 436 | /* Security Flags: indicate type of session setup needed */ |
434 | #define CIFS_PLAINTEXT 0 | 437 | #define CIFSSEC_MAY_SIGN 0x00001 |
435 | #define CIFS_LANMAN 1 | 438 | #define CIFSSEC_MAY_NTLM 0x00002 |
436 | #define CIFS_NTLM 2 | 439 | #define CIFSSEC_MAY_NTLMV2 0x00004 |
437 | #define CIFS_NTLMSSP_NEG 3 | 440 | #define CIFSSEC_MAY_KRB5 0x00008 |
438 | #define CIFS_NTLMSSP_AUTH 4 | 441 | #ifdef CONFIG_CIFS_WEAK_PW_HASH |
439 | #define CIFS_SPNEGO_INIT 5 | 442 | #define CIFSSEC_MAY_LANMAN 0x00010 |
440 | #define CIFS_SPNEGO_TARG 6 | 443 | #define CIFSSEC_MAY_PLNTXT 0x00020 |
441 | 444 | #endif /* weak passwords */ | |
445 | #define CIFSSEC_MAY_SEAL 0x00040 /* not supported yet */ | ||
446 | |||
447 | #define CIFSSEC_MUST_SIGN 0x01001 | ||
448 | /* note that only one of the following can be set so the | ||
449 | result of setting MUST flags more than once will be to | ||
450 | require use of the stronger protocol */ | ||
451 | #define CIFSSEC_MUST_NTLM 0x02002 | ||
452 | #define CIFSSEC_MUST_NTLMV2 0x04004 | ||
453 | #define CIFSSEC_MUST_KRB5 0x08008 | ||
454 | #ifdef CONFIG_CIFS_WEAK_PW_HASH | ||
455 | #define CIFSSEC_MUST_LANMAN 0x10010 | ||
456 | #define CIFSSEC_MUST_PLNTXT 0x20020 | ||
457 | #define CIFSSEC_MASK 0x37037 /* current flags supported if weak */ | ||
458 | #else | ||
459 | #define CIFSSEC_MASK 0x07007 /* flags supported if no weak config */ | ||
460 | #endif /* WEAK_PW_HASH */ | ||
461 | #define CIFSSEC_MUST_SEAL 0x40040 /* not supported yet */ | ||
462 | |||
463 | #define CIFSSEC_DEF CIFSSEC_MAY_SIGN | CIFSSEC_MAY_NTLM | CIFSSEC_MAY_NTLMV2 | ||
464 | #define CIFSSEC_MAX CIFSSEC_MUST_SIGN | CIFSSEC_MUST_NTLMV2 | ||
442 | /* | 465 | /* |
443 | ***************************************************************** | 466 | ***************************************************************** |
444 | * All constants go here | 467 | * All constants go here |
@@ -500,16 +523,16 @@ GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */ | |||
500 | GLOBAL_EXTERN struct list_head GlobalOplock_Q; | 523 | GLOBAL_EXTERN struct list_head GlobalOplock_Q; |
501 | 524 | ||
502 | GLOBAL_EXTERN struct list_head GlobalDnotifyReqList; /* Outstanding dir notify requests */ | 525 | GLOBAL_EXTERN struct list_head GlobalDnotifyReqList; /* Outstanding dir notify requests */ |
503 | GLOBAL_EXTERN struct list_head GlobalDnotifyRsp_Q; /* Dir notify response queue */ | 526 | GLOBAL_EXTERN struct list_head GlobalDnotifyRsp_Q;/* DirNotify response queue */ |
504 | 527 | ||
505 | /* | 528 | /* |
506 | * Global transaction id (XID) information | 529 | * Global transaction id (XID) information |
507 | */ | 530 | */ |
508 | GLOBAL_EXTERN unsigned int GlobalCurrentXid; /* protected by GlobalMid_Sem */ | 531 | GLOBAL_EXTERN unsigned int GlobalCurrentXid; /* protected by GlobalMid_Sem */ |
509 | GLOBAL_EXTERN unsigned int GlobalTotalActiveXid; /* prot by GlobalMid_Sem */ | 532 | GLOBAL_EXTERN unsigned int GlobalTotalActiveXid; /* prot by GlobalMid_Sem */ |
510 | GLOBAL_EXTERN unsigned int GlobalMaxActiveXid; /* prot by GlobalMid_Sem */ | 533 | GLOBAL_EXTERN unsigned int GlobalMaxActiveXid; /* prot by GlobalMid_Sem */ |
511 | GLOBAL_EXTERN spinlock_t GlobalMid_Lock; /* protects above and list operations */ | 534 | GLOBAL_EXTERN spinlock_t GlobalMid_Lock; /* protects above & list operations */ |
512 | /* on midQ entries */ | 535 | /* on midQ entries */ |
513 | GLOBAL_EXTERN char Local_System_Name[15]; | 536 | GLOBAL_EXTERN char Local_System_Name[15]; |
514 | 537 | ||
515 | /* | 538 | /* |
@@ -531,7 +554,7 @@ GLOBAL_EXTERN atomic_t smBufAllocCount; | |||
531 | GLOBAL_EXTERN atomic_t midCount; | 554 | GLOBAL_EXTERN atomic_t midCount; |
532 | 555 | ||
533 | /* Misc globals */ | 556 | /* Misc globals */ |
534 | GLOBAL_EXTERN unsigned int multiuser_mount; /* if enabled allows new sessions | 557 | GLOBAL_EXTERN unsigned int multiuser_mount; /* if enabled allows new sessions |
535 | to be established on existing mount if we | 558 | to be established on existing mount if we |
536 | have the uid/password or Kerberos credential | 559 | have the uid/password or Kerberos credential |
537 | or equivalent for current user */ | 560 | or equivalent for current user */ |
@@ -540,8 +563,8 @@ GLOBAL_EXTERN unsigned int experimEnabled; | |||
540 | GLOBAL_EXTERN unsigned int lookupCacheEnabled; | 563 | GLOBAL_EXTERN unsigned int lookupCacheEnabled; |
541 | GLOBAL_EXTERN unsigned int extended_security; /* if on, session setup sent | 564 | GLOBAL_EXTERN unsigned int extended_security; /* if on, session setup sent |
542 | with more secure ntlmssp2 challenge/resp */ | 565 | with more secure ntlmssp2 challenge/resp */ |
543 | GLOBAL_EXTERN unsigned int ntlmv2_support; /* better optional password hash */ | ||
544 | GLOBAL_EXTERN unsigned int sign_CIFS_PDUs; /* enable smb packet signing */ | 566 | GLOBAL_EXTERN unsigned int sign_CIFS_PDUs; /* enable smb packet signing */ |
567 | GLOBAL_EXTERN unsigned int secFlags; | ||
545 | GLOBAL_EXTERN unsigned int linuxExtEnabled;/*enable Linux/Unix CIFS extensions*/ | 568 | GLOBAL_EXTERN unsigned int linuxExtEnabled;/*enable Linux/Unix CIFS extensions*/ |
546 | GLOBAL_EXTERN unsigned int CIFSMaxBufSize; /* max size not including hdr */ | 569 | GLOBAL_EXTERN unsigned int CIFSMaxBufSize; /* max size not including hdr */ |
547 | GLOBAL_EXTERN unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */ | 570 | GLOBAL_EXTERN unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */ |