summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-07 11:02:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:24 -0500
commit45c92c9cf08210e1d5792e2d8db93912727c3dba (patch)
treef6dad65078fd730ced8bff3a3be2081921d05de0 /source4/rpc_server
parentf8517b3874d73967113ea6007c0189f22df9c267 (diff)
downloadsamba-45c92c9cf08210e1d5792e2d8db93912727c3dba.tar.gz
samba-45c92c9cf08210e1d5792e2d8db93912727c3dba.tar.bz2
samba-45c92c9cf08210e1d5792e2d8db93912727c3dba.zip
r13923: make the state_flags per dcesrv_connection
this will may help with a generic named pipe solution metze (This used to be commit c6fa9bd15cdb096c3dfc7a4109d9298933981255)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/dcerpc_server.c13
-rw-r--r--source4/rpc_server/dcerpc_server.h7
-rw-r--r--source4/rpc_server/dcerpc_sock.c1
3 files changed, 12 insertions, 9 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 29648b9e33..74f8dfe8d5 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -287,6 +287,7 @@ NTSTATUS dcesrv_endpoint_connect(struct dcesrv_context *dce_ctx,
TALLOC_CTX *mem_ctx,
const struct dcesrv_endpoint *ep,
struct stream_connection *srv_conn,
+ uint32_t state_flags,
struct dcesrv_connection **_p)
{
struct dcesrv_connection *p;
@@ -307,6 +308,7 @@ NTSTATUS dcesrv_endpoint_connect(struct dcesrv_context *dce_ctx,
p->auth_state.session_key = dcesrv_generic_session_key;
p->srv_conn = srv_conn;
p->processing = False;
+ p->state_flags = state_flags;
talloc_set_destructor(p, dcesrv_endpoint_destructor);
@@ -322,6 +324,7 @@ NTSTATUS dcesrv_endpoint_search_connect(struct dcesrv_context *dce_ctx,
const struct dcerpc_binding *ep_description,
struct auth_session_info *session_info,
struct stream_connection *srv_conn,
+ uint32_t state_flags,
struct dcesrv_connection **dce_conn_p)
{
NTSTATUS status;
@@ -333,7 +336,7 @@ NTSTATUS dcesrv_endpoint_search_connect(struct dcesrv_context *dce_ctx,
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
- status = dcesrv_endpoint_connect(dce_ctx, mem_ctx, ep, srv_conn, dce_conn_p);
+ status = dcesrv_endpoint_connect(dce_ctx, mem_ctx, ep, srv_conn, state_flags, dce_conn_p);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -724,7 +727,7 @@ static NTSTATUS dcesrv_request(struct dcesrv_call_state *call)
struct dcesrv_connection_context *context;
call->fault_code = 0;
- call->state_flags = call->conn->dce_ctx->state_flags;
+ call->state_flags = call->conn->state_flags;
call->time = timeval_current();
/* if authenticated, and the mech we use can't do async replies, don't use them... */
@@ -1134,7 +1137,7 @@ NTSTATUS dcesrv_output(struct dcesrv_connection *dce_conn,
return status;
}
-static NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx, const char **endpoint_servers, uint32_t state_flags, struct dcesrv_context **_dce_ctx)
+static NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx, const char **endpoint_servers, struct dcesrv_context **_dce_ctx)
{
NTSTATUS status;
struct dcesrv_context *dce_ctx;
@@ -1148,7 +1151,6 @@ static NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx, const char **endpoint_s
dce_ctx = talloc(mem_ctx, struct dcesrv_context);
NT_STATUS_HAVE_NO_MEMORY(dce_ctx);
dce_ctx->endpoint_list = NULL;
- dce_ctx->state_flags = state_flags;
for (i=0;endpoint_servers[i];i++) {
const struct dcesrv_endpoint_server *ep_server;
@@ -1179,7 +1181,7 @@ NTSTATUS dcesrv_init_ipc_context(TALLOC_CTX *mem_ctx, struct dcesrv_context **_d
NTSTATUS status;
struct dcesrv_context *dce_ctx;
- status = dcesrv_init_context(mem_ctx, lp_dcerpc_endpoint_servers(), 0, &dce_ctx);
+ status = dcesrv_init_context(mem_ctx, lp_dcerpc_endpoint_servers(), &dce_ctx);
NT_STATUS_NOT_OK_RETURN(status);
*_dce_ctx = dce_ctx;
@@ -1278,7 +1280,6 @@ static NTSTATUS dcesrv_init(struct event_context *event_context, const struct mo
status = dcesrv_init_context(event_context,
lp_dcerpc_endpoint_servers(),
- DCESRV_CALL_STATE_FLAG_MAY_ASYNC,
&dce_ctx);
NT_STATUS_NOT_OK_RETURN(status);
diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h
index d6111c51ef..85449c1a60 100644
--- a/source4/rpc_server/dcerpc_server.h
+++ b/source4/rpc_server/dcerpc_server.h
@@ -177,6 +177,10 @@ struct dcesrv_connection {
DATA_BLOB transport_session_key;
BOOL processing;
+
+ /* this is the default state_flags for dcesrv_call_state structs */
+ uint32_t state_flags;
+
};
@@ -220,9 +224,6 @@ struct dcesrv_context {
struct dcesrv_interface iface;
} *interface_list;
} *endpoint_list;
-
- /* this is the default state_flags for dcesrv_call_state structs */
- uint32_t state_flags;
};
/* this structure is used by modules to determine the size of some critical types */
diff --git a/source4/rpc_server/dcerpc_sock.c b/source4/rpc_server/dcerpc_sock.c
index d8dd8b2620..540332299d 100644
--- a/source4/rpc_server/dcerpc_sock.c
+++ b/source4/rpc_server/dcerpc_sock.c
@@ -67,6 +67,7 @@ static void dcesrv_sock_accept(struct stream_connection *srv_conn)
srv_conn,
dcesrv_sock->endpoint,
srv_conn,
+ DCESRV_CALL_STATE_FLAG_MAY_ASYNC,
&dcesrv_conn);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("dcesrv_sock_accept: dcesrv_endpoint_connect failed: %s\n",