diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/globals.c | 13 | ||||
-rw-r--r-- | source3/smbd/globals.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c index 2f6e33b146..4642328b46 100644 --- a/source3/smbd/globals.c +++ b/source3/smbd/globals.c @@ -102,6 +102,19 @@ int num_children = 0; struct smbd_server_connection *smbd_server_conn = NULL; +struct smbd_server_connection *msg_ctx_to_sconn(struct messaging_context *msg_ctx) +{ + struct server_id my_id, msg_id; + + my_id = messaging_server_id(smbd_server_conn->msg_ctx); + msg_id = messaging_server_id(msg_ctx); + + if (!procid_equal(&my_id, &msg_id)) { + return NULL; + } + return smbd_server_conn; +} + struct messaging_context *smbd_messaging_context(void) { return server_messaging_context(); diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 81e7f84b29..cbbb583ae9 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -585,4 +585,6 @@ struct smbd_server_connection { extern struct smbd_server_connection *smbd_server_conn; +struct smbd_server_connection *msg_ctx_to_sconn(struct messaging_context *msg_ctx); + void smbd_init_globals(void); |