diff options
author | Volker Lendecke <vl@samba.org> | 2010-08-15 16:13:00 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-08-18 11:18:21 +0200 |
commit | ac7b63384d3f8afdb768f95e7744380f4df07d76 (patch) | |
tree | a568644b63e97912f17e010c83065c1eb38ab909 /source3 | |
parent | 59289d4fa9e5f6f2ff6abd13e8f07ca6ee3e2a3c (diff) | |
download | samba-ac7b63384d3f8afdb768f95e7744380f4df07d76.tar.gz samba-ac7b63384d3f8afdb768f95e7744380f4df07d76.tar.bz2 samba-ac7b63384d3f8afdb768f95e7744380f4df07d76.zip |
s3: Lift smbd_server_fd from reload_services()
Diffstat (limited to 'source3')
-rw-r--r-- | source3/auth/auth_ntlmssp.c | 2 | ||||
-rw-r--r-- | source3/include/proto.h | 3 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 4 | ||||
-rw-r--r-- | source3/smbd/negprot.c | 4 | ||||
-rw-r--r-- | source3/smbd/process.c | 6 | ||||
-rw-r--r-- | source3/smbd/reply.c | 2 | ||||
-rw-r--r-- | source3/smbd/server.c | 5 | ||||
-rw-r--r-- | source3/smbd/server_reload.c | 11 | ||||
-rw-r--r-- | source3/smbd/sesssetup.c | 10 | ||||
-rw-r--r-- | source3/smbd/smb2_sesssetup.c | 2 | ||||
-rw-r--r-- | source3/torture/vfstest.c | 2 |
11 files changed, 27 insertions, 24 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index a910201fcf..d533ac93f5 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -122,7 +122,7 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state, /* sub_set_smb_name checks for weird internally */ sub_set_smb_name(auth_ntlmssp_state->ntlmssp_state->user); - reload_services(smbd_messaging_context(), True); + reload_services(smbd_messaging_context(), smbd_server_fd(), True); nt_status = make_user_info_map(&user_info, auth_ntlmssp_state->ntlmssp_state->user, diff --git a/source3/include/proto.h b/source3/include/proto.h index fe9dec41db..9d4b82b063 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5786,7 +5786,8 @@ struct event_context *smbd_event_context(void); struct messaging_context *smbd_messaging_context(void); struct memcache *smbd_memcache(void); void reload_printers(struct messaging_context *msg_ctx); -bool reload_services(struct messaging_context *msg_ctx, bool test); +bool reload_services(struct messaging_context *msg_ctx, int smb_sock, + bool test); void exit_server(const char *const explanation); void exit_server_cleanly(const char *const explanation); void exit_server_fault(void); diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 893ddce531..4854488ba6 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -341,7 +341,7 @@ static WERROR delete_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, /* go ahead and re-read the services immediately */ become_root(); - reload_services(msg_ctx, false); + reload_services(msg_ctx, smbd_server_fd(), false); unbecome_root(); if ( lp_servicenumber( sharename ) > 0 ) @@ -5724,7 +5724,7 @@ static bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, /* reload our services immediately */ become_root(); - reload_services(msg_ctx, false); + reload_services(msg_ctx, smbd_server_fd(), false); unbecome_root(); numlines = 0; diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c index 9151d1baf1..2908c2613e 100644 --- a/source3/smbd/negprot.c +++ b/source3/smbd/negprot.c @@ -667,7 +667,7 @@ void reply_negprot(struct smb_request *req) } /* possibly reload - change of architecture */ - reload_services(sconn->msg_ctx, True); + reload_services(sconn->msg_ctx, sconn->sock, True); /* moved from the netbios session setup code since we don't have that when the client connects to port 445. Of course there is a small @@ -693,7 +693,7 @@ void reply_negprot(struct smb_request *req) if(choice != -1) { fstrcpy(remote_proto,supported_protocols[protocol].short_name); - reload_services(sconn->msg_ctx, True); + reload_services(sconn->msg_ctx, sconn->sock, True); supported_protocols[protocol].proto_reply_fn(req, choice); DEBUG(3,("Selected protocol %s\n",supported_protocols[protocol].proto_name)); } else { diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 07b53a254d..d6acc829cf 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -928,7 +928,7 @@ static void smbd_sig_hup_handler(struct tevent_context *ev, private_data, struct messaging_context); change_to_root_user(); DEBUG(1,("Reloading services after SIGHUP\n")); - reload_services(msg_ctx, False); + reload_services(msg_ctx, smbd_server_fd(), False); } void smbd_setup_sig_hup_handler(struct tevent_context *ev, @@ -2237,7 +2237,7 @@ static void check_reload(struct messaging_context *msg_ctx, time_t t) } if (t >= last_smb_conf_reload_time+SMBD_RELOAD_CHECK) { - reload_services(msg_ctx, True); + reload_services(msg_ctx, smbd_server_fd(), True); last_smb_conf_reload_time = t; } @@ -2973,7 +2973,7 @@ void smbd_process(struct smbd_server_connection *sconn) /* this is needed so that we get decent entries in smbstatus for port 445 connects */ set_remote_machine_name(remaddr, false); - reload_services(sconn->msg_ctx, true); + reload_services(sconn->msg_ctx, sconn->sock, true); /* * Before the first packet, check the global hosts allow/ hosts deny diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 97269df7c1..583c8960f9 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -548,7 +548,7 @@ void reply_special(struct smbd_server_connection *sconn, char *inbuf) add_session_user(sconn, get_remote_machine_name()); } - reload_services(sconn->msg_ctx, True); + reload_services(sconn->msg_ctx, sconn->sock, True); reopen_logs(); sconn->nbt.got_session = true; diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 7b9075338e..8cb2f23e12 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -81,7 +81,7 @@ static void smb_conf_updated(struct messaging_context *msg, DEBUG(10,("smb_conf_updated: Got message saying smb.conf was " "updated. Reloading.\n")); change_to_root_user(); - reload_services(msg, False); + reload_services(msg, smbd_server_fd(), False); } @@ -982,7 +982,8 @@ extern void build_options(bool screen); * Reloading of the printers will not work here as we don't have a * server info and rpc services set up. It will be called later. */ - if (!reload_services(smbd_messaging_context(), False)) { + if (!reload_services(smbd_messaging_context(), smbd_server_fd(), + False)) { exit(1); } diff --git a/source3/smbd/server_reload.c b/source3/smbd/server_reload.c index e1d563d09d..38d1f3a354 100644 --- a/source3/smbd/server_reload.c +++ b/source3/smbd/server_reload.c @@ -88,7 +88,8 @@ void reload_printers(struct messaging_context *msg_ctx) Reload the services file. **************************************************************************/ -bool reload_services(struct messaging_context *msg_ctx, bool test) +bool reload_services(struct messaging_context *msg_ctx, int smb_sock, + bool test) { bool ret; @@ -114,15 +115,15 @@ bool reload_services(struct messaging_context *msg_ctx, bool test) /* perhaps the config filename is now set */ if (!test) - reload_services(msg_ctx, True); + reload_services(msg_ctx, smb_sock, True); reopen_logs(); load_interfaces(); - if (smbd_server_fd() != -1) { - set_socket_options(smbd_server_fd(),"SO_KEEPALIVE"); - set_socket_options(smbd_server_fd(), lp_socket_options()); + if (smb_sock != -1) { + set_socket_options(smb_sock,"SO_KEEPALIVE"); + set_socket_options(smb_sock, lp_socket_options()); } mangle_reset_cache(); diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index a80e4f0b8c..a476ed42ae 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -468,7 +468,7 @@ static void reply_spnego_kerberos(struct smb_request *req, /* setup the string used by %U */ sub_set_smb_name( real_username ); - reload_services(sconn->msg_ctx, True); + reload_services(sconn->msg_ctx, sconn->sock, True); if ( map_domainuser_to_guest ) { make_server_info_guest(NULL, &server_info); @@ -589,7 +589,7 @@ static void reply_spnego_kerberos(struct smb_request *req, ret = NT_STATUS_LOGON_FAILURE; } else { /* current_user_info is changed on new vuid */ - reload_services(sconn->msg_ctx, True); + reload_services(sconn->msg_ctx, sconn->sock, True); SSVAL(req->outbuf, smb_vwv3, 0); @@ -683,7 +683,7 @@ static void reply_spnego_ntlmssp(struct smb_request *req, } /* current_user_info is changed on new vuid */ - reload_services(sconn->msg_ctx, True); + reload_services(sconn->msg_ctx, sconn->sock, True); SSVAL(req->outbuf, smb_vwv3, 0); @@ -1707,7 +1707,7 @@ void reply_sesssetup_and_X(struct smb_request *req) sub_set_smb_name(sub_user); - reload_services(sconn->msg_ctx, True); + reload_services(sconn->msg_ctx, sconn->sock, True); if (lp_security() == SEC_SHARE) { /* In share level we should ignore any passwords */ @@ -1860,7 +1860,7 @@ void reply_sesssetup_and_X(struct smb_request *req) } /* current_user_info is changed on new vuid */ - reload_services(sconn->msg_ctx, True); + reload_services(sconn->msg_ctx, sconn->sock, True); } data_blob_free(&nt_resp); diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index 8fc52b2599..df00b4f654 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -327,7 +327,7 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session, /* setup the string used by %U */ sub_set_smb_name(real_username); - reload_services(smb2req->sconn->msg_ctx, true); + reload_services(smb2req->sconn->msg_ctx, smb2req->sconn->sock, true); if (map_domainuser_to_guest) { make_server_info_guest(session, &session->server_info); diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c index cac4621dd5..4d537dadcf 100644 --- a/source3/torture/vfstest.c +++ b/source3/torture/vfstest.c @@ -463,7 +463,7 @@ int main(int argc, char *argv[]) poptFreeContext(pc); /* TODO: check output */ - reload_services(smbd_messaging_context(), False); + reload_services(smbd_messaging_context(), smbd_server_fd(), False); /* the following functions are part of the Samba debugging facilities. See lib/debug.c */ |