LCOV - code coverage report
Current view: top level - source4/rpc_server/wkssvc - dcesrv_wkssvc.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 79 103 76.7 %
Date: 2024-04-21 15:09:00 Functions: 23 31 74.2 %

          Line data    Source code
       1             : /*
       2             :    Unix SMB/CIFS implementation.
       3             : 
       4             :    endpoint server for the wkssvc pipe
       5             : 
       6             :    Copyright (C) Stefan (metze) Metzmacher 2004
       7             : 
       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 3 of the License, or
      11             :    (at your option) any later version.
      12             : 
      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.
      17             : 
      18             :    You should have received a copy of the GNU General Public License
      19             :    along with this program.  If not, see <http://www.gnu.org/licenses/>.
      20             : */
      21             : 
      22             : #include "includes.h"
      23             : #include "rpc_server/dcerpc_server.h"
      24             : #include "librpc/gen_ndr/ndr_wkssvc.h"
      25             : #include "librpc/gen_ndr/ndr_srvsvc.h"
      26             : #include "rpc_server/common/common.h"
      27             : #include "param/param.h"
      28             : 
      29             : /*
      30             :   wkssvc_NetWkstaGetInfo
      31             : */
      32          11 : static WERROR dcesrv_wkssvc_NetWkstaGetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
      33             :                        struct wkssvc_NetWkstaGetInfo *r)
      34             : {
      35          11 :         struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx;
      36          11 :         struct dcerpc_server_info *server_info = lpcfg_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx);
      37             : 
      38             :         /* NOTE: win2k3 ignores r->in.server_name completely so we do --metze */
      39             : 
      40          11 :         switch(r->in.level) {
      41           5 :         case 100:
      42             :         {
      43           0 :                 struct wkssvc_NetWkstaInfo100 *info100;
      44             : 
      45           5 :                 info100 = talloc(mem_ctx, struct wkssvc_NetWkstaInfo100);
      46           5 :                 W_ERROR_HAVE_NO_MEMORY(info100);
      47             : 
      48           5 :                 info100->platform_id = dcesrv_common_get_platform_id(mem_ctx, dce_ctx);
      49           5 :                 info100->server_name = dcesrv_common_get_server_name(mem_ctx, dce_ctx, NULL);
      50           5 :                 W_ERROR_HAVE_NO_MEMORY(info100->server_name);
      51           5 :                 info100->domain_name = server_info->domain_name;
      52           5 :                 info100->version_major       = server_info->version_major;
      53           5 :                 info100->version_minor       = server_info->version_minor;
      54             : 
      55           5 :                 r->out.info->info100 = info100;
      56           5 :                 return WERR_OK;
      57             :         }
      58           3 :         case 101:
      59             :         {
      60           0 :                 struct wkssvc_NetWkstaInfo101 *info101;
      61             : 
      62           3 :                 info101 = talloc(mem_ctx, struct wkssvc_NetWkstaInfo101);
      63           3 :                 W_ERROR_HAVE_NO_MEMORY(info101);
      64             : 
      65           3 :                 info101->platform_id = dcesrv_common_get_platform_id(mem_ctx, dce_ctx);
      66           3 :                 info101->server_name = dcesrv_common_get_server_name(mem_ctx, dce_ctx, NULL);
      67           3 :                 W_ERROR_HAVE_NO_MEMORY(info101->server_name);
      68           3 :                 info101->domain_name = server_info->domain_name;
      69           3 :                 info101->version_major       = server_info->version_major;
      70           3 :                 info101->version_minor       = server_info->version_minor;
      71           3 :                 info101->lan_root    = dcesrv_common_get_lan_root(mem_ctx, dce_ctx);
      72             : 
      73           3 :                 r->out.info->info101 = info101;
      74           3 :                 return WERR_OK;
      75             :         }
      76           3 :         case 102:
      77             :         {
      78           3 :                 return WERR_ACCESS_DENIED;
      79             :         }
      80           0 :         case 502:
      81             :         {
      82           0 :                 return WERR_ACCESS_DENIED;
      83             :         }
      84           0 :         default:
      85           0 :                 return WERR_INVALID_LEVEL;
      86             :         }
      87             : }
      88             : 
      89             : 
      90             : /*
      91             :   wkssvc_NetWkstaSetInfo
      92             : */
      93           0 : static WERROR dcesrv_wkssvc_NetWkstaSetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
      94             :                        struct wkssvc_NetWkstaSetInfo *r)
      95             : {
      96           0 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
      97             : }
      98             : 
      99             : 
     100             : /*
     101             :   wkssvc_NetWkstaEnumUsers
     102             : */
     103           3 : static WERROR dcesrv_wkssvc_NetWkstaEnumUsers(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     104             :                                        struct wkssvc_NetWkstaEnumUsers *r)
     105             : {
     106           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     107             : }
     108             : 
     109             : 
     110             : /*
     111             :   wkssvc_NetrWkstaUserGetInfo
     112             : */
     113           3 : static WERROR dcesrv_wkssvc_NetrWkstaUserGetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     114             :                        struct wkssvc_NetrWkstaUserGetInfo *r)
     115             : {
     116           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     117             : }
     118             : 
     119             : 
     120             : /*
     121             :   wkssvc_NetrWkstaUserSetInfo
     122             : */
     123           0 : static WERROR dcesrv_wkssvc_NetrWkstaUserSetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     124             :                        struct wkssvc_NetrWkstaUserSetInfo *r)
     125             : {
     126           0 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     127             : }
     128             : 
     129             : 
     130             : /*
     131             :   wkssvc_NetWkstaTransportEnum
     132             : */
     133           3 : static WERROR dcesrv_wkssvc_NetWkstaTransportEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     134             :                        struct wkssvc_NetWkstaTransportEnum *r)
     135             : {
     136           3 :         switch (r->in.info->level) {
     137           3 :         case 0:
     138           3 :                 r->out.info->ctr.ctr0 = talloc(mem_ctx, struct wkssvc_NetWkstaTransportCtr0);
     139           3 :                 W_ERROR_HAVE_NO_MEMORY(r->out.info->ctr.ctr0);
     140             : 
     141           3 :                 r->out.info->ctr.ctr0->count = 0;
     142           3 :                 r->out.info->ctr.ctr0->array = NULL;
     143             : 
     144           3 :                 return WERR_NOT_SUPPORTED;
     145             : 
     146           0 :         default:
     147           0 :                 return WERR_INVALID_LEVEL;
     148             :         }
     149             : }
     150             : 
     151             : 
     152             : /*
     153             :   wkssvc_NetrWkstaTransportAdd
     154             : */
     155           3 : static WERROR dcesrv_wkssvc_NetrWkstaTransportAdd(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     156             :                        struct wkssvc_NetrWkstaTransportAdd *r)
     157             : {
     158           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     159             : }
     160             : 
     161             : 
     162             : /*
     163             :   wkssvc_NetrWkstaTransportDel
     164             : */
     165           3 : static WERROR dcesrv_wkssvc_NetrWkstaTransportDel(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     166             :                        struct wkssvc_NetrWkstaTransportDel *r)
     167             : {
     168           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     169             : }
     170             : 
     171             : 
     172             : /*
     173             :   wkssvc_NetrUseAdd
     174             : */
     175           3 : static WERROR dcesrv_wkssvc_NetrUseAdd(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     176             :                        struct wkssvc_NetrUseAdd *r)
     177             : {
     178           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     179             : }
     180             : 
     181             : 
     182             : /*
     183             :   wkssvc_NetrUseGetInfo
     184             : */
     185           0 : static WERROR dcesrv_wkssvc_NetrUseGetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     186             :                        struct wkssvc_NetrUseGetInfo *r)
     187             : {
     188           0 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     189             : }
     190             : 
     191             : 
     192             : /*
     193             :   wkssvc_NetrUseDel
     194             : */
     195           3 : static WERROR dcesrv_wkssvc_NetrUseDel(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     196             :                        struct wkssvc_NetrUseDel *r)
     197             : {
     198           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     199             : }
     200             : 
     201             : 
     202             : /*
     203             :   wkssvc_NetrUseEnum
     204             : */
     205           6 : static WERROR dcesrv_wkssvc_NetrUseEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     206             :                        struct wkssvc_NetrUseEnum *r)
     207             : {
     208           6 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     209             : }
     210             : 
     211             : 
     212             : /*
     213             :   wkssvc_NetrMessageBufferSend
     214             : */
     215           3 : static WERROR dcesrv_wkssvc_NetrMessageBufferSend(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     216             :                        struct wkssvc_NetrMessageBufferSend *r)
     217             : {
     218           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     219             : }
     220             : 
     221             : 
     222             : /*
     223             :   wkssvc_NetrWorkstationStatisticsGet
     224             : */
     225           3 : static WERROR dcesrv_wkssvc_NetrWorkstationStatisticsGet(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     226             :                        struct wkssvc_NetrWorkstationStatisticsGet *r)
     227             : {
     228           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     229             : }
     230             : 
     231             : 
     232             : /*
     233             :   wkssvc_NetrLogonDomainNameAdd
     234             : */
     235           3 : static WERROR dcesrv_wkssvc_NetrLogonDomainNameAdd(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     236             :                        struct wkssvc_NetrLogonDomainNameAdd *r)
     237             : {
     238           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     239             : }
     240             : 
     241             : 
     242             : /*
     243             :   wkssvc_NetrLogonDomainNameDel
     244             : */
     245           3 : static WERROR dcesrv_wkssvc_NetrLogonDomainNameDel(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     246             :                        struct wkssvc_NetrLogonDomainNameDel *r)
     247             : {
     248           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     249             : }
     250             : 
     251             : 
     252             : /*
     253             :   wkssvc_NetrJoinDomain
     254             : */
     255           3 : static WERROR dcesrv_wkssvc_NetrJoinDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     256             :                        struct wkssvc_NetrJoinDomain *r)
     257             : {
     258           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     259             : }
     260             : 
     261             : 
     262             : /*
     263             :   wkssvc_NetrUnjoinDomain
     264             : */
     265           3 : static WERROR dcesrv_wkssvc_NetrUnjoinDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     266             :                        struct wkssvc_NetrUnjoinDomain *r)
     267             : {
     268           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     269             : }
     270             : 
     271             : 
     272             : /*
     273             :   wkssvc_NetrRenameMachineInDomain
     274             : */
     275           0 : static WERROR dcesrv_wkssvc_NetrRenameMachineInDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     276             :                        struct wkssvc_NetrRenameMachineInDomain *r)
     277             : {
     278           0 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     279             : }
     280             : 
     281             : 
     282             : /*
     283             :   wkssvc_NetrValidateName
     284             : */
     285           3 : static WERROR dcesrv_wkssvc_NetrValidateName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     286             :                        struct wkssvc_NetrValidateName *r)
     287             : {
     288           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     289             : }
     290             : 
     291             : 
     292             : /*
     293             :   wkssvc_NetrGetJoinInformation
     294             : */
     295           3 : static WERROR dcesrv_wkssvc_NetrGetJoinInformation(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     296             :                        struct wkssvc_NetrGetJoinInformation *r)
     297             : {
     298           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     299             : }
     300             : 
     301             : 
     302             : /*
     303             :   wkssvc_NetrGetJoinableOus
     304             : */
     305           3 : static WERROR dcesrv_wkssvc_NetrGetJoinableOus(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     306             :                        struct wkssvc_NetrGetJoinableOus *r)
     307             : {
     308           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     309             : }
     310             : 
     311             : 
     312             : /*
     313             :   WKSSVC_NETRJOINDOMAIN2
     314             : */
     315           0 : static WERROR dcesrv_wkssvc_NetrJoinDomain2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     316             :                        struct wkssvc_NetrJoinDomain2 *r)
     317             : {
     318           0 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     319             : }
     320             : 
     321             : 
     322             : /*
     323             :   WKSSVC_NETRUNJOINDOMAIN2
     324             : */
     325           0 : static WERROR dcesrv_wkssvc_NetrUnjoinDomain2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     326             :                        struct wkssvc_NetrUnjoinDomain2 *r)
     327             : {
     328           0 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     329             : }
     330             : 
     331             : 
     332             : /*
     333             :   wkssvc_NetrRenameMachineInDomain2
     334             : */
     335           0 : static WERROR dcesrv_wkssvc_NetrRenameMachineInDomain2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     336             :                        struct wkssvc_NetrRenameMachineInDomain2 *r)
     337             : {
     338           0 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     339             : }
     340             : 
     341             : 
     342             : /*
     343             :   wkssvc_NetrValidateName2
     344             : */
     345           3 : static WERROR dcesrv_wkssvc_NetrValidateName2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     346             :                        struct wkssvc_NetrValidateName2 *r)
     347             : {
     348           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     349             : }
     350             : 
     351             : 
     352             : /*
     353             :   wkssvc_NetrGetJoinableOus2
     354             : */
     355           3 : static WERROR dcesrv_wkssvc_NetrGetJoinableOus2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     356             :                        struct wkssvc_NetrGetJoinableOus2 *r)
     357             : {
     358           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     359             : }
     360             : 
     361             : 
     362             : /*
     363             :   wkssvc_NetrAddAlternateComputername
     364             : */
     365           3 : static WERROR dcesrv_wkssvc_NetrAddAlternateComputerName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     366             :                        struct wkssvc_NetrAddAlternateComputerName *r)
     367             : {
     368           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     369             : }
     370             : 
     371             : 
     372             : /*
     373             :   wkssvc_NetrRemoveAlternateComputername
     374             : */
     375           3 : static WERROR dcesrv_wkssvc_NetrRemoveAlternateComputerName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     376             :                        struct wkssvc_NetrRemoveAlternateComputerName *r)
     377             : {
     378           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     379             : }
     380             : 
     381             : 
     382             : /*
     383             :   wkssvc_NetrSetPrimaryComputername
     384             : */
     385           0 : static WERROR dcesrv_wkssvc_NetrSetPrimaryComputername(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     386             :                        struct wkssvc_NetrSetPrimaryComputername *r)
     387             : {
     388           0 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     389             : }
     390             : 
     391             : 
     392             : /*
     393             :   wkssvc_NetrEnumerateComputerNames
     394             : */
     395           3 : static WERROR dcesrv_wkssvc_NetrEnumerateComputerNames(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
     396             :                        struct wkssvc_NetrEnumerateComputerNames *r)
     397             : {
     398           3 :         DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
     399             : }
     400             : 
     401             : 
     402             : /* include the generated boilerplate */
     403             : #include "librpc/gen_ndr/ndr_wkssvc_s.c"

Generated by: LCOV version 1.14