summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-09-20 19:26:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:00:53 -0500
commitb7d069097bdc8d1d9a0694225dd1583cb60c7b3c (patch)
tree0beab697fd861f1d97ad583373be06baec50da6f /source3
parent5cadb916220155bc0532f2c8a5facb690bc99ea2 (diff)
downloadsamba-b7d069097bdc8d1d9a0694225dd1583cb60c7b3c.tar.gz
samba-b7d069097bdc8d1d9a0694225dd1583cb60c7b3c.tar.bz2
samba-b7d069097bdc8d1d9a0694225dd1583cb60c7b3c.zip
r18739: * Get the wkssvc patch right this time.
* Remove the old wkssvc server, client, & parsing code. * Update srv_wkssvc_nt.c with stubs for the remaining stubs (This used to be commit 0cb79ee13fd78b515a48b2c72d91596ed21e41a8)
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in11
-rw-r--r--source3/configure.in4
-rw-r--r--source3/librpc/gen_ndr/ndr_wkssvc.c18
-rw-r--r--source3/librpc/gen_ndr/wkssvc.h4
-rw-r--r--source3/librpc/idl/wkssvc.idl2
-rw-r--r--source3/rpc_client/cli_wkssvc.c68
-rw-r--r--source3/rpc_parse/parse_wks.c178
-rw-r--r--source3/rpc_server/srv_wkssvc.c78
-rw-r--r--source3/rpc_server/srv_wkssvc_nt.c323
9 files changed, 322 insertions, 364 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 709dc5caa0..0044c1d13d 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -211,7 +211,7 @@ LIBNDR_OBJ = librpc/ndr/ndr_basic.o librpc/ndr/ndr.o librpc/ndr/ndr_misc.o \
LIBNDR_GEN_OBJ = librpc/gen_ndr/ndr_unixinfo.o librpc/gen_ndr/ndr_lsa.o \
librpc/gen_ndr/ndr_dfs.o librpc/gen_ndr/ndr_echo.o \
librpc/gen_ndr/ndr_winreg.o librpc/gen_ndr/ndr_initshutdown.o \
- librpc/gen_ndr/ndr_eventlog.o
+ librpc/gen_ndr/ndr_eventlog.o librpc/gen_ndr/ndr_wkssvc.o
RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
@@ -292,7 +292,6 @@ LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \
LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \
rpc_client/cli_netlogon.o rpc_client/cli_srvsvc.o \
- rpc_client/cli_wkssvc.o \
rpc_client/cli_reg.o $(RPC_CLIENT_OBJ) \
rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o \
rpc_client/cli_ds.o \
@@ -327,7 +326,7 @@ RPC_LSA_DS_OBJ = rpc_server/srv_lsa_ds.o rpc_server/srv_lsa_ds_nt.o
RPC_SVC_OBJ = rpc_server/srv_srvsvc.o rpc_server/srv_srvsvc_nt.o
-RPC_WKS_OBJ = rpc_server/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o
+RPC_WKS_OBJ = librpc/gen_ndr/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o
RPC_SVCCTL_OBJ = rpc_server/srv_svcctl.o rpc_server/srv_svcctl_nt.o \
services/svc_spoolss.o services/svc_rcinit.o services/services_db.o \
@@ -356,10 +355,8 @@ RPC_PARSE_OBJ1 = $(RPC_PARSE_OBJ0) rpc_parse/parse_sec.o
RPC_PARSE_OBJ = rpc_parse/parse_lsa.o rpc_parse/parse_net.o \
rpc_parse/parse_reg.o rpc_parse/parse_rpc.o \
rpc_parse/parse_samr.o rpc_parse/parse_srv.o \
- rpc_parse/parse_wks.o rpc_parse/parse_ds.o \
- rpc_parse/parse_spoolss.o \
- rpc_parse/parse_shutdown.o \
- rpc_parse/parse_svcctl.o \
+ rpc_parse/parse_ds.o rpc_parse/parse_spoolss.o \
+ rpc_parse/parse_shutdown.o rpc_parse/parse_svcctl.o \
rpc_parse/parse_eventlog.o rpc_parse/parse_buffer.o \
rpc_parse/parse_ntsvcs.o $(REGOBJS_OBJ)
diff --git a/source3/configure.in b/source3/configure.in
index 975df0e948..a0e19c1e17 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -579,7 +579,7 @@ DYNEXP=
dnl Add modules that have to be built by default here
dnl These have to be built static:
-default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_reg rpc_lsa_ds rpc_wks rpc_svcctl rpc_ntsvcs rpc_net rpc_netdfs rpc_srv rpc_spoolss rpc_eventlog rpc_unixinfo auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin vfs_default"
+default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_reg rpc_lsa_ds rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_net rpc_netdfs rpc_srv rpc_spoolss rpc_eventlog rpc_unixinfo auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin vfs_default"
dnl These are preferably build shared, and static if dlopen() is not available
default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy charset_CP850 charset_CP437 auth_script"
@@ -5618,7 +5618,7 @@ SMB_SUBSYSTEM(PDB,passdb/pdb_interface.o)
SMB_MODULE(rpc_lsa, \$(RPC_LSA_OBJ), "bin/librpc_lsarpc.$SHLIBEXT", RPC)
SMB_MODULE(rpc_reg, \$(RPC_REG_OBJ), "bin/librpc_winreg.$SHLIBEXT", RPC)
SMB_MODULE(rpc_lsa_ds, \$(RPC_LSA_DS_OBJ), "bin/librpc_lsa_ds.$SHLIBEXT", RPC)
-SMB_MODULE(rpc_wks, \$(RPC_WKS_OBJ), "bin/librpc_wkssvc.$SHLIBEXT", RPC)
+SMB_MODULE(rpc_wkssvc, \$(RPC_WKS_OBJ), "bin/librpc_wkssvc.$SHLIBEXT", RPC)
SMB_MODULE(rpc_svcctl, \$(RPC_SVCCTL_OBJ), "bin/librpc_svcctl.$SHLIBEXT", RPC)
SMB_MODULE(rpc_ntsvcs, \$(RPC_NTSVCS_OBJ), "bin/librpc_ntsvcs.$SHLIBEXT", RPC)
SMB_MODULE(rpc_net, \$(RPC_NETLOG_OBJ), "bin/librpc_NETLOGON.$SHLIBEXT", RPC)
diff --git a/source3/librpc/gen_ndr/ndr_wkssvc.c b/source3/librpc/gen_ndr/ndr_wkssvc.c
index 60bbc857d1..9455d09c5f 100644
--- a/source3/librpc/gen_ndr/ndr_wkssvc.c
+++ b/source3/librpc/gen_ndr/ndr_wkssvc.c
@@ -2680,7 +2680,8 @@ NTSTATUS ndr_push_wkssvc_NetWkstaTransportEnum(struct ndr_push *ndr, int flags,
if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.level));
if (r->in.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, r->in.level));
+ if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.ctr, *r->in.level));
NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer));
if (r->in.resume_handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
@@ -2690,7 +2691,8 @@ NTSTATUS ndr_push_wkssvc_NetWkstaTransportEnum(struct ndr_push *ndr, int flags,
if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level));
if (r->out.ctr == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, r->out.level));
+ if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level));
NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.totalentries));
if (r->out.totalentries) {
@@ -2745,7 +2747,8 @@ NTSTATUS ndr_pull_wkssvc_NetWkstaTransportEnum(struct ndr_pull *ndr, int flags,
}
_mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->in.ctr, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.ctr, r->in.level));
+ if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.ctr, *r->in.level));
NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer));
@@ -2776,7 +2779,8 @@ NTSTATUS ndr_pull_wkssvc_NetWkstaTransportEnum(struct ndr_pull *ndr, int flags,
}
_mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, r->out.level));
+ if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level));
NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_totalentries));
@@ -2825,7 +2829,8 @@ _PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportEnum(struct ndr_print *ndr, cons
ndr->depth--;
ndr_print_ptr(ndr, "ctr", r->in.ctr);
ndr->depth++;
- ndr_print_set_switch_value(ndr, r->in.ctr, r->in.level);
+ if (r->in.level == NULL) return;
+ ndr_print_set_switch_value(ndr, r->in.ctr, *r->in.level);
ndr_print_wkssvc_NetWkstaTransportCtr(ndr, "ctr", r->in.ctr);
ndr->depth--;
ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer);
@@ -2844,7 +2849,8 @@ _PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportEnum(struct ndr_print *ndr, cons
ndr->depth--;
ndr_print_ptr(ndr, "ctr", r->out.ctr);
ndr->depth++;
- ndr_print_set_switch_value(ndr, r->out.ctr, r->out.level);
+ if (r->out.level == NULL) return;
+ ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level);
ndr_print_wkssvc_NetWkstaTransportCtr(ndr, "ctr", r->out.ctr);
ndr->depth--;
ndr_print_ptr(ndr, "totalentries", r->out.totalentries);
diff --git a/source3/librpc/gen_ndr/wkssvc.h b/source3/librpc/gen_ndr/wkssvc.h
index f6b7d1fafb..84e6d19853 100644
--- a/source3/librpc/gen_ndr/wkssvc.h
+++ b/source3/librpc/gen_ndr/wkssvc.h
@@ -247,14 +247,14 @@ struct wkssvc_NetWkstaTransportEnum {
struct {
const char *server_name;/* [unique,charset(UTF16)] */
uint32_t *level;/* [ref] */
- union wkssvc_NetWkstaTransportCtr *ctr;/* [ref,switch_is(level)] */
+ union wkssvc_NetWkstaTransportCtr *ctr;/* [ref,switch_is(*level)] */
uint32_t max_buffer;
uint32_t *resume_handle;/* [ref] */
} in;
struct {
uint32_t *level;/* [ref] */
- union wkssvc_NetWkstaTransportCtr *ctr;/* [ref,switch_is(level)] */
+ union wkssvc_NetWkstaTransportCtr *ctr;/* [ref,switch_is(*level)] */
uint32_t *totalentries;/* [unique] */
uint32_t *resume_handle;/* [ref] */
WERROR result;
diff --git a/source3/librpc/idl/wkssvc.idl b/source3/librpc/idl/wkssvc.idl
index 8c789fd8ca..80fe4efa1a 100644
--- a/source3/librpc/idl/wkssvc.idl
+++ b/source3/librpc/idl/wkssvc.idl
@@ -217,7 +217,7 @@
WERROR wkssvc_NetWkstaTransportEnum (
[in] [string,charset(UTF16)] uint16 *server_name,
[in,out,ref] uint32 *level,
- [in,out,switch_is(level),ref] wkssvc_NetWkstaTransportCtr *ctr,
+ [in,out,switch_is(*level),ref] wkssvc_NetWkstaTransportCtr *ctr,
[in] uint32 max_buffer,
[out] uint32 *totalentries,
[in,out,ref] uint32 *resume_handle
diff --git a/source3/rpc_client/cli_wkssvc.c b/source3/rpc_client/cli_wkssvc.c
deleted file mode 100644
index d8e97beb64..0000000000
--- a/source3/rpc_client/cli_wkssvc.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- NT Domain Authentication SMB / MSRPC client
- Copyright (C) Andrew Tridgell 1994-2000
- Copyright (C) Tim Potter 2001
- Copyright (C) Rafal Szczesniak 2002
- Copyright (C) Jeremy Allison 2005.
-
- 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 02139, USA.
-*/
-
-#include "includes.h"
-
-/**
- * WksQueryInfo rpc call (like query for server's capabilities)
- *
- * @param initialised client structure with \PIPE\wkssvc opened
- * @param mem_ctx memory context assigned to this rpc binding
- * @param wks100 WksQueryInfo structure
- *
- * @return NTSTATUS of rpc call
- */
-
-NTSTATUS rpccli_wks_query_info(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- WKS_INFO_100 *wks100)
-{
- prs_struct qbuf;
- prs_struct rbuf;
- WKS_Q_QUERY_INFO q;
- WKS_R_QUERY_INFO r;
-
- if (cli == NULL || wks100 == NULL)
- return NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(4, ("WksQueryInfo\n"));
-
- /* init query structure with rpc call arguments */
- init_wks_q_query_info(&q, cli->cli->desthost, 100);
- r.wks100 = wks100;
-
- CLI_DO_RPC(cli, mem_ctx, PI_WKSSVC, WKS_QUERY_INFO,
- q, r,
- qbuf, rbuf,
- wks_io_q_query_info,
- wks_io_r_query_info,
- NT_STATUS_UNSUCCESSFUL);
-
- /* check returnet status code */
- if (NT_STATUS_IS_ERR(r.status)) {
- /* report the error */
- DEBUG(0,("WKS_R_QUERY_INFO: %s\n", nt_errstr(r.status)));
- return r.status;
- }
-
- return NT_STATUS_OK;
-}
diff --git a/source3/rpc_parse/parse_wks.c b/source3/rpc_parse/parse_wks.c
deleted file mode 100644
index b6de058652..0000000000
--- a/source3/rpc_parse/parse_wks.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Unix SMB/CIFS implementation.
- * RPC Pipe client / server routines
- * Copyright (C) Andrew Tridgell 1992-1997,
- * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
- * Copyright (C) Paul Ashton 1997.
- *
- * 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 02139, USA.
- */
-
-#include "includes.h"
-
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_RPC_PARSE
-
-/*******************************************************************
- Init
- ********************************************************************/
-
-void init_wks_q_query_info(WKS_Q_QUERY_INFO *q_u,
- char *server, uint16 switch_value)
-{
- DEBUG(5,("init_wks_q_query_info\n"));
-
- init_buf_unistr2(&q_u->uni_srv_name, &q_u->ptr_srv_name, server);
- q_u->switch_value = switch_value;
-}
-
-/*******************************************************************
- Reads or writes a WKS_Q_QUERY_INFO structure.
-********************************************************************/
-
-BOOL wks_io_q_query_info(const char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "wks_io_q_query_info");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("ptr_srv_name", ps, depth, &q_u->ptr_srv_name))
- return False;
- if(!smb_io_unistr2("", &q_u->uni_srv_name, q_u->ptr_srv_name, ps, depth))
- return False;
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint16("switch_value", ps, depth, &q_u->switch_value))
- return False;
- if(!prs_align(ps))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- wks_info_100
- ********************************************************************/
-
-void init_wks_info_100(WKS_INFO_100 *inf,
- uint32 platform_id, uint32 ver_major, uint32 ver_minor,
- char *my_name, char *domain_name)
-{
- DEBUG(5,("Init WKS_INFO_100: %d\n", __LINE__));
-
- inf->platform_id = platform_id; /* 0x0000 01f4 - unknown */
- inf->ver_major = ver_major; /* os major version */
- inf->ver_minor = ver_minor; /* os minor version */
-
- init_buf_unistr2(&inf->uni_compname, &inf->ptr_compname, my_name );
- init_buf_unistr2(&inf->uni_lan_grp, &inf->ptr_lan_grp, domain_name);
-}
-
-/*******************************************************************
- Reads or writes a WKS_INFO_100 structure.
-********************************************************************/
-
-static BOOL wks_io_wks_info_100(const char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth)
-{
- if (inf == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "wks_io_wks_info_100");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("platform_id ", ps, depth, &inf->platform_id)) /* 0x0000 01f4 - unknown */
- return False;
- if(!prs_uint32("ptr_compname", ps, depth, &inf->ptr_compname)) /* pointer to computer name */
- return False;
- if(!prs_uint32("ptr_lan_grp ", ps, depth, &inf->ptr_lan_grp)) /* pointer to LAN group name */
- return False;
- if(!prs_uint32("ver_major ", ps, depth, &inf->ver_major)) /* 4 - major os version */
- return False;
- if(!prs_uint32("ver_minor ", ps, depth, &inf->ver_minor)) /* 0 - minor os version */
- return False;
-
- if(!smb_io_unistr2("", &inf->uni_compname, inf->ptr_compname, ps, depth))
- return False;
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_unistr2("", &inf->uni_lan_grp, inf->ptr_lan_grp , ps, depth))
- return False;
- if(!prs_align(ps))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- Inits WKS_R_QUERY_INFO.
-
- only supports info level 100 at the moment.
-
- ********************************************************************/
-
-void init_wks_r_query_info(WKS_R_QUERY_INFO *r_u,
- uint32 switch_value, WKS_INFO_100 *wks100,
- NTSTATUS status)
-{
- DEBUG(5,("init_wks_r_unknown_0: %d\n", __LINE__));
-
- r_u->switch_value = switch_value; /* same as in request */
-
- r_u->ptr_1 = 1; /* pointer 1 */
- r_u->wks100 = wks100;
-
- r_u->status = status;
-}
-
-/*******************************************************************
- Reads or writes a structure.
-********************************************************************/
-
-BOOL wks_io_r_query_info(const char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth)
-{
- if (r_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "wks_io_r_query_info");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint16("switch_value", ps, depth, &r_u->switch_value)) /* level 100 (0x64) */
- return False;
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("ptr_1 ", ps, depth, &r_u->ptr_1)) /* pointer 1 */
- return False;
- if(!wks_io_wks_info_100("inf", r_u->wks100, ps, depth))
- return False;
-
- if(!prs_ntstatus("status ", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
diff --git a/source3/rpc_server/srv_wkssvc.c b/source3/rpc_server/srv_wkssvc.c
deleted file mode 100644
index b5c1af34d9..0000000000
--- a/source3/rpc_server/srv_wkssvc.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Unix SMB/CIFS implementation.
- * RPC Pipe client / server routines
- * Copyright (C) Andrew Tridgell 1992-1997,
- * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
- * Copyright (C) Paul Ashton 1997,
- * Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003.
- *
- * 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 02139, USA.
- */
-
-/* This is the interface to the wks pipe. */
-
-#include "includes.h"
-
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_RPC_SRV
-
-/*******************************************************************
- api_wks_query_info
- ********************************************************************/
-
-static BOOL api_wks_query_info(pipes_struct *p)
-{
- WKS_Q_QUERY_INFO q_u;
- WKS_R_QUERY_INFO r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- /* grab the net share enum */
- if(!wks_io_q_query_info("", &q_u, data, 0))
- return False;
-
- r_u.status = _wks_query_info(p, &q_u, &r_u);
-
- /* store the response in the SMB stream */
- if(!wks_io_r_query_info("", &r_u, rdata, 0))
- return False;
-
- return True;
-}
-
-
-/*******************************************************************
- \PIPE\wkssvc commands
- ********************************************************************/
-
-static struct api_struct api_wks_cmds[] =
-{
- { "WKS_Q_QUERY_INFO", WKS_QUERY_INFO, api_wks_query_info }
-};
-
-void wkssvc_get_pipe_fns( struct api_struct **fns, int *n_fns )
-{
- *fns = api_wks_cmds;
- *n_fns = sizeof(api_wks_cmds) / sizeof(struct api_struct);
-}
-
-NTSTATUS rpc_wks_init(void)
-{
- return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "wkssvc", "ntsvcs", api_wks_cmds,
- sizeof(api_wks_cmds) / sizeof(struct api_struct));
-}
diff --git a/source3/rpc_server/srv_wkssvc_nt.c b/source3/rpc_server/srv_wkssvc_nt.c
index 6528e63225..ead1b7b918 100644
--- a/source3/rpc_server/srv_wkssvc_nt.c
+++ b/source3/rpc_server/srv_wkssvc_nt.c
@@ -29,51 +29,330 @@
#define DBGC_CLASS DBGC_RPC_SRV
/*******************************************************************
- create_wks_info_100
+ Fill in the valiues for the struct wkssvc_NetWkstaInfo100.
********************************************************************/
-static void create_wks_info_100(WKS_INFO_100 *inf)
+static void create_wks_info_100(struct wkssvc_NetWkstaInfo100 *info100)
{
pstring my_name;
pstring domain;
- DEBUG(5,("create_wks_info_100: %d\n", __LINE__));
-
pstrcpy (my_name, global_myname());
strupper_m(my_name);
pstrcpy (domain, lp_workgroup());
strupper_m(domain);
+
+ info100->platform_id = 0x000001f4; /* unknown */
+ info100->version_major = lp_major_announce_version();
+ info100->version_minor = lp_minor_announce_version();
+
+ info100->server_name = talloc_strdup( info100, my_name );
+ info100->domain_name = talloc_strdup( info100, domain );
- init_wks_info_100(inf,
- 0x000001f4, /* platform id info */
- lp_major_announce_version(),
- lp_minor_announce_version(),
- my_name, domain);
+ return;
}
-/*******************************************************************
- wks_reply_query_info
-
+/********************************************************************
only supports info level 100 at the moment.
+ ********************************************************************/
+
+WERROR _wkssvc_NetWkstaGetInfo( pipes_struct *p, const char *server_name, uint32_t level,
+ union wkssvc_NetWkstaInfo *info )
+{
+ struct wkssvc_NetWkstaInfo100 *wks100 = NULL;
+
+ /* We only support info level 100 currently */
+
+ if ( level != 100 ) {
+ return NT_STATUS_INVALID_LEVEL;
+ }
+
+ if ( (wks100 = TALLOC_ZERO_P(p->mem_ctx, struct wkssvc_NetWkstaInfo100)) == NULL ) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ create_wks_info_100( wks100 );
+
+ info->info100 = wks100;
+
+ return NT_STATUS_OK;
+}
+
+/********************************************************************
********************************************************************/
-NTSTATUS _wks_query_info(pipes_struct *p, WKS_Q_QUERY_INFO *q_u, WKS_R_QUERY_INFO *r_u)
+WERROR _wkssvc_NetWkstaSetInfo( pipes_struct *p, const char *server_name,
+ uint32_t level, union wkssvc_NetWkstaInfo *info,
+ uint32_t *parm_error )
{
- WKS_INFO_100 *wks100 = NULL;
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
- DEBUG(5,("_wks_query_info: %d\n", __LINE__));
+/********************************************************************
+ ********************************************************************/
- wks100 = TALLOC_ZERO_P(p->mem_ctx, WKS_INFO_100);
+WERROR _wkssvc_NetWkstaEnumUsers( pipes_struct *p, const char *server_name,
+ uint32_t level,
+ union WKS_USER_ENUM_UNION *users,
+ uint32_t prefmaxlen, uint32_t *entriesread,
+ uint32_t *totalentries,
+ uint32_t *resumehandle )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
- if (!wks100)
- return NT_STATUS_NO_MEMORY;
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRWKSTAUSERGETINFO( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRWKSTAUSERSETINFO( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _wkssvc_NetWkstaTransportEnum( pipes_struct *p, const char *server_name, uint32_t *level, union wkssvc_NetWkstaTransportCtr *ctr, uint32_t max_buffer, uint32_t *totalentries, uint32_t *resume_handle)
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRWKSTATRANSPORTADD( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRWKSTATRANSPORTDEL( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRUSEADD( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRUSEGETINFO( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRUSEDEL( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRUSEENUM( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRMESSAGEBUFFERSEND( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRWORKSTATIONSTATISTICSGET( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRLOGONDOMAINNAMEADD( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRLOGONDOMAINNAMEDEL( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRJOINDOMAIN( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRUNJOINDOMAIN( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRRENAMEMACHINEINDOMAIN( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRVALIDATENAME( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRGETJOININFORMATION( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRGETJOINABLEOUS( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _wkssvc_NetrJoinDomain2(pipes_struct *p, const char *server_name, const char *domain_name, const char *account_name, const char *admin_account, struct wkssvc_PasswordBuffer *encrypted_password, uint32_t join_flags)
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _wkssvc_NetrUnjoinDomain2(pipes_struct *p, const char *server_name, const char *account, struct wkssvc_PasswordBuffer *encrypted_password, uint32_t unjoin_flags)
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _wkssvc_NetrRenameMachineInDomain2(pipes_struct *p, const char *server_name, const char *NewMachineName, const char *Account, struct wkssvc_PasswordBuffer *EncryptedPassword, uint32_t RenameOptions)
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRVALIDATENAME2( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRGETJOINABLEOUS2( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
- create_wks_info_100(wks100);
- init_wks_r_query_info(r_u, q_u->switch_value, wks100, NT_STATUS_OK);
+/********************************************************************
+ ********************************************************************/
+
+WERROR _wkssvc_NetrAddAlternateComputerName(pipes_struct *p, const char *server_name, const char *NewAlternateMachineName, const char *Account, struct wkssvc_PasswordBuffer *EncryptedPassword, uint32_t Reserved)
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
- DEBUG(5,("_wks_query_info: %d\n", __LINE__));
+/********************************************************************
+ ********************************************************************/
- return r_u->status;
+WERROR _wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p, const char *server_name, const char *AlternateMachineNameToRemove, const char *Account, struct wkssvc_PasswordBuffer *EncryptedPassword, uint32_t Reserved)
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRSETPRIMARYCOMPUTERNAME( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+
+/********************************************************************
+ ********************************************************************/
+
+WERROR _WKSSVC_NETRENUMERATECOMPUTERNAMES( pipes_struct *p )
+{
+ /* FIXME: Add implementation code here */
+ return WERR_NOT_SUPPORTED;
+}
+