summaryrefslogtreecommitdiffstats
path: root/source3/smbd/server.c
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2013-03-15 15:08:22 +0100
committerChristof Schmitt <cs@samba.org>2013-12-12 10:50:59 -0700
commita26003ddb69f5bb2c50d8482841669204848df00 (patch)
treedc4a03e59a0d558970561d2f844c4e94c7ac0abb /source3/smbd/server.c
parent4673b488c9a41bcc5ad85a52a38f3c27d4ef790a (diff)
downloadsamba-a26003ddb69f5bb2c50d8482841669204848df00.tar.gz
samba-a26003ddb69f5bb2c50d8482841669204848df00.tar.xz
samba-a26003ddb69f5bb2c50d8482841669204848df00.zip
s3:smbd react on message that client should be disconnected
if MSG_SMB_KILL_CLIENT_IP message comes in and our client has the IP address given as argument, then shutdown the connection immediately Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r--source3/smbd/server.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 36be01948e..99b0a10a82 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -370,6 +370,17 @@ static void smb_parent_force_tdis(struct messaging_context *ctx,
messaging_send_to_children(ctx, msg_type, msg_data);
}
+static void smb_parent_kill_client_by_ip(struct messaging_context *ctx,
+ void *data,
+ uint32_t msg_type,
+ struct server_id srv_id,
+ DATA_BLOB* msg_data)
+{
+ if (am_parent) {
+ messaging_send_to_children(ctx, msg_type, msg_data);
+ }
+}
+
static void add_child_pid(struct smbd_parent_context *parent,
pid_t pid)
{
@@ -877,6 +888,8 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
brl_revalidate);
messaging_register(msg_ctx, NULL, MSG_SMB_FORCE_TDIS,
smb_parent_force_tdis);
+ messaging_register(msg_ctx, NULL, MSG_SMB_KILL_CLIENT_IP,
+ smb_parent_kill_client_by_ip);
messaging_register(msg_ctx, NULL,
ID_CACHE_DELETE, smbd_parent_id_cache_delete);