Changeset 745 for trunk/server/source4/rpc_server/common
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source4/rpc_server/common/common.h
r414 r745 25 25 26 26 struct share_config; 27 struct dcesrv_connection; 27 28 struct dcesrv_context; 28 29 struct dcesrv_context; 30 struct dcesrv_call_state; 31 struct ndr_interface_table; 32 struct ncacn_packet; 29 33 30 34 struct dcerpc_server_info { … … 35 39 }; 36 40 37 struct ndr_interface_table;38 struct dcesrv_call_state;39 41 #include "rpc_server/common/proto.h" 40 42 -
trunk/server/source4/rpc_server/common/forward.c
r414 r745 21 21 22 22 #include "includes.h" 23 #include <tevent.h> 23 24 #include "rpc_server/dcerpc_server.h" 25 #include "librpc/gen_ndr/dcerpc.h" 26 #include "rpc_server/common/common.h" 24 27 #include "messaging/irpc.h" 28 #include "auth/auth.h" 29 25 30 26 31 struct dcesrv_forward_state { … … 32 37 called when the forwarded rpc request is finished 33 38 */ 34 static void dcesrv_irpc_forward_callback(struct irpc_request *ireq)39 static void dcesrv_irpc_forward_callback(struct tevent_req *subreq) 35 40 { 36 struct dcesrv_forward_state *st = talloc_get_type(ireq->async.private_data, 37 struct dcesrv_forward_state); 41 struct dcesrv_forward_state *st = 42 tevent_req_callback_data(subreq, 43 struct dcesrv_forward_state); 38 44 const char *opname = st->opname; 39 45 NTSTATUS status; 40 if (!NT_STATUS_IS_OK(ireq->status)) { 46 47 status = dcerpc_binding_handle_call_recv(subreq); 48 TALLOC_FREE(subreq); 49 if (!NT_STATUS_IS_OK(status)) { 41 50 DEBUG(0,("IRPC callback failed for %s - %s\n", 42 opname, nt_errstr( ireq->status)));51 opname, nt_errstr(status))); 43 52 st->dce_call->fault_code = DCERPC_FAULT_CANT_PERFORM; 44 53 } 45 talloc_free(ireq);46 54 status = dcesrv_reply(st->dce_call); 47 55 if (!NT_STATUS_IS_OK(status)) { … … 53 61 54 62 55 /* 56 forward a RPC call using IRPC to another task63 /** 64 * Forward a RPC call using IRPC to another task 57 65 */ 58 66 void dcesrv_irpc_forward_rpc_call(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, 59 67 void *r, uint32_t callid, 60 68 const struct ndr_interface_table *ndr_table, 61 const char *dest_task, const char *opname) 69 const char *dest_task, const char *opname, 70 uint32_t timeout) 62 71 { 63 struct server_id *sid;64 struct irpc_request *ireq;65 72 struct dcesrv_forward_state *st; 73 struct dcerpc_binding_handle *binding_handle; 74 struct tevent_req *subreq; 75 struct security_token *token; 66 76 67 77 st = talloc(mem_ctx, struct dcesrv_forward_state); … … 83 93 } 84 94 85 /* find the server task */ 86 sid = irpc_servers_byname(dce_call->msg_ctx, mem_ctx, dest_task); 87 if (sid == NULL || sid[0].id == 0) { 88 DEBUG(0,("%s: Unable to find %s task\n", dest_task, opname)); 95 binding_handle = irpc_binding_handle_by_name(st, dce_call->msg_ctx, 96 dest_task, ndr_table); 97 if (binding_handle == NULL) { 98 DEBUG(0,("%s: Failed to forward request to %s task\n", 99 opname, dest_task)); 89 100 dce_call->fault_code = DCERPC_FAULT_CANT_PERFORM; 90 101 return; 91 102 } 92 103 104 /* reset timeout for the handle */ 105 dcerpc_binding_handle_set_timeout(binding_handle, timeout); 106 107 /* add security token to the handle*/ 108 token = dce_call->conn->auth_state.session_info->security_token; 109 irpc_binding_handle_add_security_token(binding_handle, token); 110 93 111 /* forward the call */ 94 ireq = irpc_call_send(dce_call->msg_ctx, sid[0], ndr_table, callid, r, mem_ctx); 95 if (ireq == NULL) { 112 subreq = dcerpc_binding_handle_call_send(st, dce_call->event_ctx, 113 binding_handle, 114 NULL, ndr_table, 115 callid, 116 dce_call, r); 117 if (subreq == NULL) { 96 118 DEBUG(0,("%s: Failed to forward request to %s task\n", 97 119 opname, dest_task)); … … 104 126 105 127 /* setup the callback */ 106 ireq->async.fn = dcesrv_irpc_forward_callback; 107 ireq->async.private_data = st; 128 tevent_req_set_callback(subreq, dcesrv_irpc_forward_callback, st); 108 129 } -
trunk/server/source4/rpc_server/common/server_info.c
r414 r745 21 21 22 22 #include "includes.h" 23 #include "librpc/gen_ndr/ ndr_srvsvc.h"23 #include "librpc/gen_ndr/srvsvc.h" 24 24 #include "rpc_server/dcerpc_server.h" 25 25 #include "dsdb/samdb/samdb.h" 26 26 #include "auth/auth.h" 27 27 #include "param/param.h" 28 #include "rpc_server/common/common.h"29 28 30 29 /* … … 37 36 enum srvsvc_PlatformId id; 38 37 39 id = lp _parm_int(dce_ctx->lp_ctx, NULL, "server_info", "platform_id", PLATFORM_ID_NT);38 id = lpcfg_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "platform_id", PLATFORM_ID_NT); 40 39 41 40 return id; … … 48 47 /* if there's no string return our NETBIOS name */ 49 48 if (!p) { 50 return talloc_strdup(mem_ctx, lp _netbios_name(dce_ctx->lp_ctx));49 return talloc_strdup(mem_ctx, lpcfg_netbios_name(dce_ctx->lp_ctx)); 51 50 } 52 51 … … 68 67 default_server_announce |= SV_TYPE_SERVER_UNIX; 69 68 70 switch (lp _announce_as(dce_ctx->lp_ctx)) {69 switch (lpcfg_announce_as(dce_ctx->lp_ctx)) { 71 70 case ANNOUNCE_AS_NT_SERVER: 72 71 default_server_announce |= SV_TYPE_SERVER_NT; … … 85 84 } 86 85 87 switch (lp _server_role(dce_ctx->lp_ctx)) {86 switch (lpcfg_server_role(dce_ctx->lp_ctx)) { 88 87 case ROLE_DOMAIN_MEMBER: 89 88 default_server_announce |= SV_TYPE_DOMAIN_MEMBER; … … 97 96 } 98 97 /* open main ldb */ 99 samctx = samdb_connect(tmp_ctx, event_ctx, dce_ctx->lp_ctx, anonymous_session(tmp_ctx, event_ctx, dce_ctx->lp_ctx));98 samctx = samdb_connect(tmp_ctx, event_ctx, dce_ctx->lp_ctx, anonymous_session(tmp_ctx, dce_ctx->lp_ctx), 0); 100 99 if (samctx == NULL) { 101 100 DEBUG(2,("Unable to open samdb in determining server announce flags\n")); … … 117 116 break; 118 117 } 119 if (lp _time_server(dce_ctx->lp_ctx))118 if (lpcfg_time_server(dce_ctx->lp_ctx)) 120 119 default_server_announce |= SV_TYPE_TIME_SOURCE; 121 120 122 if (lp _host_msdfs(dce_ctx->lp_ctx))121 if (lpcfg_host_msdfs(dce_ctx->lp_ctx)) 123 122 default_server_announce |= SV_TYPE_DFS_SERVER; 124 123
Note:
See TracChangeset
for help on using the changeset viewer.