From 4327a3f1ba274d111ec4ffe4989abc879803a714 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 21 Jul 2005 01:43:26 +0000 Subject: r8658: move use of lp_security() and lp_nt_status_support() into the connection structure. This massively reduces the number of lp_*() calls made (This used to be commit b1d577f48d31c0c17ad0b6abd78120087408e58d) --- source4/smb_server/request.c | 2 +- source4/smb_server/smb_server.c | 4 +++- source4/smb_server/smb_server.h | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c index 17c6d0329c..c31fee6d19 100644 --- a/source4/smb_server/request.c +++ b/source4/smb_server/request.c @@ -340,7 +340,7 @@ void req_reply_dos_error(struct smbsrv_request *req, uint8_t eclass, uint16_t ec */ void req_setup_error(struct smbsrv_request *req, NTSTATUS status) { - if (!lp_nt_status_support() || !(req->smb_conn->negotiate.client_caps & CAP_STATUS32)) { + if (!req->smb_conn->config.nt_status_support || !(req->smb_conn->negotiate.client_caps & CAP_STATUS32)) { /* convert to DOS error codes */ uint8_t eclass; uint32_t ecode; diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index 86e31f7fd8..b632bfefd2 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -500,7 +500,7 @@ static void switch_message(int type, struct smbsrv_request *req) chaining) */ /* In share mode security we must ignore the vuid. */ - if (lp_security() == SEC_SHARE) { + if (smb_conn->config.security == SEC_SHARE) { session_tag = UID_FIELD_INVALID; } else { session_tag = SVAL(req->in.hdr,HDR_UID); @@ -770,6 +770,8 @@ static void smbsrv_accept(struct stream_connection *conn) smb_conn->connection = conn; smb_conn->processing = False; + smb_conn->config.security = lp_security(); + smb_conn->config.nt_status_support = lp_nt_status_support(); conn->private = smb_conn; diff --git a/source4/smb_server/smb_server.h b/source4/smb_server/smb_server.h index 819a70cbae..46e480e77c 100644 --- a/source4/smb_server/smb_server.h +++ b/source4/smb_server/smb_server.h @@ -264,4 +264,10 @@ struct smbsrv_connection { } *trans_partial; BOOL processing; + + /* configuration parameters */ + struct { + enum security_types security; + BOOL nt_status_support; + } config; }; -- cgit