s3: Add msg_ctx_to_sconn
authorVolker Lendecke <vl@samba.org>
Sun, 19 Sep 2010 19:09:18 +0000 (21:09 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 3 Oct 2010 16:17:08 +0000 (18:17 +0200)
source3/smbd/globals.c
source3/smbd/globals.h

index 2f6e33b146357d39a452db2f0946fea56b7c3372..4642328b4650698479866450f2f1c981ad7f772d 100644 (file)
@@ -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();
index 81e7f84b29015909951724a66aa4d5da966ee2b5..cbbb583ae9f42880616927742cf6e99424318f84 100644 (file)
@@ -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);