summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-07-04 19:56:51 +0200
committerVolker Lendecke <vl@samba.org>2010-07-05 11:06:30 +0200
commit9b0fbcf35ad94e984c085eb209034325396db712 (patch)
treee676c80965d1cab2be84f22de85999786c240683 /source3
parent0ea7aed7461767fbdce90ea30dde33816bc41d5e (diff)
downloadsamba-9b0fbcf35ad94e984c085eb209034325396db712.tar.gz
samba-9b0fbcf35ad94e984c085eb209034325396db712.tar.bz2
samba-9b0fbcf35ad94e984c085eb209034325396db712.zip
s3: Remove smbd_messaging_context() from shutdown_other_smbds()
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/sesssetup.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 1482c23a53..b296a1f47c 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -1349,11 +1349,16 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req)
a new session setup with VC==0 is ignored.
****************************************************************************/
+struct shutdown_state {
+ const char *ip;
+ struct messaging_context *msg_ctx;
+};
+
static int shutdown_other_smbds(const struct connections_key *key,
const struct connections_data *crec,
void *private_data)
{
- const char *ip = (const char *)private_data;
+ struct shutdown_state *state = (struct shutdown_state *)private_data;
if (!process_exists(crec->pid)) {
return 0;
@@ -1363,22 +1368,21 @@ static int shutdown_other_smbds(const struct connections_key *key,
return 0;
}
- if (strcmp(ip, crec->addr) != 0) {
+ if (strcmp(state->ip, crec->addr) != 0) {
return 0;
}
DEBUG(0,("shutdown_other_smbds: shutting down pid %u "
- "(IP %s)\n", (unsigned int)procid_to_pid(&crec->pid), ip));
+ "(IP %s)\n", (unsigned int)procid_to_pid(&crec->pid),
+ state->ip));
- messaging_send(smbd_messaging_context(), crec->pid, MSG_SHUTDOWN,
+ messaging_send(state->msg_ctx, crec->pid, MSG_SHUTDOWN,
&data_blob_null);
return 0;
}
-static void setup_new_vc_session(void)
+static void setup_new_vc_session(struct messaging_context *msg_ctx)
{
- char addr[INET6_ADDRSTRLEN];
-
DEBUG(2,("setup_new_vc_session: New VC == 0, if NT4.x "
"compatible we would close all old resources.\n"));
#if 0
@@ -1386,9 +1390,12 @@ static void setup_new_vc_session(void)
invalidate_all_vuids();
#endif
if (lp_reset_on_zero_vc()) {
- connections_forall_read(shutdown_other_smbds,
- CONST_DISCARD(void *,
- client_addr(get_client_fd(),addr,sizeof(addr))));
+ char addr[INET6_ADDRSTRLEN];
+ struct shutdown_state state;
+
+ state.ip = client_addr(get_client_fd(),addr,sizeof(addr));
+ state.msg_ctx = msg_ctx;
+ connections_forall_read(shutdown_other_smbds, &state);
}
}
@@ -1443,7 +1450,7 @@ void reply_sesssetup_and_X(struct smb_request *req)
}
if (SVAL(req->vwv+4, 0) == 0) {
- setup_new_vc_session();
+ setup_new_vc_session(req->sconn->msg_ctx);
}
reply_sesssetup_and_X_spnego(req);
@@ -1640,7 +1647,7 @@ void reply_sesssetup_and_X(struct smb_request *req)
}
if (SVAL(req->vwv+4, 0) == 0) {
- setup_new_vc_session();
+ setup_new_vc_session(req->sconn->msg_ctx);
}
DEBUG(3,("sesssetupX:name=[%s]\\[%s]@[%s]\n",