LCOV - code coverage report
Current view: top level - source3/rpc_server - rpcd_fsrvp.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 15 18 83.3 %
Date: 2024-04-21 15:09:00 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /*
       2             :  *  Unix SMB/CIFS implementation.
       3             :  *
       4             :  *  This program is free software; you can redistribute it and/or modify
       5             :  *  it under the terms of the GNU General Public License as published by
       6             :  *  the Free Software Foundation; either version 3 of the License, or
       7             :  *  (at your option) any later version.
       8             :  *
       9             :  *  This program is distributed in the hope that it will be useful,
      10             :  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             :  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      12             :  *  GNU General Public License for more details.
      13             :  *
      14             :  *  You should have received a copy of the GNU General Public License
      15             :  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
      16             :  */
      17             : 
      18             : #include "includes.h"
      19             : #include "rpc_worker.h"
      20             : #include "librpc/gen_ndr/ndr_fsrvp.h"
      21             : #include "librpc/gen_ndr/ndr_fsrvp_scompat.h"
      22             : 
      23         101 : static size_t fsrvp_interfaces(
      24             :         const struct ndr_interface_table ***pifaces,
      25             :         void *private_data)
      26             : {
      27             :         static const struct ndr_interface_table *ifaces[] = {
      28             :                 &ndr_table_FileServerVssAgent,
      29             :         };
      30             : 
      31         101 :         if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC) {
      32             :                 /*
      33             :                  * For now, don't do shadow copies on the AD DC. This
      34             :                  * might change in the future, but there's a
      35             :                  * recommendation to split DCs from file servers.
      36             :                  *
      37             :                  * But then we need to put the snap logic into the ad
      38             :                  * dc testenv's smb.conf.
      39             :                  */
      40          18 :                 *pifaces = NULL;
      41          18 :                 return 0;
      42             :         }
      43             : 
      44          83 :         *pifaces = ifaces;
      45          83 :         return ARRAY_SIZE(ifaces);
      46             : }
      47             : 
      48           4 : static NTSTATUS fsrvp_servers(
      49             :         struct dcesrv_context *dce_ctx,
      50             :         const struct dcesrv_endpoint_server ***_ep_servers,
      51             :         size_t *_num_ep_servers,
      52             :         void *private_data)
      53             : {
      54             :         static const struct dcesrv_endpoint_server *ep_servers[1] = { NULL };
      55             : 
      56           4 :         if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC) {
      57           0 :                 *_ep_servers = NULL;
      58           0 :                 *_num_ep_servers = 0;
      59           0 :                 return NT_STATUS_OK;
      60             :         }
      61             : 
      62           4 :         lp_load_with_shares(get_dyn_CONFIGFILE());
      63             : 
      64           4 :         ep_servers[0] = FileServerVssAgent_get_ep_server();
      65             : 
      66           4 :         *_ep_servers = ep_servers;
      67           4 :         *_num_ep_servers = ARRAY_SIZE(ep_servers);
      68           4 :         return NT_STATUS_OK;
      69             : }
      70             : 
      71         105 : int main(int argc, const char *argv[])
      72             : {
      73         105 :         return rpc_worker_main(
      74             :                 argc,
      75             :                 argv,
      76             :                 "rpcd_fsrvp",
      77             :                 5,
      78             :                 60,
      79             :                 fsrvp_interfaces,
      80             :                 fsrvp_servers,
      81             :                 NULL);
      82             : }

Generated by: LCOV version 1.14