[SCM] Samba Shared Repository - branch master updated -
43d0a4813bf919e7fe6ab82f6920015d1a57f7bc
Günther Deschner
gd at samba.org
Wed Dec 17 23:34:50 GMT 2008
The branch, master has been updated
via 43d0a4813bf919e7fe6ab82f6920015d1a57f7bc (commit)
via 934b90c17c37e7cab6d088d5c5be50b08cfce1fb (commit)
via 5445ee2a55d5eadb41d17348ff5f5a09cfb8a3e0 (commit)
from 93c61a814a5a79505a0bd2675a67cb3d6a4fdbe3 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 43d0a4813bf919e7fe6ab82f6920015d1a57f7bc
Author: Günther Deschner <gd at samba.org>
Date: Wed Nov 19 14:37:47 2008 +0100
s3-ntsvcs: remove last traces of hand-marshalled NTSVCS.
Guenther
commit 934b90c17c37e7cab6d088d5c5be50b08cfce1fb
Author: Günther Deschner <gd at samba.org>
Date: Wed Nov 19 14:35:09 2008 +0100
s3-ntsvcs: remove old _PNP_GetDeviceList.
Guenther
commit 5445ee2a55d5eadb41d17348ff5f5a09cfb8a3e0
Author: Günther Deschner <gd at samba.org>
Date: Wed Nov 19 14:33:36 2008 +0100
s3-ntsvcs: use pidl for _PNP_GetDeviceList.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source3/Makefile.in | 4 +-
source3/configure.in | 4 +-
source3/include/includes.h | 1 -
source3/include/proto.h | 14 ----
source3/include/rpc_ntsvcs.h | 50 ------------
source3/rpc_parse/parse_ntsvcs.c | 79 -------------------
source3/rpc_server/srv_ntsvcs.c | 148 ------------------------------------
source3/rpc_server/srv_ntsvcs_nt.c | 51 +++++++------
8 files changed, 33 insertions(+), 318 deletions(-)
delete mode 100644 source3/include/rpc_ntsvcs.h
delete mode 100644 source3/rpc_parse/parse_ntsvcs.c
delete mode 100644 source3/rpc_server/srv_ntsvcs.c
Changeset truncated at 500 lines:
diff --git a/source3/Makefile.in b/source3/Makefile.in
index e91bb90..f139d73 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -555,7 +555,7 @@ RPC_SVCCTL_OBJ = rpc_server/srv_svcctl.o rpc_server/srv_svcctl_nt.o \
services/svc_netlogon.o services/svc_winreg.o \
services/svc_wins.o
-RPC_NTSVCS_OBJ = rpc_server/srv_ntsvcs.o rpc_server/srv_ntsvcs_nt.o \
+RPC_NTSVCS_OBJ = rpc_server/srv_ntsvcs_nt.o \
../librpc/gen_ndr/srv_ntsvcs.o
RPC_DFS_OBJ = ../librpc/gen_ndr/srv_dfs.o rpc_server/srv_dfs_nt.o
@@ -575,7 +575,7 @@ RPC_SERVER_OBJ = @RPC_STATIC@ $(RPC_PIPE_OBJ)
RPC_PARSE_OBJ = $(RPC_PARSE_OBJ2) \
rpc_parse/parse_spoolss.o \
rpc_parse/parse_eventlog.o rpc_parse/parse_buffer.o \
- rpc_parse/parse_ntsvcs.o rpc_parse/parse_svcctl.o
+ rpc_parse/parse_svcctl.o
RPC_CLIENT_OBJ = rpc_client/cli_pipe.o
diff --git a/source3/configure.in b/source3/configure.in
index a876133..fc3cb26 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -396,7 +396,7 @@ AC_SUBST(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_lsarpc rpc_samr rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl2 rpc_ntsvcs2 rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog2 auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin auth_netlogond vfs_default nss_info_template"
+default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsarpc rpc_samr rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl2 rpc_ntsvcs rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog2 auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin auth_netlogond vfs_default nss_info_template"
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 vfs_shadow_copy2 charset_CP850 charset_CP437 auth_script vfs_readahead vfs_xattr_tdb vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb vfs_smb_traffic_analyzer"
@@ -6081,7 +6081,7 @@ SMB_MODULE(rpc_initshutdown, \$(RPC_INITSHUTDOWN_OBJ), "bin/librpc_initshutdown.
SMB_MODULE(rpc_dssetup, \$(RPC_DSSETUP_OBJ), "bin/librpc_dssetup.$SHLIBEXT", RPC)
SMB_MODULE(rpc_wkssvc, \$(RPC_WKS_OBJ), "bin/librpc_wkssvc.$SHLIBEXT", RPC)
SMB_MODULE(rpc_svcctl2, \$(RPC_SVCCTL_OBJ), "bin/librpc_svcctl2.$SHLIBEXT", RPC)
-SMB_MODULE(rpc_ntsvcs2, \$(RPC_NTSVCS_OBJ), "bin/librpc_ntsvcs2.$SHLIBEXT", RPC)
+SMB_MODULE(rpc_ntsvcs, \$(RPC_NTSVCS_OBJ), "bin/librpc_ntsvcs.$SHLIBEXT", RPC)
SMB_MODULE(rpc_netlogon, \$(RPC_NETLOG_OBJ), "bin/librpc_NETLOGON.$SHLIBEXT", RPC)
SMB_MODULE(rpc_netdfs, \$(RPC_DFS_OBJ), "bin/librpc_netdfs.$SHLIBEXT", RPC)
SMB_MODULE(rpc_srvsvc, \$(RPC_SVC_OBJ), "bin/librpc_svcsvc.$SHLIBEXT", RPC)
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 38d6ec0..4e41fa3 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -620,7 +620,6 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
#include "auth.h"
#include "ntdomain.h"
#include "rpc_svcctl.h"
-#include "rpc_ntsvcs.h"
#include "rpc_lsa.h"
#include "reg_objects.h"
#include "reg_db.h"
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 24929f6..5e2b823 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -6023,11 +6023,6 @@ bool make_bufhdr2(BUFHDR2 *hdr, uint32 info_level, uint32 length, uint32 buffer)
uint32 str_len_uni(UNISTR *source);
bool policy_handle_is_valid(const POLICY_HND *hnd);
-/* The following definitions come from rpc_parse/parse_ntsvcs.c */
-
-bool ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u, prs_struct *ps, int depth);
-bool ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u, prs_struct *ps, int depth);
-
/* The following definitions come from rpc_parse/parse_prs.c */
void prs_dump(const char *name, int v, prs_struct *ps);
@@ -6554,15 +6549,6 @@ bool close_policy_hnd(pipes_struct *p, POLICY_HND *hnd);
void close_policy_by_pipe(pipes_struct *p);
bool pipe_access_check(pipes_struct *p);
-/* The following definitions come from rpc_server/srv_ntsvcs.c */
-
-void ntsvcs2_get_pipe_fns( struct api_struct **fns, int *n_fns );
-NTSTATUS rpc_ntsvcs2_init(void);
-
-/* The following definitions come from rpc_server/srv_ntsvcs_nt.c */
-
-WERROR _ntsvcs_get_device_list( pipes_struct *p, NTSVCS_Q_GET_DEVICE_LIST *q_u, NTSVCS_R_GET_DEVICE_LIST *r_u );
-
/* The following definitions come from rpc_server/srv_pipe.c */
bool create_next_pdu(pipes_struct *p);
diff --git a/source3/include/rpc_ntsvcs.h b/source3/include/rpc_ntsvcs.h
deleted file mode 100644
index dc74298..0000000
--- a/source3/include/rpc_ntsvcs.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- SMB parameters and setup
- Copyright (C) Gerald (Jerry) Carter 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 3 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, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _RPC_NTSVCS_H /* _RPC_NTSVCS_H */
-#define _RPC_NTSVCS_H
-
-/* ntsvcs pipe */
-
-#define NTSVCS_GET_VERSION 0x02
-#define NTSVCS_VALIDATE_DEVICE_INSTANCE 0x06
-#define NTSVCS_GET_ROOT_DEVICE_INSTANCE 0x07
-#define NTSVCS_GET_DEVICE_LIST 0x0a
-#define NTSVCS_GET_DEVICE_LIST_SIZE 0x0b
-#define NTSVCS_GET_DEVICE_REG_PROPERTY 0x0d
-#define NTSVCS_HW_PROFILE_FLAGS 0x28
-#define NTSVCS_GET_HW_PROFILE_INFO 0x29
-#define NTSVCS_GET_VERSION_INTERNAL 0x3e
-
-
-/**************************/
-
-typedef struct {
- UNISTR2 *devicename;
- uint32 buffer_size;
- uint32 flags;
-} NTSVCS_Q_GET_DEVICE_LIST;
-
-typedef struct {
- UNISTR2 devicepath;
- uint32 needed;
- WERROR status;
-} NTSVCS_R_GET_DEVICE_LIST;
-
-#endif /* _RPC_NTSVCS_H */
diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c
deleted file mode 100644
index 17b51fa..0000000
--- a/source3/rpc_parse/parse_ntsvcs.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Unix SMB/CIFS implementation.
- * RPC Pipe client / server routines
- * Copyright (C) Gerald (Jerry) Carter 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 3 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include "includes.h"
-
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_RPC_PARSE
-
-/*******************************************************************
-********************************************************************/
-
-bool ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if ( !prs_pointer("devicename", ps, depth, (void*)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) )
- return False;
- if( !prs_align(ps) )
- return False;
-
- if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) )
- return False;
- if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
- return False;
-
- return True;
-
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u, prs_struct *ps, int depth)
-{
- if ( !r_u )
- return False;
-
- prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if ( !prs_io_unistr2("devicepath", ps, depth, &r_u->devicepath) )
- return False;
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("needed", ps, depth, &r_u->needed))
- return False;
-
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
diff --git a/source3/rpc_server/srv_ntsvcs.c b/source3/rpc_server/srv_ntsvcs.c
deleted file mode 100644
index 840da3e..0000000
--- a/source3/rpc_server/srv_ntsvcs.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Unix SMB/CIFS implementation.
- * RPC Pipe client / server routines
- * Copyright (C) Gerald Carter 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 3 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include "includes.h"
-#include "librpc/gen_ndr/srv_ntsvcs.h"
-
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_RPC_SRV
-
-/*******************************************************************
- ********************************************************************/
-
-static bool proxy_ntsvcs_call(pipes_struct *p, uint8_t opnum)
-{
- struct api_struct *fns;
- int n_fns;
-
- ntsvcs_get_pipe_fns(&fns, &n_fns);
-
- if (opnum >= n_fns) {
- return false;
- }
-
- if (fns[opnum].opnum != opnum) {
- smb_panic("NTSVCS function table not sorted");
- }
-
- return fns[opnum].fn(p);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_get_version(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_GETVERSION);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_get_device_list_size(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_GETDEVICELISTSIZE);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_get_device_list(pipes_struct *p)
-{
- NTSVCS_Q_GET_DEVICE_LIST q_u;
- NTSVCS_R_GET_DEVICE_LIST r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!ntsvcs_io_q_get_device_list("", &q_u, data, 0))
- return False;
-
- r_u.status = _ntsvcs_get_device_list(p, &q_u, &r_u);
-
- if(!ntsvcs_io_r_get_device_list("", &r_u, rdata, 0))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_validate_device_instance(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_VALIDATEDEVICEINSTANCE);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_get_device_reg_property(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_GETDEVICEREGPROP);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_get_hw_profile_info(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_GETHWPROFINFO);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_hw_profile_flags(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_HWPROFFLAGS);
-}
-
-/*******************************************************************
- \PIPE\svcctl commands
- ********************************************************************/
-
-static struct api_struct api_ntsvcs_cmds[] =
-{
- { "NTSVCS_GET_VERSION" , NTSVCS_GET_VERSION , api_ntsvcs_get_version },
- { "NTSVCS_GET_DEVICE_LIST_SIZE" , NTSVCS_GET_DEVICE_LIST_SIZE , api_ntsvcs_get_device_list_size },
- { "NTSVCS_GET_DEVICE_LIST" , NTSVCS_GET_DEVICE_LIST , api_ntsvcs_get_device_list },
- { "NTSVCS_VALIDATE_DEVICE_INSTANCE" , NTSVCS_VALIDATE_DEVICE_INSTANCE , api_ntsvcs_validate_device_instance },
- { "NTSVCS_GET_DEVICE_REG_PROPERTY" , NTSVCS_GET_DEVICE_REG_PROPERTY , api_ntsvcs_get_device_reg_property },
- { "NTSVCS_GET_HW_PROFILE_INFO" , NTSVCS_GET_HW_PROFILE_INFO , api_ntsvcs_get_hw_profile_info },
- { "NTSVCS_HW_PROFILE_FLAGS" , NTSVCS_HW_PROFILE_FLAGS , api_ntsvcs_hw_profile_flags }
-};
-
-
-void ntsvcs2_get_pipe_fns( struct api_struct **fns, int *n_fns )
-{
- *fns = api_ntsvcs_cmds;
- *n_fns = sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct);
-}
-
-NTSTATUS rpc_ntsvcs2_init(void)
-{
- return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION,
- "ntsvcs", "ntsvcs",
- &ndr_table_ntsvcs.syntax_id,
- api_ntsvcs_cmds,
- sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct));
-}
diff --git a/source3/rpc_server/srv_ntsvcs_nt.c b/source3/rpc_server/srv_ntsvcs_nt.c
index f2c85bb..681c543 100644
--- a/source3/rpc_server/srv_ntsvcs_nt.c
+++ b/source3/rpc_server/srv_ntsvcs_nt.c
@@ -65,29 +65,46 @@ WERROR _PNP_GetDeviceListSize(pipes_struct *p,
return WERR_OK;
}
+/****************************************************************
+ _PNP_GetDeviceList
+****************************************************************/
-/********************************************************************
-********************************************************************/
-
-WERROR _ntsvcs_get_device_list( pipes_struct *p, NTSVCS_Q_GET_DEVICE_LIST *q_u, NTSVCS_R_GET_DEVICE_LIST *r_u )
+WERROR _PNP_GetDeviceList(pipes_struct *p,
+ struct PNP_GetDeviceList *r)
{
- fstring device;
char *devicepath;
+ uint32_t size = 0;
- if ( !q_u->devicename )
- return WERR_ACCESS_DENIED;
+ DATA_BLOB blob;
+ struct lsa_StringLarge s;
+ enum ndr_err_code ndr_err;
- rpcstr_pull(device, q_u->devicename->buffer, sizeof(device), q_u->devicename->uni_str_len*2, 0);
+ if ( !r->in.filter )
+ return WERR_ACCESS_DENIED;
- if (!(devicepath = get_device_path(p->mem_ctx, device))) {
+ if (!(devicepath = get_device_path(p->mem_ctx, r->in.filter))) {
return WERR_NOMEM;
}
+ size = strlen(devicepath) + 2;
+
+ if (*r->in.length < size) {
+ return WERR_CM_BUFFER_SMALL;
+ }
+
+ s.string = r->in.filter;
+
/* This has to be DOUBLE NULL terminated */
+ ndr_err = ndr_push_struct_blob(&blob, p->mem_ctx, NULL, &s,
+ (ndr_push_flags_fn_t)ndr_push_lsa_StringLarge);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return ntstatus_to_werror(ndr_map_error2ntstatus(ndr_err));
+ }
- init_unistr2( &r_u->devicepath, devicepath, UNI_STR_DBLTERMINATE );
- TALLOC_FREE(devicepath);
- r_u->needed = r_u->devicepath.uni_str_len;
+ r->out.buffer = (uint16_t *)talloc_memdup(p->mem_ctx, blob.data, blob.length);
+ if (!r->out.buffer) {
+ return WERR_NOMEM;
+ }
return WERR_OK;
}
@@ -271,16 +288,6 @@ WERROR _PNP_EnumerateSubKeys(pipes_struct *p,
/****************************************************************
****************************************************************/
-WERROR _PNP_GetDeviceList(pipes_struct *p,
- struct PNP_GetDeviceList *r)
-{
- p->rng_fault_state = true;
- return WERR_NOT_SUPPORTED;
-}
-
-/****************************************************************
-****************************************************************/
-
WERROR _PNP_GetDepth(pipes_struct *p,
struct PNP_GetDepth *r)
{
--
Samba Shared Repository
More information about the samba-cvs
mailing list