summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-15 16:13:00 +0200
committerVolker Lendecke <vl@samba.org>2010-08-18 11:18:21 +0200
commitac7b63384d3f8afdb768f95e7744380f4df07d76 (patch)
treea568644b63e97912f17e010c83065c1eb38ab909 /source3/smbd
parent59289d4fa9e5f6f2ff6abd13e8f07ca6ee3e2a3c (diff)
downloadsamba-ac7b63384d3f8afdb768f95e7744380f4df07d76.tar.gz
samba-ac7b63384d3f8afdb768f95e7744380f4df07d76.tar.bz2
samba-ac7b63384d3f8afdb768f95e7744380f4df07d76.zip
s3: Lift smbd_server_fd from reload_services()
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/negprot.c4
-rw-r--r--source3/smbd/process.c6
-rw-r--r--source3/smbd/reply.c2
-rw-r--r--source3/smbd/server.c5
-rw-r--r--source3/smbd/server_reload.c11
-rw-r--r--source3/smbd/sesssetup.c10
-rw-r--r--source3/smbd/smb2_sesssetup.c2
7 files changed, 21 insertions, 19 deletions
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);