s3-rpc_server: Fixed segfaults in rpc daemons.
authorAndreas Schneider <asn@samba.org>
Mon, 18 Jul 2011 09:42:43 +0000 (11:42 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 18 Jul 2011 12:01:02 +0000 (14:01 +0200)
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Mon Jul 18 14:01:02 CEST 2011 on sn-devel-104

source3/printing/spoolssd.c
source3/rpc_server/epmd.c
source3/rpc_server/rpc_server.c
source3/rpc_server/rpc_server.h

index cb90a9f7c76c7847bb41b2ef44c9273d07710e19..039eb8872e1c719ab718043b506f4bf3c7befa9c 100644 (file)
@@ -222,7 +222,7 @@ void start_spoolssd(struct tevent_context *ev_ctx,
                exit(1);
        }
 
-       if (!setup_named_pipe_socket(SPOOLSS_PIPE_NAME, ev_ctx)) {
+       if (!setup_named_pipe_socket(SPOOLSS_PIPE_NAME, ev_ctx, msg_ctx)) {
                exit(1);
        }
 
index bb241ff2c1fad7bd32e3ac04efb88506c3f27f61..6f3959b5b86163931e45b105556d8c55b7bce79e 100644 (file)
@@ -274,7 +274,7 @@ void start_epmd(struct tevent_context *ev_ctx,
                exit(1);
        }
 
-       ok = setup_named_pipe_socket("epmapper", ev_ctx);
+       ok = setup_named_pipe_socket("epmapper", ev_ctx, msg_ctx);
        if (!ok) {
                DEBUG(0, ("Failed to open epmd named pipe!\n"));
                exit(1);
index 2dffaff3f0d1f59c5e368c811a6a396ba4cde047..6eef6f143125b44c3776e88a34358cde41d8c661 100644 (file)
@@ -212,7 +212,8 @@ static void named_pipe_listener(struct tevent_context *ev,
                                void *private_data);
 
 bool setup_named_pipe_socket(const char *pipe_name,
-                            struct tevent_context *ev_ctx)
+                            struct tevent_context *ev_ctx,
+                            struct messaging_context *msg_ctx)
 {
        struct dcerpc_ncacn_listen_state *state;
        struct tevent_fd *fde;
@@ -230,6 +231,9 @@ bool setup_named_pipe_socket(const char *pipe_name,
        }
        state->fd = -1;
 
+       state->ev_ctx = ev_ctx;
+       state->msg_ctx = msg_ctx;
+
        /*
         * As lp_ncalrpc_dir() should have 0755, but
         * lp_ncalrpc_dir()/np should have 0700, we need to
index aafc96238a5e5b55b485473b6fc9a6c14ee4339e..be6a1543331f416a7ce25f8918666955de8dbaaa 100644 (file)
@@ -27,7 +27,8 @@ typedef bool (*dcerpc_ncacn_disconnect_fn)(struct pipes_struct *p);
 void set_incoming_fault(struct pipes_struct *p);
 void process_complete_pdu(struct pipes_struct *p);
 bool setup_named_pipe_socket(const char *pipe_name,
-                            struct tevent_context *ev_ctx);
+                            struct tevent_context *ev_ctx,
+                            struct messaging_context *msg_ctx);
 
 uint16_t setup_dcerpc_ncacn_tcpip_socket(struct tevent_context *ev_ctx,
                                         struct messaging_context *msg_ctx,