diff options
| -rw-r--r-- | fs/cifs/cifsencrypt.c | 14 | ||||
| -rw-r--r-- | fs/cifs/cifsglob.h | 2 | ||||
| -rw-r--r-- | fs/cifs/connect.c | 7 |
3 files changed, 18 insertions, 5 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 5eb04129f938..66bd7fa9b7a6 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c | |||
| @@ -699,11 +699,15 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp) | |||
| 699 | 699 | ||
| 700 | if (ses->server->negflavor == CIFS_NEGFLAVOR_EXTENDED) { | 700 | if (ses->server->negflavor == CIFS_NEGFLAVOR_EXTENDED) { |
| 701 | if (!ses->domainName) { | 701 | if (!ses->domainName) { |
| 702 | rc = find_domain_name(ses, nls_cp); | 702 | if (ses->domainAuto) { |
| 703 | if (rc) { | 703 | rc = find_domain_name(ses, nls_cp); |
| 704 | cifs_dbg(VFS, "error %d finding domain name\n", | 704 | if (rc) { |
| 705 | rc); | 705 | cifs_dbg(VFS, "error %d finding domain name\n", |
| 706 | goto setup_ntlmv2_rsp_ret; | 706 | rc); |
| 707 | goto setup_ntlmv2_rsp_ret; | ||
| 708 | } | ||
| 709 | } else { | ||
| 710 | ses->domainName = kstrdup("", GFP_KERNEL); | ||
| 707 | } | 711 | } |
| 708 | } | 712 | } |
| 709 | } else { | 713 | } else { |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 59ab5a29d256..7ea8a3393936 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
| @@ -514,6 +514,7 @@ struct smb_vol { | |||
| 514 | bool persistent:1; | 514 | bool persistent:1; |
| 515 | bool nopersistent:1; | 515 | bool nopersistent:1; |
| 516 | bool resilient:1; /* noresilient not required since not fored for CA */ | 516 | bool resilient:1; /* noresilient not required since not fored for CA */ |
| 517 | bool domainauto:1; | ||
| 517 | unsigned int rsize; | 518 | unsigned int rsize; |
| 518 | unsigned int wsize; | 519 | unsigned int wsize; |
| 519 | bool sockopt_tcp_nodelay:1; | 520 | bool sockopt_tcp_nodelay:1; |
| @@ -830,6 +831,7 @@ struct cifs_ses { | |||
| 830 | enum securityEnum sectype; /* what security flavor was specified? */ | 831 | enum securityEnum sectype; /* what security flavor was specified? */ |
| 831 | bool sign; /* is signing required? */ | 832 | bool sign; /* is signing required? */ |
| 832 | bool need_reconnect:1; /* connection reset, uid now invalid */ | 833 | bool need_reconnect:1; /* connection reset, uid now invalid */ |
| 834 | bool domainAuto:1; | ||
| 833 | #ifdef CONFIG_CIFS_SMB2 | 835 | #ifdef CONFIG_CIFS_SMB2 |
| 834 | __u16 session_flags; | 836 | __u16 session_flags; |
| 835 | __u8 smb3signingkey[SMB3_SIGN_KEY_SIZE]; | 837 | __u8 smb3signingkey[SMB3_SIGN_KEY_SIZE]; |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 5aaf7b1359a5..1847aa8390ff 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -91,6 +91,7 @@ enum { | |||
| 91 | Opt_multiuser, Opt_sloppy, Opt_nosharesock, | 91 | Opt_multiuser, Opt_sloppy, Opt_nosharesock, |
| 92 | Opt_persistent, Opt_nopersistent, | 92 | Opt_persistent, Opt_nopersistent, |
| 93 | Opt_resilient, Opt_noresilient, | 93 | Opt_resilient, Opt_noresilient, |
| 94 | Opt_domainauto, | ||
| 94 | 95 | ||
| 95 | /* Mount options which take numeric value */ | 96 | /* Mount options which take numeric value */ |
| 96 | Opt_backupuid, Opt_backupgid, Opt_uid, | 97 | Opt_backupuid, Opt_backupgid, Opt_uid, |
| @@ -180,6 +181,7 @@ static const match_table_t cifs_mount_option_tokens = { | |||
| 180 | { Opt_nopersistent, "nopersistenthandles"}, | 181 | { Opt_nopersistent, "nopersistenthandles"}, |
| 181 | { Opt_resilient, "resilienthandles"}, | 182 | { Opt_resilient, "resilienthandles"}, |
| 182 | { Opt_noresilient, "noresilienthandles"}, | 183 | { Opt_noresilient, "noresilienthandles"}, |
| 184 | { Opt_domainauto, "domainauto"}, | ||
| 183 | 185 | ||
| 184 | { Opt_backupuid, "backupuid=%s" }, | 186 | { Opt_backupuid, "backupuid=%s" }, |
| 185 | { Opt_backupgid, "backupgid=%s" }, | 187 | { Opt_backupgid, "backupgid=%s" }, |
| @@ -1504,6 +1506,9 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
| 1504 | case Opt_noresilient: | 1506 | case Opt_noresilient: |
| 1505 | vol->resilient = false; /* already the default */ | 1507 | vol->resilient = false; /* already the default */ |
| 1506 | break; | 1508 | break; |
| 1509 | case Opt_domainauto: | ||
| 1510 | vol->domainauto = true; | ||
| 1511 | break; | ||
| 1507 | 1512 | ||
| 1508 | /* Numeric Values */ | 1513 | /* Numeric Values */ |
| 1509 | case Opt_backupuid: | 1514 | case Opt_backupuid: |
| @@ -2578,6 +2583,8 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) | |||
| 2578 | if (!ses->domainName) | 2583 | if (!ses->domainName) |
| 2579 | goto get_ses_fail; | 2584 | goto get_ses_fail; |
| 2580 | } | 2585 | } |
| 2586 | if (volume_info->domainauto) | ||
| 2587 | ses->domainAuto = volume_info->domainauto; | ||
| 2581 | ses->cred_uid = volume_info->cred_uid; | 2588 | ses->cred_uid = volume_info->cred_uid; |
| 2582 | ses->linux_uid = volume_info->linux_uid; | 2589 | ses->linux_uid = volume_info->linux_uid; |
| 2583 | 2590 | ||
