2004-04-08 19:06:37 +00:00
/*
Unix SMB / CIFS implementation .
endpoint server for the wkssvc pipe
Copyright ( C ) Stefan ( metze ) Metzmacher 2004
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
*/
# include "includes.h"
2004-11-02 07:42:47 +00:00
# include "rpc_server/dcerpc_server.h"
2004-11-01 10:30:34 +00:00
# include "librpc/gen_ndr/ndr_wkssvc.h"
2004-04-08 19:06:37 +00:00
# include "rpc_server/common/common.h"
/*
wkssvc_NetWkstaGetInfo
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_wkssvc_NetWkstaGetInfo ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct wkssvc_NetWkstaGetInfo * r )
{
struct dcesrv_context * dce_ctx = dce_call - > conn - > dce_ctx ;
2004-12-31 02:48:11 +00:00
ZERO_STRUCT ( r - > out ) ;
2005-12-06 03:53:51 +00:00
r - > out . info = talloc_zero ( mem_ctx , union wkssvc_NetWkstaInfo ) ;
W_ERROR_HAVE_NO_MEMORY ( r - > out . info ) ;
2004-12-31 02:48:11 +00:00
2004-04-08 19:06:37 +00:00
/* NOTE: win2k3 ignores r->in.server_name completly so we do --metze */
switch ( r - > in . level ) {
2004-12-31 02:48:11 +00:00
case 100 :
{
struct wkssvc_NetWkstaInfo100 * info100 ;
2005-01-27 07:08:20 +00:00
info100 = talloc ( mem_ctx , struct wkssvc_NetWkstaInfo100 ) ;
2004-12-31 02:48:11 +00:00
W_ERROR_HAVE_NO_MEMORY ( info100 ) ;
info100 - > platform_id = dcesrv_common_get_platform_id ( mem_ctx , dce_ctx ) ;
2004-12-31 03:32:36 +00:00
info100 - > server_name = dcesrv_common_get_server_name ( mem_ctx , dce_ctx , NULL ) ;
W_ERROR_HAVE_NO_MEMORY ( info100 - > server_name ) ;
info100 - > domain_name = dcesrv_common_get_domain_name ( mem_ctx , dce_ctx ) ;
W_ERROR_HAVE_NO_MEMORY ( info100 - > domain_name ) ;
info100 - > version_major = dcesrv_common_get_version_major ( mem_ctx , dce_ctx ) ;
info100 - > version_minor = dcesrv_common_get_version_minor ( mem_ctx , dce_ctx ) ;
2004-12-31 02:48:11 +00:00
2005-12-06 03:53:51 +00:00
r - > out . info - > info100 = info100 ;
2004-12-31 02:48:11 +00:00
return WERR_OK ;
}
case 101 :
{
struct wkssvc_NetWkstaInfo101 * info101 ;
2005-01-27 07:08:20 +00:00
info101 = talloc ( mem_ctx , struct wkssvc_NetWkstaInfo101 ) ;
2004-12-31 02:48:11 +00:00
W_ERROR_HAVE_NO_MEMORY ( info101 ) ;
info101 - > platform_id = dcesrv_common_get_platform_id ( mem_ctx , dce_ctx ) ;
2004-12-31 03:32:36 +00:00
info101 - > server_name = dcesrv_common_get_server_name ( mem_ctx , dce_ctx , NULL ) ;
W_ERROR_HAVE_NO_MEMORY ( info101 - > server_name ) ;
info101 - > domain_name = dcesrv_common_get_domain_name ( mem_ctx , dce_ctx ) ;
W_ERROR_HAVE_NO_MEMORY ( info101 - > domain_name ) ;
info101 - > version_major = dcesrv_common_get_version_major ( mem_ctx , dce_ctx ) ;
info101 - > version_minor = dcesrv_common_get_version_minor ( mem_ctx , dce_ctx ) ;
2004-12-31 02:48:11 +00:00
info101 - > lan_root = dcesrv_common_get_lan_root ( mem_ctx , dce_ctx ) ;
2005-12-06 03:53:51 +00:00
r - > out . info - > info101 = info101 ;
2004-12-31 02:48:11 +00:00
return WERR_OK ;
}
case 102 :
{
return WERR_ACCESS_DENIED ;
}
case 502 :
{
return WERR_ACCESS_DENIED ;
}
2004-05-04 06:07:52 +00:00
default :
return WERR_UNKNOWN_LEVEL ;
2004-04-08 19:06:37 +00:00
}
2004-12-31 02:48:11 +00:00
return WERR_UNKNOWN_LEVEL ;
2004-04-08 19:06:37 +00:00
}
/*
wkssvc_NetWkstaSetInfo
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_wkssvc_NetWkstaSetInfo ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct wkssvc_NetWkstaSetInfo * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
2005-12-06 03:53:51 +00:00
wkssvc_NetWkstaEnumUsers
2004-04-08 19:06:37 +00:00
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_wkssvc_NetWkstaEnumUsers ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2005-12-06 03:53:51 +00:00
struct wkssvc_NetWkstaEnumUsers * r )
2004-04-08 19:06:37 +00:00
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRWKSTAUSERGETINFO
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRWKSTAUSERGETINFO ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRWKSTAUSERGETINFO * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRWKSTAUSERSETINFO
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRWKSTAUSERSETINFO ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRWKSTAUSERSETINFO * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
wkssvc_NetWkstaTransportEnum
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_wkssvc_NetWkstaTransportEnum ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct wkssvc_NetWkstaTransportEnum * r )
{
2004-04-19 18:21:53 +00:00
r - > out . level = r - > in . level ;
r - > out . totalentries = 0 ;
r - > out . resume_handle = NULL ;
switch ( r - > in . level ) {
2004-05-04 06:07:52 +00:00
case 0 :
2005-12-06 03:53:51 +00:00
r - > out . ctr = talloc ( mem_ctx , union wkssvc_NetWkstaTransportCtr ) ;
W_ERROR_HAVE_NO_MEMORY ( r - > out . ctr ) ;
r - > out . ctr - > ctr0 = talloc ( mem_ctx , struct wkssvc_NetWkstaTransportCtr0 ) ;
W_ERROR_HAVE_NO_MEMORY ( r - > out . ctr - > ctr0 ) ;
2004-04-19 18:21:53 +00:00
2005-12-06 03:53:51 +00:00
r - > out . ctr - > ctr0 - > count = 0 ;
r - > out . ctr - > ctr0 - > array = NULL ;
2004-04-19 18:21:53 +00:00
2004-05-04 06:07:52 +00:00
return WERR_NOT_SUPPORTED ;
2004-04-19 18:21:53 +00:00
default :
2004-05-04 06:07:52 +00:00
return WERR_UNKNOWN_LEVEL ;
2004-04-19 18:21:53 +00:00
}
2004-12-31 03:32:36 +00:00
return WERR_UNKNOWN_LEVEL ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRWKSTATRANSPORTADD
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRWKSTATRANSPORTADD ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRWKSTATRANSPORTADD * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRWKSTATRANSPORTDEL
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRWKSTATRANSPORTDEL ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRWKSTATRANSPORTDEL * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRUSEADD
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRUSEADD ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRUSEADD * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRUSEGETINFO
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRUSEGETINFO ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRUSEGETINFO * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRUSEDEL
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRUSEDEL ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRUSEDEL * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRUSEENUM
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRUSEENUM ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRUSEENUM * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRMESSAGEBUFFERSEND
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRMESSAGEBUFFERSEND ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRMESSAGEBUFFERSEND * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRWORKSTATIONSTATISTICSGET
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRWORKSTATIONSTATISTICSGET ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRWORKSTATIONSTATISTICSGET * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRLOGONDOMAINNAMEADD
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRLOGONDOMAINNAMEADD ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRLOGONDOMAINNAMEADD * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRLOGONDOMAINNAMEDEL
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRLOGONDOMAINNAMEDEL ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRLOGONDOMAINNAMEDEL * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRJOINDOMAIN
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRJOINDOMAIN ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRJOINDOMAIN * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRUNJOINDOMAIN
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRUNJOINDOMAIN ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRUNJOINDOMAIN * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRRENAMEMACHINEINDOMAIN
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRRENAMEMACHINEINDOMAIN ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRRENAMEMACHINEINDOMAIN * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRVALIDATENAME
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRVALIDATENAME ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRVALIDATENAME * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRGETJOININFORMATION
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRGETJOININFORMATION ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRGETJOININFORMATION * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRGETJOINABLEOUS
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRGETJOINABLEOUS ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRGETJOINABLEOUS * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRJOINDOMAIN2
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_wkssvc_NetrJoinDomain2 ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2005-12-06 03:53:51 +00:00
struct wkssvc_NetrJoinDomain2 * r )
2004-04-08 19:06:37 +00:00
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRUNJOINDOMAIN2
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_wkssvc_NetrUnjoinDomain2 ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2005-12-06 03:53:51 +00:00
struct wkssvc_NetrUnjoinDomain2 * r )
2004-04-08 19:06:37 +00:00
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRRENAMEMACHINEINDOMAIN2
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_wkssvc_NetrRenameMachineInDomain2 ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2005-12-06 03:53:51 +00:00
struct wkssvc_NetrRenameMachineInDomain2 * r )
2004-04-08 19:06:37 +00:00
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRVALIDATENAME2
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRVALIDATENAME2 ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRVALIDATENAME2 * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRGETJOINABLEOUS2
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRGETJOINABLEOUS2 ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRGETJOINABLEOUS2 * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRADDALTERNATECOMPUTERNAME
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_wkssvc_NetrAddAlternateComputerName ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2005-12-06 03:53:51 +00:00
struct wkssvc_NetrAddAlternateComputerName * r )
2004-04-08 19:06:37 +00:00
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_wkssvc_NetrRemoveAlternateComputerName ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2005-12-06 03:53:51 +00:00
struct wkssvc_NetrRemoveAlternateComputerName * r )
2004-04-08 19:06:37 +00:00
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRSETPRIMARYCOMPUTERNAME
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRSETPRIMARYCOMPUTERNAME ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRSETPRIMARYCOMPUTERNAME * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/*
WKSSVC_NETRENUMERATECOMPUTERNAMES
*/
2007-01-17 14:49:36 +00:00
static WERROR dcesrv_WKSSVC_NETRENUMERATECOMPUTERNAMES ( struct dcesrv_call_state * dce_call , TALLOC_CTX * mem_ctx ,
2004-04-08 19:06:37 +00:00
struct WKSSVC_NETRENUMERATECOMPUTERNAMES * r )
{
2004-05-25 03:04:26 +00:00
DCESRV_FAULT ( DCERPC_FAULT_OP_RNG_ERROR ) ;
2004-04-08 19:06:37 +00:00
}
/* include the generated boilerplate */
# include "librpc/gen_ndr/ndr_wkssvc_s.c"