Line data Source code
1 : /* s3 compat server functions auto-generated by pidl */
2 : #include "bin/default/librpc/gen_ndr/ndr_fsrvp.h"
3 : #include "bin/default/librpc/gen_ndr/ndr_fsrvp_scompat.h"
4 : #include <librpc/rpc/dcesrv_core.h>
5 : #include <rpc_server/rpc_config.h>
6 : #include <rpc_server/rpc_server.h>
7 : #include <util/debug.h>
8 :
9 : enum s3compat_rpc_dispatch {
10 : S3COMPAT_RPC_DISPATCH_EXTERNAL = 0x00000001,
11 : S3COMPAT_RPC_DISPATCH_INTERNAL = 0x00000002,
12 : };
13 :
14 : /* FileServerVssAgent - dcerpc server boilerplate generated by pidl */
15 2 : static NTSTATUS FileServerVssAgent__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
16 : {
17 : #ifdef DCESRV_INTERFACE_FILESERVERVSSAGENT_BIND
18 : return DCESRV_INTERFACE_FILESERVERVSSAGENT_BIND(context,iface);
19 : #else
20 2 : return NT_STATUS_OK;
21 : #endif
22 : }
23 :
24 2 : static void FileServerVssAgent__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
25 : {
26 : #ifdef DCESRV_INTERFACE_FILESERVERVSSAGENT_UNBIND
27 : DCESRV_INTERFACE_FILESERVERVSSAGENT_UNBIND(context, iface);
28 : #else
29 2 : return;
30 : #endif
31 : }
32 :
33 238 : NTSTATUS FileServerVssAgent__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
34 : {
35 0 : enum ndr_err_code ndr_err;
36 238 : uint16_t opnum = dce_call->pkt.u.request.opnum;
37 :
38 238 : dce_call->fault_code = 0;
39 :
40 238 : if (opnum >= ndr_table_FileServerVssAgent.num_calls) {
41 0 : dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
42 0 : return NT_STATUS_NET_WRITE_FAULT;
43 : }
44 :
45 238 : *r = talloc_named(mem_ctx, ndr_table_FileServerVssAgent.calls[opnum].struct_size, "struct %s", ndr_table_FileServerVssAgent.calls[opnum].name);
46 238 : NT_STATUS_HAVE_NO_MEMORY(*r);
47 :
48 : /* unravel the NDR for the packet */
49 238 : ndr_err = ndr_table_FileServerVssAgent.calls[opnum].ndr_pull(pull, NDR_IN, *r);
50 238 : if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
51 0 : dce_call->fault_code = DCERPC_FAULT_NDR;
52 0 : return NT_STATUS_NET_WRITE_FAULT;
53 : }
54 :
55 238 : return NT_STATUS_OK;
56 : }
57 :
58 238 : static NTSTATUS FileServerVssAgent__op_dispatch_internal(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r, enum s3compat_rpc_dispatch dispatch)
59 : {
60 238 : uint16_t opnum = dce_call->pkt.u.request.opnum;
61 238 : struct pipes_struct *p = NULL;
62 238 : NTSTATUS status = NT_STATUS_OK;
63 238 : bool impersonated = false;
64 :
65 : /* Retrieve pipes struct */
66 238 : p = dcesrv_get_pipes_struct(dce_call->conn);
67 238 : p->dce_call = dce_call;
68 238 : p->mem_ctx = mem_ctx;
69 : /* Reset pipes struct fault state */
70 238 : p->fault_state = 0;
71 :
72 : /* Impersonate */
73 238 : if (dispatch == S3COMPAT_RPC_DISPATCH_EXTERNAL) {
74 238 : impersonated = become_authenticated_pipe_user(dce_call->auth_state->session_info);
75 238 : if (!impersonated) {
76 0 : dce_call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
77 0 : status = NT_STATUS_NET_WRITE_FAULT;
78 0 : goto fail;
79 : }
80 : }
81 :
82 238 : switch (opnum) {
83 28 : case 0: { /* fss_GetSupportedVersion */
84 28 : struct fss_GetSupportedVersion *r2 = (struct fss_GetSupportedVersion *)r;
85 28 : if (DEBUGLEVEL >= 10) {
86 0 : NDR_PRINT_FUNCTION_DEBUG(fss_GetSupportedVersion, NDR_IN, r2);
87 : }
88 28 : NDR_ZERO_STRUCT(r2->out);
89 28 : r2->out.MinVersion = talloc_zero(r2, uint32_t);
90 28 : if (r2->out.MinVersion == NULL) {
91 0 : status = NT_STATUS_NO_MEMORY;
92 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
93 0 : goto fail;
94 : }
95 :
96 28 : r2->out.MaxVersion = talloc_zero(r2, uint32_t);
97 28 : if (r2->out.MaxVersion == NULL) {
98 0 : status = NT_STATUS_NO_MEMORY;
99 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
100 0 : goto fail;
101 : }
102 :
103 28 : r2->out.result = _fss_GetSupportedVersion(p, r2);
104 28 : break;
105 : }
106 28 : case 1: { /* fss_SetContext */
107 28 : struct fss_SetContext *r2 = (struct fss_SetContext *)r;
108 28 : if (DEBUGLEVEL >= 10) {
109 0 : NDR_PRINT_FUNCTION_DEBUG(fss_SetContext, NDR_IN, r2);
110 : }
111 28 : r2->out.result = _fss_SetContext(p, r2);
112 28 : break;
113 : }
114 26 : case 2: { /* fss_StartShadowCopySet */
115 26 : struct fss_StartShadowCopySet *r2 = (struct fss_StartShadowCopySet *)r;
116 26 : if (DEBUGLEVEL >= 10) {
117 0 : NDR_PRINT_FUNCTION_DEBUG(fss_StartShadowCopySet, NDR_IN, r2);
118 : }
119 26 : NDR_ZERO_STRUCT(r2->out);
120 26 : r2->out.pShadowCopySetId = talloc_zero(r2, struct GUID);
121 26 : if (r2->out.pShadowCopySetId == NULL) {
122 0 : status = NT_STATUS_NO_MEMORY;
123 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
124 0 : goto fail;
125 : }
126 :
127 26 : r2->out.result = _fss_StartShadowCopySet(p, r2);
128 26 : break;
129 : }
130 44 : case 3: { /* fss_AddToShadowCopySet */
131 44 : struct fss_AddToShadowCopySet *r2 = (struct fss_AddToShadowCopySet *)r;
132 44 : if (DEBUGLEVEL >= 10) {
133 0 : NDR_PRINT_FUNCTION_DEBUG(fss_AddToShadowCopySet, NDR_IN, r2);
134 : }
135 44 : NDR_ZERO_STRUCT(r2->out);
136 44 : r2->out.pShadowCopyId = talloc_zero(r2, struct GUID);
137 44 : if (r2->out.pShadowCopyId == NULL) {
138 0 : status = NT_STATUS_NO_MEMORY;
139 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
140 0 : goto fail;
141 : }
142 :
143 44 : r2->out.result = _fss_AddToShadowCopySet(p, r2);
144 44 : break;
145 : }
146 18 : case 4: { /* fss_CommitShadowCopySet */
147 18 : struct fss_CommitShadowCopySet *r2 = (struct fss_CommitShadowCopySet *)r;
148 18 : if (DEBUGLEVEL >= 10) {
149 0 : NDR_PRINT_FUNCTION_DEBUG(fss_CommitShadowCopySet, NDR_IN, r2);
150 : }
151 18 : r2->out.result = _fss_CommitShadowCopySet(p, r2);
152 18 : break;
153 : }
154 16 : case 5: { /* fss_ExposeShadowCopySet */
155 16 : struct fss_ExposeShadowCopySet *r2 = (struct fss_ExposeShadowCopySet *)r;
156 16 : if (DEBUGLEVEL >= 10) {
157 0 : NDR_PRINT_FUNCTION_DEBUG(fss_ExposeShadowCopySet, NDR_IN, r2);
158 : }
159 16 : r2->out.result = _fss_ExposeShadowCopySet(p, r2);
160 16 : break;
161 : }
162 0 : case 6: { /* fss_RecoveryCompleteShadowCopySet */
163 0 : struct fss_RecoveryCompleteShadowCopySet *r2 = (struct fss_RecoveryCompleteShadowCopySet *)r;
164 0 : if (DEBUGLEVEL >= 10) {
165 0 : NDR_PRINT_FUNCTION_DEBUG(fss_RecoveryCompleteShadowCopySet, NDR_IN, r2);
166 : }
167 0 : r2->out.result = _fss_RecoveryCompleteShadowCopySet(p, r2);
168 0 : break;
169 : }
170 2 : case 7: { /* fss_AbortShadowCopySet */
171 2 : struct fss_AbortShadowCopySet *r2 = (struct fss_AbortShadowCopySet *)r;
172 2 : if (DEBUGLEVEL >= 10) {
173 0 : NDR_PRINT_FUNCTION_DEBUG(fss_AbortShadowCopySet, NDR_IN, r2);
174 : }
175 2 : r2->out.result = _fss_AbortShadowCopySet(p, r2);
176 2 : break;
177 : }
178 28 : case 8: { /* fss_IsPathSupported */
179 28 : struct fss_IsPathSupported *r2 = (struct fss_IsPathSupported *)r;
180 28 : if (DEBUGLEVEL >= 10) {
181 0 : NDR_PRINT_FUNCTION_DEBUG(fss_IsPathSupported, NDR_IN, r2);
182 : }
183 28 : NDR_ZERO_STRUCT(r2->out);
184 28 : r2->out.SupportedByThisProvider = talloc_zero(r2, uint32_t);
185 28 : if (r2->out.SupportedByThisProvider == NULL) {
186 0 : status = NT_STATUS_NO_MEMORY;
187 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
188 0 : goto fail;
189 : }
190 :
191 28 : r2->out.OwnerMachineName = talloc_zero(r2, const char *);
192 28 : if (r2->out.OwnerMachineName == NULL) {
193 0 : status = NT_STATUS_NO_MEMORY;
194 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
195 0 : goto fail;
196 : }
197 :
198 28 : r2->out.result = _fss_IsPathSupported(p, r2);
199 28 : break;
200 : }
201 0 : case 9: { /* fss_IsPathShadowCopied */
202 0 : struct fss_IsPathShadowCopied *r2 = (struct fss_IsPathShadowCopied *)r;
203 0 : if (DEBUGLEVEL >= 10) {
204 0 : NDR_PRINT_FUNCTION_DEBUG(fss_IsPathShadowCopied, NDR_IN, r2);
205 : }
206 0 : NDR_ZERO_STRUCT(r2->out);
207 0 : r2->out.ShadowCopyPresent = talloc_zero(r2, uint32_t);
208 0 : if (r2->out.ShadowCopyPresent == NULL) {
209 0 : status = NT_STATUS_NO_MEMORY;
210 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
211 0 : goto fail;
212 : }
213 :
214 0 : r2->out.ShadowCopyCompatibility = talloc_zero(r2, int32_t);
215 0 : if (r2->out.ShadowCopyCompatibility == NULL) {
216 0 : status = NT_STATUS_NO_MEMORY;
217 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
218 0 : goto fail;
219 : }
220 :
221 0 : r2->out.result = _fss_IsPathShadowCopied(p, r2);
222 0 : break;
223 : }
224 14 : case 10: { /* fss_GetShareMapping */
225 14 : struct fss_GetShareMapping *r2 = (struct fss_GetShareMapping *)r;
226 14 : if (DEBUGLEVEL >= 10) {
227 0 : NDR_PRINT_FUNCTION_DEBUG(fss_GetShareMapping, NDR_IN, r2);
228 : }
229 14 : NDR_ZERO_STRUCT(r2->out);
230 14 : r2->out.ShareMapping = talloc_zero(r2, union fssagent_share_mapping);
231 14 : if (r2->out.ShareMapping == NULL) {
232 0 : status = NT_STATUS_NO_MEMORY;
233 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
234 0 : goto fail;
235 : }
236 :
237 14 : r2->out.result = _fss_GetShareMapping(p, r2);
238 14 : break;
239 : }
240 14 : case 11: { /* fss_DeleteShareMapping */
241 14 : struct fss_DeleteShareMapping *r2 = (struct fss_DeleteShareMapping *)r;
242 14 : if (DEBUGLEVEL >= 10) {
243 0 : NDR_PRINT_FUNCTION_DEBUG(fss_DeleteShareMapping, NDR_IN, r2);
244 : }
245 14 : r2->out.result = _fss_DeleteShareMapping(p, r2);
246 14 : break;
247 : }
248 20 : case 12: { /* fss_PrepareShadowCopySet */
249 20 : struct fss_PrepareShadowCopySet *r2 = (struct fss_PrepareShadowCopySet *)r;
250 20 : if (DEBUGLEVEL >= 10) {
251 0 : NDR_PRINT_FUNCTION_DEBUG(fss_PrepareShadowCopySet, NDR_IN, r2);
252 : }
253 20 : r2->out.result = _fss_PrepareShadowCopySet(p, r2);
254 20 : break;
255 : }
256 0 : default:
257 0 : dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
258 0 : break;
259 : }
260 :
261 238 : fail:
262 : /* Unimpersonate */
263 238 : if (impersonated) {
264 238 : unbecome_authenticated_pipe_user();
265 : }
266 :
267 238 : p->dce_call = NULL;
268 238 : p->mem_ctx = NULL;
269 : /* Check pipes struct fault state */
270 238 : if (p->fault_state != 0) {
271 0 : dce_call->fault_code = p->fault_state;
272 : }
273 238 : if (dce_call->fault_code != 0) {
274 0 : status = NT_STATUS_NET_WRITE_FAULT;
275 : }
276 :
277 238 : return status;
278 : }
279 :
280 238 : NTSTATUS FileServerVssAgent__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
281 : {
282 238 : return FileServerVssAgent__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_EXTERNAL);
283 : }
284 :
285 238 : NTSTATUS FileServerVssAgent__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
286 : {
287 238 : uint16_t opnum = dce_call->pkt.u.request.opnum;
288 :
289 238 : switch (opnum) {
290 28 : case 0: { /* fss_GetSupportedVersion */
291 28 : struct fss_GetSupportedVersion *r2 = (struct fss_GetSupportedVersion *)r;
292 28 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
293 0 : DEBUG(5,("function fss_GetSupportedVersion replied async\n"));
294 : }
295 28 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
296 0 : NDR_PRINT_FUNCTION_DEBUG(fss_GetSupportedVersion, NDR_OUT | NDR_SET_VALUES, r2);
297 : }
298 28 : if (dce_call->fault_code != 0) {
299 0 : DBG_WARNING("dcerpc_fault %s in fss_GetSupportedVersion\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
300 : }
301 28 : break;
302 : }
303 28 : case 1: { /* fss_SetContext */
304 28 : struct fss_SetContext *r2 = (struct fss_SetContext *)r;
305 28 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
306 0 : DEBUG(5,("function fss_SetContext replied async\n"));
307 : }
308 28 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
309 0 : NDR_PRINT_FUNCTION_DEBUG(fss_SetContext, NDR_OUT | NDR_SET_VALUES, r2);
310 : }
311 28 : if (dce_call->fault_code != 0) {
312 0 : DBG_WARNING("dcerpc_fault %s in fss_SetContext\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
313 : }
314 28 : break;
315 : }
316 26 : case 2: { /* fss_StartShadowCopySet */
317 26 : struct fss_StartShadowCopySet *r2 = (struct fss_StartShadowCopySet *)r;
318 26 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
319 0 : DEBUG(5,("function fss_StartShadowCopySet replied async\n"));
320 : }
321 26 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
322 0 : NDR_PRINT_FUNCTION_DEBUG(fss_StartShadowCopySet, NDR_OUT | NDR_SET_VALUES, r2);
323 : }
324 26 : if (dce_call->fault_code != 0) {
325 0 : DBG_WARNING("dcerpc_fault %s in fss_StartShadowCopySet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
326 : }
327 26 : break;
328 : }
329 44 : case 3: { /* fss_AddToShadowCopySet */
330 44 : struct fss_AddToShadowCopySet *r2 = (struct fss_AddToShadowCopySet *)r;
331 44 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
332 0 : DEBUG(5,("function fss_AddToShadowCopySet replied async\n"));
333 : }
334 44 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
335 0 : NDR_PRINT_FUNCTION_DEBUG(fss_AddToShadowCopySet, NDR_OUT | NDR_SET_VALUES, r2);
336 : }
337 44 : if (dce_call->fault_code != 0) {
338 0 : DBG_WARNING("dcerpc_fault %s in fss_AddToShadowCopySet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
339 : }
340 44 : break;
341 : }
342 18 : case 4: { /* fss_CommitShadowCopySet */
343 18 : struct fss_CommitShadowCopySet *r2 = (struct fss_CommitShadowCopySet *)r;
344 18 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
345 0 : DEBUG(5,("function fss_CommitShadowCopySet replied async\n"));
346 : }
347 18 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
348 0 : NDR_PRINT_FUNCTION_DEBUG(fss_CommitShadowCopySet, NDR_OUT | NDR_SET_VALUES, r2);
349 : }
350 18 : if (dce_call->fault_code != 0) {
351 0 : DBG_WARNING("dcerpc_fault %s in fss_CommitShadowCopySet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
352 : }
353 18 : break;
354 : }
355 16 : case 5: { /* fss_ExposeShadowCopySet */
356 16 : struct fss_ExposeShadowCopySet *r2 = (struct fss_ExposeShadowCopySet *)r;
357 16 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
358 0 : DEBUG(5,("function fss_ExposeShadowCopySet replied async\n"));
359 : }
360 16 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
361 0 : NDR_PRINT_FUNCTION_DEBUG(fss_ExposeShadowCopySet, NDR_OUT | NDR_SET_VALUES, r2);
362 : }
363 16 : if (dce_call->fault_code != 0) {
364 0 : DBG_WARNING("dcerpc_fault %s in fss_ExposeShadowCopySet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
365 : }
366 16 : break;
367 : }
368 0 : case 6: { /* fss_RecoveryCompleteShadowCopySet */
369 0 : struct fss_RecoveryCompleteShadowCopySet *r2 = (struct fss_RecoveryCompleteShadowCopySet *)r;
370 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
371 0 : DEBUG(5,("function fss_RecoveryCompleteShadowCopySet replied async\n"));
372 : }
373 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
374 0 : NDR_PRINT_FUNCTION_DEBUG(fss_RecoveryCompleteShadowCopySet, NDR_OUT | NDR_SET_VALUES, r2);
375 : }
376 0 : if (dce_call->fault_code != 0) {
377 0 : DBG_WARNING("dcerpc_fault %s in fss_RecoveryCompleteShadowCopySet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
378 : }
379 0 : break;
380 : }
381 2 : case 7: { /* fss_AbortShadowCopySet */
382 2 : struct fss_AbortShadowCopySet *r2 = (struct fss_AbortShadowCopySet *)r;
383 2 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
384 0 : DEBUG(5,("function fss_AbortShadowCopySet replied async\n"));
385 : }
386 2 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
387 0 : NDR_PRINT_FUNCTION_DEBUG(fss_AbortShadowCopySet, NDR_OUT | NDR_SET_VALUES, r2);
388 : }
389 2 : if (dce_call->fault_code != 0) {
390 0 : DBG_WARNING("dcerpc_fault %s in fss_AbortShadowCopySet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
391 : }
392 2 : break;
393 : }
394 28 : case 8: { /* fss_IsPathSupported */
395 28 : struct fss_IsPathSupported *r2 = (struct fss_IsPathSupported *)r;
396 28 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
397 0 : DEBUG(5,("function fss_IsPathSupported replied async\n"));
398 : }
399 28 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
400 0 : NDR_PRINT_FUNCTION_DEBUG(fss_IsPathSupported, NDR_OUT | NDR_SET_VALUES, r2);
401 : }
402 28 : if (dce_call->fault_code != 0) {
403 0 : DBG_WARNING("dcerpc_fault %s in fss_IsPathSupported\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
404 : }
405 28 : break;
406 : }
407 0 : case 9: { /* fss_IsPathShadowCopied */
408 0 : struct fss_IsPathShadowCopied *r2 = (struct fss_IsPathShadowCopied *)r;
409 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
410 0 : DEBUG(5,("function fss_IsPathShadowCopied replied async\n"));
411 : }
412 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
413 0 : NDR_PRINT_FUNCTION_DEBUG(fss_IsPathShadowCopied, NDR_OUT | NDR_SET_VALUES, r2);
414 : }
415 0 : if (dce_call->fault_code != 0) {
416 0 : DBG_WARNING("dcerpc_fault %s in fss_IsPathShadowCopied\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
417 : }
418 0 : break;
419 : }
420 14 : case 10: { /* fss_GetShareMapping */
421 14 : struct fss_GetShareMapping *r2 = (struct fss_GetShareMapping *)r;
422 14 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
423 0 : DEBUG(5,("function fss_GetShareMapping replied async\n"));
424 : }
425 14 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
426 0 : NDR_PRINT_FUNCTION_DEBUG(fss_GetShareMapping, NDR_OUT | NDR_SET_VALUES, r2);
427 : }
428 14 : if (dce_call->fault_code != 0) {
429 0 : DBG_WARNING("dcerpc_fault %s in fss_GetShareMapping\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
430 : }
431 14 : break;
432 : }
433 14 : case 11: { /* fss_DeleteShareMapping */
434 14 : struct fss_DeleteShareMapping *r2 = (struct fss_DeleteShareMapping *)r;
435 14 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
436 0 : DEBUG(5,("function fss_DeleteShareMapping replied async\n"));
437 : }
438 14 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
439 0 : NDR_PRINT_FUNCTION_DEBUG(fss_DeleteShareMapping, NDR_OUT | NDR_SET_VALUES, r2);
440 : }
441 14 : if (dce_call->fault_code != 0) {
442 0 : DBG_WARNING("dcerpc_fault %s in fss_DeleteShareMapping\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
443 : }
444 14 : break;
445 : }
446 20 : case 12: { /* fss_PrepareShadowCopySet */
447 20 : struct fss_PrepareShadowCopySet *r2 = (struct fss_PrepareShadowCopySet *)r;
448 20 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
449 0 : DEBUG(5,("function fss_PrepareShadowCopySet replied async\n"));
450 : }
451 20 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
452 0 : NDR_PRINT_FUNCTION_DEBUG(fss_PrepareShadowCopySet, NDR_OUT | NDR_SET_VALUES, r2);
453 : }
454 20 : if (dce_call->fault_code != 0) {
455 0 : DBG_WARNING("dcerpc_fault %s in fss_PrepareShadowCopySet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
456 : }
457 20 : break;
458 : }
459 0 : default:
460 0 : dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
461 0 : break;
462 : }
463 :
464 238 : if (dce_call->fault_code != 0) {
465 0 : return NT_STATUS_NET_WRITE_FAULT;
466 : }
467 :
468 238 : return NT_STATUS_OK;
469 : }
470 :
471 238 : NTSTATUS FileServerVssAgent__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
472 : {
473 0 : enum ndr_err_code ndr_err;
474 238 : uint16_t opnum = dce_call->pkt.u.request.opnum;
475 :
476 238 : ndr_err = ndr_table_FileServerVssAgent.calls[opnum].ndr_push(push, NDR_OUT, r);
477 238 : if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
478 0 : dce_call->fault_code = DCERPC_FAULT_NDR;
479 0 : return NT_STATUS_NET_WRITE_FAULT;
480 : }
481 :
482 238 : return NT_STATUS_OK;
483 : }
484 :
485 0 : NTSTATUS FileServerVssAgent__op_local(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
486 : {
487 0 : return FileServerVssAgent__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_INTERNAL);
488 : }
489 :
490 : static const struct dcesrv_interface dcesrv_FileServerVssAgent_interface = {
491 : .name = "FileServerVssAgent",
492 : .syntax_id = {{0xa8e0653c,0x2744,0x4389,{0xa6,0x1d},{0x73,0x73,0xdf,0x8b,0x22,0x92}},1.0},
493 : .bind = FileServerVssAgent__op_bind,
494 : .unbind = FileServerVssAgent__op_unbind,
495 : .ndr_pull = FileServerVssAgent__op_ndr_pull,
496 : .dispatch = FileServerVssAgent__op_dispatch,
497 : .reply = FileServerVssAgent__op_reply,
498 : .ndr_push = FileServerVssAgent__op_ndr_push,
499 : .local = FileServerVssAgent__op_local,
500 : #ifdef DCESRV_INTERFACE_FILESERVERVSSAGENT_FLAGS
501 : .flags = DCESRV_INTERFACE_FILESERVERVSSAGENT_FLAGS
502 : #else
503 : .flags = 0
504 : #endif
505 : };
506 :
507 4 : static NTSTATUS FileServerVssAgent__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
508 : {
509 0 : uint32_t i;
510 0 : NTSTATUS ret;
511 :
512 : #ifdef DCESRV_INTERFACE_FILESERVERVSSAGENT_NCACN_NP_SECONDARY_ENDPOINT
513 : const char *ncacn_np_secondary_endpoint = DCESRV_INTERFACE_FILESERVERVSSAGENT_NCACN_NP_SECONDARY_ENDPOINT;
514 : #else
515 4 : const char *ncacn_np_secondary_endpoint = NULL;
516 : #endif
517 :
518 8 : for (i=0;i<ndr_table_FileServerVssAgent.endpoints->count;i++) {
519 4 : const char *name = ndr_table_FileServerVssAgent.endpoints->names[i];
520 :
521 4 : ret = dcesrv_interface_register(dce_ctx, name, ncacn_np_secondary_endpoint, &dcesrv_FileServerVssAgent_interface, NULL);
522 4 : if (!NT_STATUS_IS_OK(ret)) {
523 0 : DBG_ERR("Failed to register endpoint '%s'\n",name);
524 0 : return ret;
525 : }
526 : }
527 :
528 4 : return NT_STATUS_OK;
529 : }
530 :
531 4 : static NTSTATUS FileServerVssAgent__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
532 : {
533 4 : return NT_STATUS_OK;
534 : }
535 :
536 0 : static bool FileServerVssAgent__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
537 : {
538 0 : if (dcesrv_FileServerVssAgent_interface.syntax_id.if_version == if_version && GUID_equal(&dcesrv_FileServerVssAgent_interface.syntax_id.uuid, uuid)) {
539 0 : memcpy(iface,&dcesrv_FileServerVssAgent_interface, sizeof(*iface));
540 0 : return true;
541 : }
542 :
543 0 : return false;
544 : }
545 :
546 0 : static bool FileServerVssAgent__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
547 : {
548 0 : if (strcmp(dcesrv_FileServerVssAgent_interface.name, name)==0) {
549 0 : memcpy(iface, &dcesrv_FileServerVssAgent_interface, sizeof(*iface));
550 0 : return true;
551 : }
552 :
553 0 : return false;
554 : }
555 :
556 : static const struct dcesrv_endpoint_server FileServerVssAgent_ep_server = {
557 : /* fill in our name */
558 : .name = "FileServerVssAgent",
559 :
560 : /* Initialization flag */
561 : .initialized = false,
562 :
563 : /* fill in all the operations */
564 : #ifdef DCESRV_INTERFACE_FILESERVERVSSAGENT_INIT_SERVER
565 : .init_server = DCESRV_INTERFACE_FILESERVERVSSAGENT_INIT_SERVER,
566 : #else
567 : .init_server = FileServerVssAgent__op_init_server,
568 : #endif
569 : #ifdef DCESRV_INTERFACE_FILESERVERVSSAGENT_SHUTDOWN_SERVER
570 : .shutdown_server = DCESRV_INTERFACE_FILESERVERVSSAGENT_SHUTDOWN_SERVER,
571 : #else
572 : .shutdown_server = FileServerVssAgent__op_shutdown_server,
573 : #endif
574 : .interface_by_uuid = FileServerVssAgent__op_interface_by_uuid,
575 : .interface_by_name = FileServerVssAgent__op_interface_by_name
576 : };
577 :
578 4 : const struct dcesrv_endpoint_server *FileServerVssAgent_get_ep_server(void)
579 : {
580 4 : return &FileServerVssAgent_ep_server;
581 : }
|