2 Unix SMB/CIFS implementation.
4 endpoint server for the drsuapi pipe
6 Copyright (C) Stefan Metzmacher 2004
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "librpc/gen_ndr/ndr_drsuapi.h"
25 #include "rpc_server/dcerpc_server.h"
26 #include "rpc_server/common/common.h"
27 #include "rpc_server/drsuapi/dcesrv_drsuapi.h"
30 destroy a general handle.
32 static void drsuapi_handle_destroy(struct dcesrv_connection *conn, struct dcesrv_handle *h)
40 static WERROR drsuapi_DsBind(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
41 struct drsuapi_DsBind *r)
43 struct drsuapi_bind_state *b_state;
44 struct dcesrv_handle *handle;
46 r->out.bind_info = NULL;
47 ZERO_STRUCTP(r->out.bind_handle);
49 b_state = talloc_p(dce_call->conn, struct drsuapi_bind_state);
50 WERR_TALLOC_CHECK(b_state);
52 b_state->sam_ctx = samdb_connect(b_state);
53 if (!b_state->sam_ctx) {
58 handle = dcesrv_handle_new(dce_call->conn, DRSUAPI_BIND_HANDLE);
64 handle->data = b_state;
65 handle->destroy = drsuapi_handle_destroy;
67 *r->out.bind_handle = handle->wire_handle;
76 static WERROR drsuapi_DsUnbind(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
77 struct drsuapi_DsUnbind *r)
79 struct dcesrv_handle *h;
81 *r->out.bind_handle = *r->in.bind_handle;
83 DCESRV_PULL_HANDLE_WERR(h, r->in.bind_handle, DRSUAPI_BIND_HANDLE);
85 /* this causes the callback drsuapi_handle_destroy() to be called by
86 the handle destroy code which destroys the state associated
88 dcesrv_handle_destroy(dce_call->conn, h);
90 ZERO_STRUCTP(r->out.bind_handle);
99 static WERROR DRSUAPI_REPLICA_SYNC(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
100 struct DRSUAPI_REPLICA_SYNC *r)
102 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
107 DRSUAPI_GET_NC_CHANGES
109 static WERROR DRSUAPI_GET_NC_CHANGES(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
110 struct DRSUAPI_GET_NC_CHANGES *r)
112 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
119 static WERROR DRSUAPI_UPDATE_REFS(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
120 struct DRSUAPI_UPDATE_REFS *r)
122 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
129 static WERROR DRSUAPI_REPLICA_ADD(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
130 struct DRSUAPI_REPLICA_ADD *r)
132 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
139 static WERROR DRSUAPI_REPLICA_DEL(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
140 struct DRSUAPI_REPLICA_DEL *r)
142 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
147 DRSUAPI_REPLICA_MODIFY
149 static WERROR DRSUAPI_REPLICA_MODIFY(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
150 struct DRSUAPI_REPLICA_MODIFY *r)
152 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
159 static WERROR DRSUAPI_VERIFY_NAMES(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
160 struct DRSUAPI_VERIFY_NAMES *r)
162 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
167 DRSUAPI_GET_MEMBERSHIPS
169 static WERROR DRSUAPI_GET_MEMBERSHIPS(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
170 struct DRSUAPI_GET_MEMBERSHIPS *r)
172 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
177 DRSUAPI_INTER_DOMAIN_MOVE
179 static WERROR DRSUAPI_INTER_DOMAIN_MOVE(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
180 struct DRSUAPI_INTER_DOMAIN_MOVE *r)
182 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
187 DRSUAPI_GET_NT4_CHANGELOG
189 static WERROR DRSUAPI_GET_NT4_CHANGELOG(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
190 struct DRSUAPI_GET_NT4_CHANGELOG *r)
192 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
197 drsuapi_DsCrackNames => drsuapip_cracknames.c
199 static WERROR (*drsuapi_DsCrackNames)(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
200 struct drsuapi_DsCrackNames *r) = dcesrv_drsuapi_DsCrackNames;
205 static WERROR DRSUAPI_WRITE_SPN(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
206 struct DRSUAPI_WRITE_SPN *r)
208 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
213 DRSUAPI_REMOVE_DS_SERVER
215 static WERROR DRSUAPI_REMOVE_DS_SERVER(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
216 struct DRSUAPI_REMOVE_DS_SERVER *r)
218 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
223 DRSUAPI_REMOVE_DS_DOMAIN
225 static WERROR DRSUAPI_REMOVE_DS_DOMAIN(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
226 struct DRSUAPI_REMOVE_DS_DOMAIN *r)
228 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
233 drsuapi_DsGetDomainControllerInfo
235 static WERROR drsuapi_DsGetDomainControllerInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
236 struct drsuapi_DsGetDomainControllerInfo *r)
238 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
245 static WERROR DRSUAPI_ADD_ENTRY(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
246 struct DRSUAPI_ADD_ENTRY *r)
248 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
255 static WERROR DRSUAPI_EXECUTE_KCC(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
256 struct DRSUAPI_EXECUTE_KCC *r)
258 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
263 DRSUAPI_GET_REPL_INFO
265 static WERROR DRSUAPI_GET_REPL_INFO(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
266 struct DRSUAPI_GET_REPL_INFO *r)
268 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
273 DRSUAPI_ADD_SID_HISTORY
275 static WERROR DRSUAPI_ADD_SID_HISTORY(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
276 struct DRSUAPI_ADD_SID_HISTORY *r)
278 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
283 DRSUAPI_GET_MEMBERSHIPS2
285 static WERROR DRSUAPI_GET_MEMBERSHIPS2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
286 struct DRSUAPI_GET_MEMBERSHIPS2 *r)
288 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
293 DRSUAPI_REPLICA_VERIFY_OBJECTS
295 static WERROR DRSUAPI_REPLICA_VERIFY_OBJECTS(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
296 struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r)
298 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
303 DRSUAPI_GET_OBJECT_EXISTENCE
305 static WERROR DRSUAPI_GET_OBJECT_EXISTENCE(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
306 struct DRSUAPI_GET_OBJECT_EXISTENCE *r)
308 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
313 DRSUAPI_QUERY_SITES_BY_COST
315 static WERROR DRSUAPI_QUERY_SITES_BY_COST(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
316 struct DRSUAPI_QUERY_SITES_BY_COST *r)
318 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
322 /* include the generated boilerplate */
323 #include "librpc/gen_ndr/ndr_drsuapi_s.c"