From 6b266b85cf34145ac1f03d8f787b81121e4ec92b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Jul 2010 14:32:42 +1000 Subject: s4-loadparm: 2nd half of lp_ to lpcfg_ conversion this converts all callers that use the Samba4 loadparm lp_ calling convention to use the lpcfg_ prefix. Signed-off-by: Andrew Bartlett --- source4/smb_server/smb/negprot.c | 52 +++++++++++++++++++------------------- source4/smb_server/smb/receive.c | 6 ++--- source4/smb_server/smb/service.c | 2 +- source4/smb_server/smb/sesssetup.c | 2 +- source4/smb_server/smb/signing.c | 4 +-- source4/smb_server/smb/trans2.c | 18 ++++++------- 6 files changed, 42 insertions(+), 42 deletions(-) (limited to 'source4/smb_server/smb') diff --git a/source4/smb_server/smb/negprot.c b/source4/smb_server/smb/negprot.c index fe6cd68f6e..656da4df20 100644 --- a/source4/smb_server/smb/negprot.c +++ b/source4/smb_server/smb/negprot.c @@ -88,7 +88,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(req->smb_conn->lp_ctx)?1:0) | (lp_writeraw(req->smb_conn->lp_ctx)?2:0); + uint16_t raw = (lpcfg_readraw(req->smb_conn->lp_ctx)?1:0) | (lpcfg_writeraw(req->smb_conn->lp_ctx)?2:0); smbsrv_setup_reply(req, 13, 0); @@ -119,13 +119,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(req->smb_conn->lp_ctx)?1:0) | (lp_writeraw(req->smb_conn->lp_ctx)?2:0); + int raw = (lpcfg_readraw(req->smb_conn->lp_ctx)?1:0) | (lpcfg_writeraw(req->smb_conn->lp_ctx)?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->lp_ctx); + req->smb_conn->negotiate.encrypted_passwords = lpcfg_encrypted_passwords(req->smb_conn->lp_ctx); - if (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE) + if (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE) secword |= NEGOTIATE_SECURITY_USER_LEVEL; if (req->smb_conn->negotiate.encrypted_passwords) @@ -142,7 +142,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(req->smb_conn->lp_ctx)); + SSVAL(req->out.vwv, VWV(3), lpcfg_maxmux(req->smb_conn->lp_ctx)); 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); @@ -177,13 +177,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(req->smb_conn->lp_ctx)?1:0) | (lp_writeraw(req->smb_conn->lp_ctx)?2:0); + int raw = (lpcfg_readraw(req->smb_conn->lp_ctx)?1:0) | (lpcfg_writeraw(req->smb_conn->lp_ctx)?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->lp_ctx); + req->smb_conn->negotiate.encrypted_passwords = lpcfg_encrypted_passwords(req->smb_conn->lp_ctx); - if (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE) + if (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE) secword |= NEGOTIATE_SECURITY_USER_LEVEL; if (req->smb_conn->negotiate.encrypted_passwords) @@ -196,7 +196,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(req->smb_conn->lp_ctx)); + SSVAL(req->out.vwv, VWV(3), lpcfg_maxmux(req->smb_conn->lp_ctx)); 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); @@ -211,7 +211,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(req->smb_conn->lp_ctx), -1, STR_TERMINATE); + req_push_str(req, NULL, lpcfg_workgroup(req->smb_conn->lp_ctx), -1, STR_TERMINATE); if (req->smb_conn->signing.mandatory_signing) { smbsrv_terminate_connection(req->smb_conn, @@ -233,8 +233,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(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN); - req_push_str(req, NULL, lp_netbios_name(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN); + req_push_str(req, NULL, lpcfg_workgroup(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN); + req_push_str(req, NULL, lpcfg_netbios_name(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN); DEBUG(3,("not using extended security (SPNEGO or NTLMSSP)\n")); } @@ -257,24 +257,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->lp_ctx); + req->smb_conn->negotiate.encrypted_passwords = lpcfg_encrypted_passwords(req->smb_conn->lp_ctx); /* 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(req->smb_conn->lp_ctx) != SEC_SHARE) && - lp_use_spnego(req->smb_conn->lp_ctx) && + (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE) && + lpcfg_use_spnego(req->smb_conn->lp_ctx) && (req->flags2 & FLAGS2_EXTENDED_SECURITY)) { negotiate_spnego = true; capabilities |= CAP_EXTENDED_SECURITY; } - if (lp_unix_extensions(req->smb_conn->lp_ctx)) { + if (lpcfg_unix_extensions(req->smb_conn->lp_ctx)) { capabilities |= CAP_UNIX; } - if (lp_large_readwrite(req->smb_conn->lp_ctx)) { + if (lpcfg_large_readwrite(req->smb_conn->lp_ctx)) { capabilities |= CAP_LARGE_READX | CAP_LARGE_WRITEX | CAP_W2K_SMBS; } @@ -283,25 +283,25 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice) capabilities |= CAP_LARGE_FILES; } - if (lp_readraw(req->smb_conn->lp_ctx) && - lp_writeraw(req->smb_conn->lp_ctx)) { + if (lpcfg_readraw(req->smb_conn->lp_ctx) && + lpcfg_writeraw(req->smb_conn->lp_ctx)) { capabilities |= CAP_RAW_MODE; } /* allow for disabling unicode */ - if (lp_unicode(req->smb_conn->lp_ctx)) { + if (lpcfg_unicode(req->smb_conn->lp_ctx)) { capabilities |= CAP_UNICODE; } - if (lp_nt_status_support(req->smb_conn->lp_ctx)) { + if (lpcfg_nt_status_support(req->smb_conn->lp_ctx)) { capabilities |= CAP_STATUS32; } - if (lp_host_msdfs(req->smb_conn->lp_ctx)) { + if (lpcfg_host_msdfs(req->smb_conn->lp_ctx)) { capabilities |= CAP_DFS; } - if (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE) { + if (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE) { secword |= NEGOTIATE_SECURITY_USER_LEVEL; } @@ -328,7 +328,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(req->smb_conn->lp_ctx)); + SSVAL(req->out.vwv+1, VWV(1), lpcfg_maxmux(req->smb_conn->lp_ctx)); 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 */ @@ -518,9 +518,9 @@ 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(req->smb_conn->lp_ctx)) + if (supported_protocols[protocol].protocol_level > lpcfg_srv_maxprotocol(req->smb_conn->lp_ctx)) continue; - if (supported_protocols[protocol].protocol_level < lp_srv_minprotocol(req->smb_conn->lp_ctx)) + if (supported_protocols[protocol].protocol_level < lpcfg_srv_minprotocol(req->smb_conn->lp_ctx)) continue; for (i = 0; i < protos_count; i++) { diff --git a/source4/smb_server/smb/receive.c b/source4/smb_server/smb/receive.c index f58071bf55..c2503efabc 100644 --- a/source4/smb_server/smb/receive.c +++ b/source4/smb_server/smb/receive.c @@ -663,12 +663,12 @@ NTSTATUS smbsrv_init_smb_connection(struct smbsrv_connection *smb_conn, struct l /* this is the size that w2k uses, and it appears to be important for good performance */ - smb_conn->negotiate.max_recv = lp_max_xmit(lp_ctx); + smb_conn->negotiate.max_recv = lpcfg_max_xmit(lp_ctx); smb_conn->negotiate.zone_offset = get_time_zone(time(NULL)); - smb_conn->config.security = lp_security(lp_ctx); - smb_conn->config.nt_status_support = lp_nt_status_support(lp_ctx); + smb_conn->config.security = lpcfg_security(lp_ctx); + smb_conn->config.nt_status_support = lpcfg_nt_status_support(lp_ctx); 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 4d5b6ff462..7be21c14bd 100644 --- a/source4/smb_server/smb/service.c +++ b/source4/smb_server/smb/service.c @@ -191,7 +191,7 @@ NTSTATUS smbsrv_tcon_backend(struct smbsrv_request *req, union smb_tcon *con) con->tconx.out.tid = req->tcon->tid; 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(req->smb_conn->lp_ctx)) { + if (share_bool_option(req->tcon->ntvfs->config, SHARE_MSDFS_ROOT, SHARE_MSDFS_ROOT_DEFAULT) && lpcfg_host_msdfs(req->smb_conn->lp_ctx)) { 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 b61fce0887..7372347e9a 100644 --- a/source4/smb_server/smb/sesssetup.c +++ b/source4/smb_server/smb/sesssetup.c @@ -46,7 +46,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(req->smb_conn->lp_ctx)); + lpcfg_workgroup(req->smb_conn->lp_ctx)); } 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 0b5cf56fdb..94ea74681c 100644 --- a/source4/smb_server/smb/signing.c +++ b/source4/smb_server/smb/signing.c @@ -82,7 +82,7 @@ bool smbsrv_init_signing(struct smbsrv_connection *smb_conn) return false; } - switch (lp_server_signing(smb_conn->lp_ctx)) { + switch (lpcfg_server_signing(smb_conn->lp_ctx)) { case SMB_SIGNING_OFF: smb_conn->signing.allow_smb_signing = false; break; @@ -99,7 +99,7 @@ bool smbsrv_init_signing(struct smbsrv_connection *smb_conn) * attacks on communications between us and the * clients */ - if (lp_server_role(smb_conn->lp_ctx) == ROLE_DOMAIN_CONTROLLER) { + if (lpcfg_server_role(smb_conn->lp_ctx) == ROLE_DOMAIN_CONTROLLER) { smb_conn->signing.allow_smb_signing = true; smb_conn->signing.mandatory_signing = true; } else { diff --git a/source4/smb_server/smb/trans2.c b/source4/smb_server/smb/trans2.c index 42a217d19d..38381fd2c1 100644 --- a/source4/smb_server/smb/trans2.c +++ b/source4/smb_server/smb/trans2.c @@ -1215,8 +1215,8 @@ static NTSTATUS dodomain_referral(TALLOC_CTX *ctx, DATA_BLOB outblob; enum ndr_err_code ndr_err; NTSTATUS status; - const char *dns_domain = lp_dnsdomain(lp_ctx); - const char *netbios_domain = lp_workgroup(lp_ctx); + const char *dns_domain = lpcfg_dnsdomain(lp_ctx); + const char *netbios_domain = lpcfg_workgroup(lp_ctx); struct dfs_referral_resp resp; struct dfs_referral_type *tab; struct dfs_referral_type *referral; @@ -1226,7 +1226,7 @@ static NTSTATUS dodomain_referral(TALLOC_CTX *ctx, uint32_t current_pos = 0; TALLOC_CTX *context; - if (lp_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) { + if (lpcfg_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) { DEBUG(10 ,("Received a domain referral request on a non DC\n")); return NT_STATUS_INVALID_PARAMETER; } @@ -1372,8 +1372,8 @@ static NTSTATUS dodc_or_sysvol_referral(TALLOC_CTX *ctx, unsigned int num_domain = 1; enum ndr_err_code ndr_err; const char *requesteddomain; - const char *realm = lp_realm(lp_ctx); - const char *domain = lp_workgroup(lp_ctx); + const char *realm = lpcfg_realm(lp_ctx); + const char *domain = lpcfg_workgroup(lp_ctx); const char *site_name = NULL; /* Name of the site where the client is */ char *share = NULL; bool found = false; @@ -1387,7 +1387,7 @@ static NTSTATUS dodc_or_sysvol_referral(TALLOC_CTX *ctx, char *client_addr = NULL; TALLOC_CTX *context; - if (lp_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) { + if (lpcfg_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) { return NT_STATUS_INVALID_PARAMETER; } @@ -1613,7 +1613,7 @@ static NTSTATUS trans2_getdfsreferral(struct smbsrv_request *req, NTSTATUS status; lp_ctx = req->tcon->ntvfs->lp_ctx; - if (!lp_host_msdfs(lp_ctx)) { + if (!lpcfg_host_msdfs(lp_ctx)) { return NT_STATUS_NOT_IMPLEMENTED; } @@ -1651,8 +1651,8 @@ static NTSTATUS trans2_getdfsreferral(struct smbsrv_request *req, return dodomain_referral(op, &dfsreq, ldb, trans, lp_ctx); } - realm = lp_realm(lp_ctx); - nbname = lp_netbios_name(lp_ctx); + realm = lpcfg_realm(lp_ctx); + nbname = lpcfg_netbios_name(lp_ctx); fqdn = talloc_asprintf(context, "%s.%s", nbname, realm); if ((strncasecmp(requestedname+1, nbname, strlen(nbname)) == 0) || -- cgit