summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-05-20 13:07:17 +0200
committerVolker Lendecke <vlendec@samba.org>2011-05-20 15:06:03 +0200
commit8a2eff871f990aaaf1e11b333035097f5e6d3268 (patch)
tree9871b141a1689923c868b1175e6c3d41f70bbd09 /source3/smbd
parentaf9afe9f4fc21b9c800bb14c65cbfecb155d3519 (diff)
downloadsamba-8a2eff871f990aaaf1e11b333035097f5e6d3268.tar.gz
samba-8a2eff871f990aaaf1e11b333035097f5e6d3268.tar.bz2
samba-8a2eff871f990aaaf1e11b333035097f5e6d3268.zip
s3: Fork the echo handler only after SMB1 negprot is done
This enables activating the echo responder also if SMB2 is enabled, albeit it will only be used for SMB1 at this moment. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri May 20 15:06:03 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/negprot.c5
-rw-r--r--source3/smbd/process.c9
-rw-r--r--source3/smbd/proto.h1
3 files changed, 8 insertions, 7 deletions
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 9f201b8bee..aa10563aae 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -716,6 +716,11 @@ void reply_negprot(struct smb_request *req)
}
TALLOC_FREE(cliprotos);
+
+ if (lp_async_smb_echo_handler() && !fork_echo_handler(sconn)) {
+ exit_server("Failed to fork echo handler");
+ }
+
END_PROFILE(SMBnegprot);
return;
}
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 5f9845cba0..7f04a7bcb6 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2798,7 +2798,7 @@ static void smbd_echo_loop(struct smbd_server_connection *sconn,
/*
* Handle SMBecho requests in a forked child process
*/
-static bool fork_echo_handler(struct smbd_server_connection *sconn)
+bool fork_echo_handler(struct smbd_server_connection *sconn)
{
int listener_pipe[2];
int res;
@@ -2912,8 +2912,7 @@ void smbd_process(struct smbd_server_connection *sconn)
const char *remaddr = NULL;
int ret;
- if (lp_maxprotocol() == PROTOCOL_SMB2 &&
- !lp_async_smb_echo_handler()) {
+ if (lp_maxprotocol() == PROTOCOL_SMB2) {
/*
* We're not making the decision here,
* we're just allowing the client
@@ -3034,10 +3033,6 @@ void smbd_process(struct smbd_server_connection *sconn)
exit_server("Failed to init smb_signing");
}
- if (lp_async_smb_echo_handler() && !fork_echo_handler(sconn)) {
- exit_server("Failed to fork echo handler");
- }
-
/* Setup oplocks */
if (!init_oplocks(sconn->msg_ctx))
exit_server("Failed to init oplocks");
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 1f2b1a9cff..589d45dade 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -750,6 +750,7 @@ size_t req_wct_ofs(struct smb_request *req);
void chain_reply(struct smb_request *req);
bool req_is_in_chain(struct smb_request *req);
void smbd_process(struct smbd_server_connection *sconn);
+bool fork_echo_handler(struct smbd_server_connection *sconn);
/* The following definitions come from smbd/quotas.c */