diff options
author | Volker Lendecke <vl@samba.org> | 2010-09-19 21:09:18 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-10-03 18:17:08 +0200 |
commit | fb2f0c5bdd5bd4cb62072cf2e2b9bc7d73ad6b42 (patch) | |
tree | fc83a557753ae6d93a5f3fa040791a6d6c5dbd18 | |
parent | fba8e326f819146d10ca3088083df0cf20b571c1 (diff) | |
download | samba-fb2f0c5bdd5bd4cb62072cf2e2b9bc7d73ad6b42.tar.gz samba-fb2f0c5bdd5bd4cb62072cf2e2b9bc7d73ad6b42.tar.bz2 samba-fb2f0c5bdd5bd4cb62072cf2e2b9bc7d73ad6b42.zip |
s3: Add msg_ctx_to_sconn
-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); |