summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb
diff options
context:
space:
mode:
Diffstat (limited to 'source4/smb_server/smb')
-rw-r--r--source4/smb_server/smb/negprot.c54
-rw-r--r--source4/smb_server/smb/receive.c6
-rw-r--r--source4/smb_server/smb/service.c2
-rw-r--r--source4/smb_server/smb/sesssetup.c2
-rw-r--r--source4/smb_server/smb/signing.c4
5 files changed, 35 insertions, 33 deletions
diff --git a/source4/smb_server/smb/negprot.c b/source4/smb_server/smb/negprot.c
index f5ae0aa507..a35f86367b 100644
--- a/source4/smb_server/smb/negprot.c
+++ b/source4/smb_server/smb/negprot.c
@@ -91,7 +91,7 @@ this any more it probably doesn't matter
****************************************************************************/
static void reply_coreplus(struct smbsrv_request *req, uint16_t choice)
{
- uint16_t raw = (lp_readraw()?1:0) | (lp_writeraw()?2:0);
+ uint16_t raw = (lp_readraw(global_loadparm)?1:0) | (lp_writeraw(global_loadparm)?2:0);
smbsrv_setup_reply(req, 13, 0);
@@ -122,13 +122,13 @@ static void reply_coreplus(struct smbsrv_request *req, uint16_t choice)
****************************************************************************/
static void reply_lanman1(struct smbsrv_request *req, uint16_t choice)
{
- int raw = (lp_readraw()?1:0) | (lp_writeraw()?2:0);
+ int raw = (lp_readraw(global_loadparm)?1:0) | (lp_writeraw(global_loadparm)?2:0);
int secword=0;
time_t t = req->request_time.tv_sec;
- req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords();
+ req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(global_loadparm);
- if (lp_security() != SEC_SHARE)
+ if (lp_security(global_loadparm) != SEC_SHARE)
secword |= NEGOTIATE_SECURITY_USER_LEVEL;
if (req->smb_conn->negotiate.encrypted_passwords)
@@ -145,7 +145,7 @@ static void reply_lanman1(struct smbsrv_request *req, uint16_t choice)
SSVAL(req->out.vwv, VWV(0), choice);
SSVAL(req->out.vwv, VWV(1), secword);
SSVAL(req->out.vwv, VWV(2), req->smb_conn->negotiate.max_recv);
- SSVAL(req->out.vwv, VWV(3), lp_maxmux());
+ SSVAL(req->out.vwv, VWV(3), lp_maxmux(global_loadparm));
SSVAL(req->out.vwv, VWV(4), 1);
SSVAL(req->out.vwv, VWV(5), raw);
SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id.id);
@@ -180,13 +180,13 @@ static void reply_lanman1(struct smbsrv_request *req, uint16_t choice)
****************************************************************************/
static void reply_lanman2(struct smbsrv_request *req, uint16_t choice)
{
- int raw = (lp_readraw()?1:0) | (lp_writeraw()?2:0);
+ int raw = (lp_readraw(global_loadparm)?1:0) | (lp_writeraw(global_loadparm)?2:0);
int secword=0;
time_t t = req->request_time.tv_sec;
- req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords();
+ req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(global_loadparm);
- if (lp_security() != SEC_SHARE)
+ if (lp_security(global_loadparm) != SEC_SHARE)
secword |= NEGOTIATE_SECURITY_USER_LEVEL;
if (req->smb_conn->negotiate.encrypted_passwords)
@@ -199,7 +199,7 @@ static void reply_lanman2(struct smbsrv_request *req, uint16_t choice)
SSVAL(req->out.vwv, VWV(0), choice);
SSVAL(req->out.vwv, VWV(1), secword);
SSVAL(req->out.vwv, VWV(2), req->smb_conn->negotiate.max_recv);
- SSVAL(req->out.vwv, VWV(3), lp_maxmux());
+ SSVAL(req->out.vwv, VWV(3), lp_maxmux(global_loadparm));
SSVAL(req->out.vwv, VWV(4), 1);
SSVAL(req->out.vwv, VWV(5), raw);
SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id.id);
@@ -214,7 +214,7 @@ static void reply_lanman2(struct smbsrv_request *req, uint16_t choice)
get_challenge(req->smb_conn, req->out.data);
}
- req_push_str(req, NULL, lp_workgroup(), -1, STR_TERMINATE);
+ req_push_str(req, NULL, lp_workgroup(global_loadparm), -1, STR_TERMINATE);
if (req->smb_conn->signing.mandatory_signing) {
smbsrv_terminate_connection(req->smb_conn,
@@ -236,8 +236,8 @@ static void reply_nt1_orig(struct smbsrv_request *req)
req->out.ptr += 8;
SCVAL(req->out.vwv+1, VWV(16), 8);
}
- req_push_str(req, NULL, lp_workgroup(), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
- req_push_str(req, NULL, lp_netbios_name(), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
+ req_push_str(req, NULL, lp_workgroup(global_loadparm), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
+ req_push_str(req, NULL, lp_netbios_name(global_loadparm), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
DEBUG(3,("not using extended security (SPNEGO or NTLMSSP)\n"));
}
@@ -260,24 +260,24 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
CAP_NT_FIND | CAP_LOCK_AND_READ |
CAP_LEVEL_II_OPLOCKS | CAP_NT_SMBS | CAP_RPC_REMOTE_APIS;
- req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords();
+ req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(global_loadparm);
/* do spnego in user level security if the client
supports it and we can do encrypted passwords */
if (req->smb_conn->negotiate.encrypted_passwords &&
- (lp_security() != SEC_SHARE) &&
- lp_use_spnego() &&
+ (lp_security(global_loadparm) != SEC_SHARE) &&
+ lp_use_spnego(global_loadparm) &&
(req->flags2 & FLAGS2_EXTENDED_SECURITY)) {
negotiate_spnego = True;
capabilities |= CAP_EXTENDED_SECURITY;
}
- if (lp_unix_extensions()) {
+ if (lp_unix_extensions(global_loadparm)) {
capabilities |= CAP_UNIX;
}
- if (lp_large_readwrite()) {
+ if (lp_large_readwrite(global_loadparm)) {
capabilities |= CAP_LARGE_READX | CAP_LARGE_WRITEX | CAP_W2K_SMBS;
}
@@ -286,24 +286,24 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
capabilities |= CAP_LARGE_FILES;
}
- if (lp_readraw() && lp_writeraw()) {
+ if (lp_readraw(global_loadparm) && lp_writeraw(global_loadparm)) {
capabilities |= CAP_RAW_MODE;
}
/* allow for disabling unicode */
- if (lp_unicode()) {
+ if (lp_unicode(global_loadparm)) {
capabilities |= CAP_UNICODE;
}
- if (lp_nt_status_support()) {
+ if (lp_nt_status_support(global_loadparm)) {
capabilities |= CAP_STATUS32;
}
- if (lp_host_msdfs()) {
+ if (lp_host_msdfs(global_loadparm)) {
capabilities |= CAP_DFS;
}
- if (lp_security() != SEC_SHARE) {
+ if (lp_security(global_loadparm) != SEC_SHARE) {
secword |= NEGOTIATE_SECURITY_USER_LEVEL;
}
@@ -330,7 +330,7 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
this is the one and only SMB packet that is malformed in
the specification - all the command words after the secword
are offset by 1 byte */
- SSVAL(req->out.vwv+1, VWV(1), lp_maxmux());
+ SSVAL(req->out.vwv+1, VWV(1), lp_maxmux(global_loadparm));
SSVAL(req->out.vwv+1, VWV(2), 1); /* num vcs */
SIVAL(req->out.vwv+1, VWV(3), req->smb_conn->negotiate.max_recv);
SIVAL(req->out.vwv+1, VWV(5), 0x10000); /* raw size. full 64k */
@@ -371,7 +371,7 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
return;
}
- cli_credentials_set_conf(server_credentials);
+ cli_credentials_set_conf(server_credentials, global_loadparm);
nt_status = cli_credentials_set_machine_account(server_credentials);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(10, ("Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(nt_status)));
@@ -517,8 +517,10 @@ void smbsrv_reply_negprot(struct smbsrv_request *req)
for (protocol = 0; supported_protocols[protocol].proto_name; protocol++) {
int i;
- if (supported_protocols[protocol].protocol_level > lp_srv_maxprotocol()) continue;
- if (supported_protocols[protocol].protocol_level < lp_srv_minprotocol()) continue;
+ if (supported_protocols[protocol].protocol_level > lp_srv_maxprotocol(global_loadparm))
+ continue;
+ if (supported_protocols[protocol].protocol_level < lp_srv_minprotocol(global_loadparm))
+ continue;
for (i = 0; i < protos_count; i++) {
if (strcmp(supported_protocols[protocol].proto_name, protos[i]) != 0) continue;
diff --git a/source4/smb_server/smb/receive.c b/source4/smb_server/smb/receive.c
index b29b86e6ea..973b6b993e 100644
--- a/source4/smb_server/smb/receive.c
+++ b/source4/smb_server/smb/receive.c
@@ -652,12 +652,12 @@ NTSTATUS smbsrv_init_smb_connection(struct smbsrv_connection *smb_conn)
/* this is the size that w2k uses, and it appears to be important for
good performance */
- smb_conn->negotiate.max_recv = lp_max_xmit();
+ smb_conn->negotiate.max_recv = lp_max_xmit(global_loadparm);
smb_conn->negotiate.zone_offset = get_time_zone(time(NULL));
- smb_conn->config.security = lp_security();
- smb_conn->config.nt_status_support = lp_nt_status_support();
+ smb_conn->config.security = lp_security(global_loadparm);
+ smb_conn->config.nt_status_support = lp_nt_status_support(global_loadparm);
status = smbsrv_init_sessions(smb_conn, UINT16_MAX);
NT_STATUS_NOT_OK_RETURN(status);
diff --git a/source4/smb_server/smb/service.c b/source4/smb_server/smb/service.c
index 8a99223d8b..558f30307b 100644
--- a/source4/smb_server/smb/service.c
+++ b/source4/smb_server/smb/service.c
@@ -201,7 +201,7 @@ NTSTATUS smbsrv_tcon_backend(struct smbsrv_request *req, union smb_tcon *con)
con->tconx.out.dev_type = talloc_strdup(req, req->tcon->ntvfs->dev_type);
con->tconx.out.fs_type = talloc_strdup(req, req->tcon->ntvfs->fs_type);
con->tconx.out.options = SMB_SUPPORT_SEARCH_BITS | (share_int_option(req->tcon->ntvfs->config, SHARE_CSC_POLICY, SHARE_CSC_POLICY_DEFAULT) << 2);
- if (share_bool_option(req->tcon->ntvfs->config, SHARE_MSDFS_ROOT, SHARE_MSDFS_ROOT_DEFAULT) && lp_host_msdfs()) {
+ if (share_bool_option(req->tcon->ntvfs->config, SHARE_MSDFS_ROOT, SHARE_MSDFS_ROOT_DEFAULT) && lp_host_msdfs(global_loadparm)) {
con->tconx.out.options |= SMB_SHARE_IN_DFS;
}
diff --git a/source4/smb_server/smb/sesssetup.c b/source4/smb_server/smb/sesssetup.c
index b3664ab7fe..29d14016e7 100644
--- a/source4/smb_server/smb/sesssetup.c
+++ b/source4/smb_server/smb/sesssetup.c
@@ -40,7 +40,7 @@ static void sesssetup_common_strings(struct smbsrv_request *req,
{
(*os) = talloc_asprintf(req, "Unix");
(*lanman) = talloc_asprintf(req, "Samba %s", SAMBA_VERSION_STRING);
- (*domain) = talloc_asprintf(req, "%s", lp_workgroup());
+ (*domain) = talloc_asprintf(req, "%s", lp_workgroup(global_loadparm));
}
static void smbsrv_sesssetup_backend_send(struct smbsrv_request *req,
diff --git a/source4/smb_server/smb/signing.c b/source4/smb_server/smb/signing.c
index 120bc01c3e..eaffaa33dd 100644
--- a/source4/smb_server/smb/signing.c
+++ b/source4/smb_server/smb/signing.c
@@ -102,7 +102,7 @@ BOOL smbsrv_init_signing(struct smbsrv_connection *smb_conn)
return False;
}
- switch (lp_server_signing()) {
+ switch (lp_server_signing(global_loadparm)) {
case SMB_SIGNING_OFF:
smb_conn->signing.allow_smb_signing = False;
break;
@@ -114,7 +114,7 @@ BOOL smbsrv_init_signing(struct smbsrv_connection *smb_conn)
smb_conn->signing.mandatory_signing = True;
break;
case SMB_SIGNING_AUTO:
- if (lp_domain_logons()) {
+ if (lp_domain_logons(global_loadparm)) {
smb_conn->signing.allow_smb_signing = True;
} else {
smb_conn->signing.allow_smb_signing = False;