LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_mdssvc_scompat.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 158 249 63.5 %
Date: 2021-09-23 10:06:22 Functions: 11 15 73.3 %

          Line data    Source code
       1             : /* s3 compat server functions auto-generated by pidl */
       2             : #include "bin/default/librpc/gen_ndr/ndr_mdssvc.h"
       3             : #include "bin/default/librpc/gen_ndr/ndr_mdssvc_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             : /* mdssvc - dcerpc server boilerplate generated by pidl */
      15          18 : static NTSTATUS mdssvc__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      16             : {
      17          18 :         struct pipes_struct *p = NULL;
      18             : 
      19             :         /* Retrieve pipes struct */
      20          18 :         p = dcesrv_get_pipes_struct(context->conn);
      21          18 :         p->pipe_bound = true;
      22             : #ifdef DCESRV_INTERFACE_MDSSVC_BIND
      23             :         return DCESRV_INTERFACE_MDSSVC_BIND(context,iface);
      24             : #else
      25          18 :         return NT_STATUS_OK;
      26             : #endif
      27             : }
      28             : 
      29          18 : static void mdssvc__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      30             : {
      31             : #ifdef DCESRV_INTERFACE_MDSSVC_UNBIND
      32             :         DCESRV_INTERFACE_MDSSVC_UNBIND(context, iface);
      33             : #else
      34          18 :         return;
      35             : #endif
      36             : }
      37             : 
      38         120 : NTSTATUS mdssvc__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
      39             : {
      40             :         enum ndr_err_code ndr_err;
      41         120 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      42             : 
      43         120 :         dce_call->fault_code = 0;
      44             : 
      45         120 :         if (opnum >= ndr_table_mdssvc.num_calls) {
      46           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
      47           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      48             :         }
      49             : 
      50         120 :         *r = talloc_named(mem_ctx, ndr_table_mdssvc.calls[opnum].struct_size, "struct %s", ndr_table_mdssvc.calls[opnum].name);
      51         120 :         NT_STATUS_HAVE_NO_MEMORY(*r);
      52             : 
      53             :         /* unravel the NDR for the packet */
      54         120 :         ndr_err = ndr_table_mdssvc.calls[opnum].ndr_pull(pull, NDR_IN, *r);
      55         120 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
      56           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
      57           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      58             :         }
      59             : 
      60         120 :         return NT_STATUS_OK;
      61             : }
      62             : 
      63         120 : static NTSTATUS mdssvc__op_dispatch_internal(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r, enum s3compat_rpc_dispatch dispatch)
      64             : {
      65         120 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      66         120 :         struct pipes_struct *p = NULL;
      67         120 :         struct auth_session_info *pipe_session_info = NULL;
      68         120 :         NTSTATUS status = NT_STATUS_OK;
      69         120 :         bool impersonated = false;
      70             : 
      71             :         /* Retrieve pipes struct */
      72         120 :         p = dcesrv_get_pipes_struct(dce_call->conn);
      73             :         /* Update pipes struct opnum */
      74         120 :         p->opnum = opnum;
      75         120 :         p->dce_call = dce_call;
      76         120 :         p->mem_ctx = mem_ctx;
      77             :         /* Update pipes struct session info */
      78         120 :         pipe_session_info = p->session_info;
      79         120 :         p->session_info = dce_call->auth_state->session_info;
      80         120 :         p->auth.auth_type = dce_call->auth_state->auth_type;
      81         120 :         p->auth.auth_level = dce_call->auth_state->auth_level;
      82         120 :         p->auth.auth_context_id = dce_call->auth_state->auth_context_id;
      83             :         /* Reset pipes struct fault state */
      84         120 :         p->fault_state = 0;
      85             : 
      86             :         /* Impersonate */
      87         120 :         if (dispatch == S3COMPAT_RPC_DISPATCH_EXTERNAL) {
      88         120 :                 impersonated = become_authenticated_pipe_user(p->session_info);
      89         120 :                 if (!impersonated) {
      90           0 :                         dce_call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
      91           0 :                         status = NT_STATUS_NET_WRITE_FAULT;
      92           0 :                         goto fail;
      93             :                 }
      94             :         }
      95             : 
      96         120 :         switch (opnum) {
      97          26 :         case 0: { /* mdssvc_open */
      98          26 :                 struct mdssvc_open *r2 = (struct mdssvc_open *)r;
      99          26 :                 if (DEBUGLEVEL >= 10) {
     100           0 :                         NDR_PRINT_FUNCTION_DEBUG(mdssvc_open, NDR_IN, r2);
     101             :                 }
     102          26 :                 NDR_ZERO_STRUCT(r2->out);
     103          26 :                 r2->out.device_id = r2->in.device_id;
     104          26 :                 r2->out.unkn2 = r2->in.unkn2;
     105          26 :                 r2->out.unkn3 = r2->in.unkn3;
     106          26 :                 r2->out.share_path = talloc_zero_array(r2, const char, 1025);
     107          26 :                 if (r2->out.share_path == NULL) {
     108           0 :                         status = NT_STATUS_NO_MEMORY;
     109           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     110           0 :                         goto fail;
     111             :                 }
     112             : 
     113          26 :                 r2->out.handle = talloc_zero(r2, struct policy_handle);
     114          26 :                 if (r2->out.handle == NULL) {
     115           0 :                         status = NT_STATUS_NO_MEMORY;
     116           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     117           0 :                         goto fail;
     118             :                 }
     119             : 
     120          26 :                 _mdssvc_open(p, r2);
     121          26 :                 break;
     122             :         }
     123          24 :         case 1: { /* mdssvc_unknown1 */
     124          24 :                 struct mdssvc_unknown1 *r2 = (struct mdssvc_unknown1 *)r;
     125          24 :                 if (DEBUGLEVEL >= 10) {
     126           0 :                         NDR_PRINT_FUNCTION_DEBUG(mdssvc_unknown1, NDR_IN, r2);
     127             :                 }
     128          24 :                 NDR_ZERO_STRUCT(r2->out);
     129          24 :                 r2->out.status = talloc_zero(r2, uint32_t);
     130          24 :                 if (r2->out.status == NULL) {
     131           0 :                         status = NT_STATUS_NO_MEMORY;
     132           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     133           0 :                         goto fail;
     134             :                 }
     135             : 
     136          24 :                 r2->out.flags = talloc_zero(r2, uint32_t);
     137          24 :                 if (r2->out.flags == NULL) {
     138           0 :                         status = NT_STATUS_NO_MEMORY;
     139           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     140           0 :                         goto fail;
     141             :                 }
     142             : 
     143          24 :                 r2->out.unkn7 = talloc_zero(r2, uint32_t);
     144          24 :                 if (r2->out.unkn7 == NULL) {
     145           0 :                         status = NT_STATUS_NO_MEMORY;
     146           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     147           0 :                         goto fail;
     148             :                 }
     149             : 
     150          24 :                 _mdssvc_unknown1(p, r2);
     151          24 :                 break;
     152             :         }
     153          50 :         case 2: { /* mdssvc_cmd */
     154          50 :                 struct mdssvc_cmd *r2 = (struct mdssvc_cmd *)r;
     155          50 :                 if (DEBUGLEVEL >= 10) {
     156           0 :                         NDR_PRINT_FUNCTION_DEBUG(mdssvc_cmd, NDR_IN, r2);
     157             :                 }
     158          50 :                 NDR_ZERO_STRUCT(r2->out);
     159          50 :                 r2->out.fragment = talloc_zero(r2, uint32_t);
     160          50 :                 if (r2->out.fragment == NULL) {
     161           0 :                         status = NT_STATUS_NO_MEMORY;
     162           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     163           0 :                         goto fail;
     164             :                 }
     165             : 
     166          50 :                 r2->out.response_blob = talloc_zero(r2, struct mdssvc_blob);
     167          50 :                 if (r2->out.response_blob == NULL) {
     168           0 :                         status = NT_STATUS_NO_MEMORY;
     169           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     170           0 :                         goto fail;
     171             :                 }
     172             : 
     173          50 :                 r2->out.unkn9 = talloc_zero(r2, uint32_t);
     174          50 :                 if (r2->out.unkn9 == NULL) {
     175           0 :                         status = NT_STATUS_NO_MEMORY;
     176           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     177           0 :                         goto fail;
     178             :                 }
     179             : 
     180          50 :                 _mdssvc_cmd(p, r2);
     181          50 :                 break;
     182             :         }
     183          20 :         case 3: { /* mdssvc_close */
     184          20 :                 struct mdssvc_close *r2 = (struct mdssvc_close *)r;
     185          20 :                 if (DEBUGLEVEL >= 10) {
     186           0 :                         NDR_PRINT_FUNCTION_DEBUG(mdssvc_close, NDR_IN, r2);
     187             :                 }
     188          20 :                 NDR_ZERO_STRUCT(r2->out);
     189          20 :                 r2->out.out_handle = talloc_zero(r2, struct policy_handle);
     190          20 :                 if (r2->out.out_handle == NULL) {
     191           0 :                         status = NT_STATUS_NO_MEMORY;
     192           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     193           0 :                         goto fail;
     194             :                 }
     195             : 
     196          20 :                 r2->out.status = talloc_zero(r2, uint32_t);
     197          20 :                 if (r2->out.status == NULL) {
     198           0 :                         status = NT_STATUS_NO_MEMORY;
     199           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     200           0 :                         goto fail;
     201             :                 }
     202             : 
     203          20 :                 _mdssvc_close(p, r2);
     204          20 :                 break;
     205             :         }
     206           0 :         default:
     207           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
     208           0 :                 break;
     209             :         }
     210             : 
     211         120 : fail:
     212             :         /* Unimpersonate */
     213         120 :         if (impersonated) {
     214         120 :                 unbecome_authenticated_pipe_user();
     215             :         }
     216             : 
     217         120 :         p->dce_call = NULL;
     218         120 :         p->mem_ctx = NULL;
     219             :         /* Restore session info */
     220         120 :         p->session_info = pipe_session_info;
     221         120 :         p->auth.auth_type = 0;
     222         120 :         p->auth.auth_level = 0;
     223         120 :         p->auth.auth_context_id = 0;
     224             :         /* Check pipes struct fault state */
     225         120 :         if (p->fault_state != 0) {
     226           6 :                 dce_call->fault_code = p->fault_state;
     227             :         }
     228         120 :         if (dce_call->fault_code != 0) {
     229           6 :                 status = NT_STATUS_NET_WRITE_FAULT;
     230             :         }
     231             : 
     232         120 :         return status;
     233             : }
     234             : 
     235         120 : NTSTATUS mdssvc__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     236             : {
     237         120 :         return mdssvc__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_EXTERNAL);
     238             : }
     239             : 
     240         114 : NTSTATUS mdssvc__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     241             : {
     242         114 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     243             : 
     244         114 :         switch (opnum) {
     245          26 :         case 0: { /* mdssvc_open */
     246          26 :                 struct mdssvc_open *r2 = (struct mdssvc_open *)r;
     247          26 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     248           0 :                         DEBUG(5,("function mdssvc_open replied async\n"));
     249             :                 }
     250          26 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     251           0 :                         NDR_PRINT_FUNCTION_DEBUG(mdssvc_open, NDR_OUT | NDR_SET_VALUES, r2);
     252             :                 }
     253          26 :                 if (dce_call->fault_code != 0) {
     254           0 :                         DBG_WARNING("dcerpc_fault %s in mdssvc_open\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     255             :                 }
     256          26 :                 break;
     257             :         }
     258          22 :         case 1: { /* mdssvc_unknown1 */
     259          22 :                 struct mdssvc_unknown1 *r2 = (struct mdssvc_unknown1 *)r;
     260          22 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     261           0 :                         DEBUG(5,("function mdssvc_unknown1 replied async\n"));
     262             :                 }
     263          22 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     264           0 :                         NDR_PRINT_FUNCTION_DEBUG(mdssvc_unknown1, NDR_OUT | NDR_SET_VALUES, r2);
     265             :                 }
     266          22 :                 if (dce_call->fault_code != 0) {
     267           0 :                         DBG_WARNING("dcerpc_fault %s in mdssvc_unknown1\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     268             :                 }
     269          22 :                 break;
     270             :         }
     271          48 :         case 2: { /* mdssvc_cmd */
     272          48 :                 struct mdssvc_cmd *r2 = (struct mdssvc_cmd *)r;
     273          48 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     274           0 :                         DEBUG(5,("function mdssvc_cmd replied async\n"));
     275             :                 }
     276          48 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     277           0 :                         NDR_PRINT_FUNCTION_DEBUG(mdssvc_cmd, NDR_OUT | NDR_SET_VALUES, r2);
     278             :                 }
     279          48 :                 if (dce_call->fault_code != 0) {
     280           0 :                         DBG_WARNING("dcerpc_fault %s in mdssvc_cmd\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     281             :                 }
     282          48 :                 break;
     283             :         }
     284          18 :         case 3: { /* mdssvc_close */
     285          18 :                 struct mdssvc_close *r2 = (struct mdssvc_close *)r;
     286          18 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     287           0 :                         DEBUG(5,("function mdssvc_close replied async\n"));
     288             :                 }
     289          18 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     290           0 :                         NDR_PRINT_FUNCTION_DEBUG(mdssvc_close, NDR_OUT | NDR_SET_VALUES, r2);
     291             :                 }
     292          18 :                 if (dce_call->fault_code != 0) {
     293           0 :                         DBG_WARNING("dcerpc_fault %s in mdssvc_close\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     294             :                 }
     295          18 :                 break;
     296             :         }
     297           0 :         default:
     298           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
     299           0 :                 break;
     300             :         }
     301             : 
     302         114 :         if (dce_call->fault_code != 0) {
     303           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     304             :         }
     305             : 
     306         114 :         return NT_STATUS_OK;
     307             : }
     308             : 
     309         114 : NTSTATUS mdssvc__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
     310             : {
     311             :         enum ndr_err_code ndr_err;
     312         114 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     313             : 
     314         114 :         ndr_err = ndr_table_mdssvc.calls[opnum].ndr_push(push, NDR_OUT, r);
     315         114 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
     316           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
     317           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     318             :         }
     319             : 
     320         114 :         return NT_STATUS_OK;
     321             : }
     322             : 
     323           0 : NTSTATUS mdssvc__op_local(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     324             : {
     325           0 :         return mdssvc__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_INTERNAL);
     326             : }
     327             : 
     328             : static const struct dcesrv_interface dcesrv_mdssvc_interface = {
     329             :         .name      = "mdssvc",
     330             :         .syntax_id = {{0x885d85fb,0xc754,0x4062,{0xa0,0xe7},{0x68,0x72,0xce,0x00,0x64,0xf4}},2.0},
     331             :         .bind      = mdssvc__op_bind,
     332             :         .unbind    = mdssvc__op_unbind,
     333             :         .ndr_pull  = mdssvc__op_ndr_pull,
     334             :         .dispatch  = mdssvc__op_dispatch,
     335             :         .reply     = mdssvc__op_reply,
     336             :         .ndr_push  = mdssvc__op_ndr_push,
     337             :         .local     = mdssvc__op_local,
     338             : #ifdef DCESRV_INTERFACE_MDSSVC_FLAGS
     339             :         .flags     = DCESRV_INTERFACE_MDSSVC_FLAGS
     340             : #else
     341             :         .flags     = 0
     342             : #endif
     343             : };
     344             : 
     345          56 : static NTSTATUS mdssvc__check_register_in_endpoint(const char *name, struct dcerpc_binding *binding) {
     346          56 :         enum dcerpc_transport_t transport = dcerpc_binding_get_transport(binding);
     347             :         NTSTATUS status;
     348             : 
     349             :         /* If service is disabled, do not register */
     350          56 :         if (rpc_service_mode(name) == RPC_SERVICE_MODE_DISABLED) {
     351           0 :                 return NT_STATUS_NOT_IMPLEMENTED;
     352             :         }
     353             : 
     354             :         /* If service is embedded, register only for ncacn_np
     355             :          * see 8466b3c85e4b835e57e41776853093f4a0edc8b8
     356             :          */
     357          56 :         if (rpc_service_mode(name) == RPC_SERVICE_MODE_EMBEDDED && (transport != NCACN_NP && transport != NCALRPC)) {
     358           0 :                 DBG_INFO("Interface 'mdssvc' not registered in endpoint '%s' as service is embedded\n", name);
     359           0 :                 return NT_STATUS_NOT_SUPPORTED;
     360             :         }
     361             : 
     362             :         /*
     363             :          * If rpc service is external then change the default ncalrpc endpoint,
     364             :          * otherwise if the rpc daemon running this service is configured in
     365             :          * fork mode the forked process will race with main smbd to accept the
     366             :          * connections in the default ncalrpc socket, and the forked process
     367             :          * may not have the requested interface registered.
     368             :          * For example, in the ad_member test environment:
     369             :          *
     370             :          *   rpc_server:lsarpc = external
     371             :          *   rpc_server:samr = external
     372             :          *   rpc_server:netlogon = disabled
     373             :          *   rpc_daemon:lsasd = fork
     374             :          *
     375             :          * With these settings both, the main smbd and all the preforked lsasd
     376             :          * processes would be listening in the default ncalrpc socket if it is
     377             :          * not changed. If a client connection is accepted by one of the lsasd
     378             :          * worker processes and the client asks for an interface not registered
     379             :          * in these processes (winreg for example) it will get an error.
     380             :          */
     381          56 :         if (rpc_service_mode(name) == RPC_SERVICE_MODE_EXTERNAL && transport == NCALRPC) {
     382           0 :                 status = dcerpc_binding_set_string_option(binding, "endpoint", "MDSSVC");
     383           0 :                 if (!NT_STATUS_IS_OK(status)) {
     384           0 :                         return status;
     385             :                 }
     386             :         }
     387             : 
     388          56 :         return NT_STATUS_OK;
     389             : }
     390             : 
     391          28 : static NTSTATUS mdssvc__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
     392             : {
     393             :         uint32_t i;
     394             :         NTSTATUS ret;
     395             :         struct dcerpc_binding *binding;
     396          28 :         struct dcerpc_binding *binding2 = NULL;
     397             : 
     398             : #ifdef DCESRV_INTERFACE_MDSSVC_NCACN_NP_SECONDARY_ENDPOINT
     399             :         const char *ncacn_np_secondary_endpoint = DCESRV_INTERFACE_MDSSVC_NCACN_NP_SECONDARY_ENDPOINT;
     400             : #else
     401          28 :         const char *ncacn_np_secondary_endpoint = NULL;
     402             : #endif
     403             : 
     404          84 :         for (i=0;i<ndr_table_mdssvc.endpoints->count;i++) {
     405          56 :                 const char *name = ndr_table_mdssvc.endpoints->names[i];
     406             : 
     407          56 :                 ret = dcerpc_parse_binding(dce_ctx, name, &binding);
     408          56 :                 if (NT_STATUS_IS_ERR(ret)) {
     409           0 :                         DBG_ERR("Failed to parse binding string '%s'\n", name);
     410           0 :                         return ret;
     411             :                 }
     412             : 
     413          56 :                 ret = mdssvc__check_register_in_endpoint("mdssvc", binding);
     414          56 :                 if (NT_STATUS_IS_ERR(ret)) {
     415           0 :                         talloc_free(binding);
     416           0 :                         continue;
     417             :                 }
     418             : 
     419          56 :                 if (ncacn_np_secondary_endpoint != NULL) {
     420           0 :                         ret = dcerpc_parse_binding(dce_ctx, ncacn_np_secondary_endpoint, &binding2);
     421           0 :                         if (NT_STATUS_IS_ERR(ret)) {
     422           0 :                                 DBG_ERR("Failed to parse 2nd binding string '%s'\n", ncacn_np_secondary_endpoint);
     423           0 :                                 TALLOC_FREE(binding);
     424           0 :                                 return ret;
     425             :                         }
     426             :                 }
     427             : 
     428          56 :                 ret = dcesrv_interface_register_b(dce_ctx, binding, binding2, &dcesrv_mdssvc_interface, NULL);
     429          56 :                 TALLOC_FREE(binding);
     430          56 :                 TALLOC_FREE(binding2);
     431          56 :                 if (!NT_STATUS_IS_OK(ret)) {
     432           0 :                         DBG_ERR("Failed to register endpoint '%s'\n",name);
     433           0 :                         return ret;
     434             :                 }
     435             :         }
     436             : 
     437          28 :         return NT_STATUS_OK;
     438             : }
     439             : 
     440          19 : static NTSTATUS mdssvc__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
     441             : {
     442          19 :         return NT_STATUS_OK;
     443             : }
     444             : 
     445           0 : static bool mdssvc__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
     446             : {
     447           0 :         if (dcesrv_mdssvc_interface.syntax_id.if_version == if_version && GUID_equal(&dcesrv_mdssvc_interface.syntax_id.uuid, uuid)) {
     448           0 :                 memcpy(iface,&dcesrv_mdssvc_interface, sizeof(*iface));
     449           0 :                 return true;
     450             :         }
     451             : 
     452           0 :         return false;
     453             : }
     454             : 
     455           0 : static bool mdssvc__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
     456             : {
     457           0 :         if (strcmp(dcesrv_mdssvc_interface.name, name)==0) {
     458           0 :                 memcpy(iface, &dcesrv_mdssvc_interface, sizeof(*iface));
     459           0 :                 return true;
     460             :         }
     461             : 
     462           0 :         return false;
     463             : }
     464             : 
     465             : static const struct dcesrv_endpoint_server mdssvc_ep_server = {
     466             :         /* fill in our name */
     467             :         .name = "mdssvc",
     468             : 
     469             :         /* Initialization flag */
     470             :         .initialized = false,
     471             : 
     472             :         /* fill in all the operations */
     473             : #ifdef DCESRV_INTERFACE_MDSSVC_INIT_SERVER
     474             :         .init_server = DCESRV_INTERFACE_MDSSVC_INIT_SERVER,
     475             : #else
     476             :         .init_server = mdssvc__op_init_server,
     477             : #endif
     478             : #ifdef DCESRV_INTERFACE_MDSSVC_SHUTDOWN_SERVER
     479             :         .shutdown_server = DCESRV_INTERFACE_MDSSVC_SHUTDOWN_SERVER,
     480             : #else
     481             :         .shutdown_server = mdssvc__op_shutdown_server,
     482             : #endif
     483             :         .interface_by_uuid = mdssvc__op_interface_by_uuid,
     484             :         .interface_by_name = mdssvc__op_interface_by_name
     485             : };
     486             : 
     487          28 : const struct dcesrv_endpoint_server *mdssvc_get_ep_server(void)
     488             : {
     489          28 :         return &mdssvc_ep_server;
     490             : }

Generated by: LCOV version 1.13