[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-test-2410-gf802ba0
Günther Deschner
gd at samba.org
Tue Feb 19 00:30:58 GMT 2008
The branch, v3-2-test has been updated
via f802ba035c95e63c5a6ff9f2fb484d62341cd1a7 (commit)
from aa7023b88d3161897b9616d950c2a99624d81931 (commit)
http://gitweb.samba.org/?samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit f802ba035c95e63c5a6ff9f2fb484d62341cd1a7
Author: Günther Deschner <gd at samba.org>
Date: Tue Feb 19 01:19:44 2008 +0100
Remove unused marshalling for LSA_LOOKUP_SIDS/2/3.
This also removes parse_lsa.c entirely.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/Makefile.in | 2 +-
source/include/rpc_lsa.h | 164 -----------
source/rpc_parse/parse_lsa.c | 630 ----------------------------------------
source/rpc_server/srv_lsa_nt.c | 101 -------
4 files changed, 1 insertions(+), 896 deletions(-)
delete mode 100644 source/rpc_parse/parse_lsa.c
Changeset truncated at 500 lines:
diff --git a/source/Makefile.in b/source/Makefile.in
index 9da2f58..cebe49b 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -529,7 +529,7 @@ RPC_ECHO_OBJ = rpc_server/srv_echo_nt.o librpc/gen_ndr/srv_echo.o
RPC_SERVER_OBJ = @RPC_STATIC@ $(RPC_PIPE_OBJ)
-RPC_PARSE_OBJ = rpc_parse/parse_lsa.o $(RPC_PARSE_OBJ2) \
+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 $(REGOBJS_OBJ)
diff --git a/source/include/rpc_lsa.h b/source/include/rpc_lsa.h
index a92fca8..cdd21a7 100644
--- a/source/include/rpc_lsa.h
+++ b/source/include/rpc_lsa.h
@@ -136,173 +136,9 @@
POLICY_LOOKUP_NAMES )
/*******************************************************/
-
-/*******************************************************/
-
#define MAX_REF_DOMAINS 32
-/* DOM_TRUST_HDR */
-typedef struct dom_trust_hdr
-{
- UNIHDR hdr_dom_name; /* referenced domain unicode string headers */
- uint32 ptr_dom_sid;
-
-} DOM_TRUST_HDR;
-
-/* DOM_TRUST_INFO */
-typedef struct dom_trust_info
-{
- UNISTR2 uni_dom_name; /* domain name unicode string */
- DOM_SID2 ref_dom ; /* referenced domain SID */
-
-} DOM_TRUST_INFO;
-
-/* DOM_R_REF */
-typedef struct dom_ref_info
-{
- uint32 num_ref_doms_1; /* num referenced domains */
- uint32 ptr_ref_dom; /* pointer to referenced domains */
- uint32 max_entries; /* 32 - max number of entries */
- uint32 num_ref_doms_2; /* num referenced domains */
-
- DOM_TRUST_HDR hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domains */
- DOM_TRUST_INFO ref_dom [MAX_REF_DOMAINS]; /* referenced domains */
-
-} DOM_R_REF;
-
-/* the domain_idx points to a SID associated with the name */
-
-/* LSA_TRANS_NAME - translated name */
-typedef struct lsa_trans_name_info
-{
- uint16 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */
- UNIHDR hdr_name;
- uint32 domain_idx; /* index into DOM_R_REF array of SIDs */
-
-} LSA_TRANS_NAME;
-
-/* LSA_TRANS_NAME2 - translated name */
-typedef struct lsa_trans_name_info2
-{
- uint16 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */
- UNIHDR hdr_name;
- uint32 domain_idx; /* index into DOM_R_REF array of SIDs */
- uint32 unknown;
-
-} LSA_TRANS_NAME2;
-
/* This number is based on Win2k and later maximum response allowed */
#define MAX_LOOKUP_SIDS 20480 /* 0x5000 */
-/* LSA_TRANS_NAME_ENUM - LSA Translated Name Enumeration container */
-typedef struct lsa_trans_name_enum_info
-{
- uint32 num_entries;
- uint32 ptr_trans_names;
- uint32 num_entries2;
-
- LSA_TRANS_NAME *name; /* translated names */
- UNISTR2 *uni_name;
-
-} LSA_TRANS_NAME_ENUM;
-
-/* LSA_TRANS_NAME_ENUM2 - LSA Translated Name Enumeration container 2 */
-typedef struct lsa_trans_name_enum_info2
-{
- uint32 num_entries;
- uint32 ptr_trans_names;
- uint32 num_entries2;
-
- LSA_TRANS_NAME2 *name; /* translated names */
- UNISTR2 *uni_name;
-
-} LSA_TRANS_NAME_ENUM2;
-
-/* LSA_SID_ENUM - LSA SID enumeration container */
-typedef struct lsa_sid_enum_info
-{
- uint32 num_entries;
- uint32 ptr_sid_enum;
- uint32 num_entries2;
-
- uint32 *ptr_sid; /* domain SID pointers to be looked up. */
- DOM_SID2 *sid; /* domain SIDs to be looked up. */
-
-} LSA_SID_ENUM;
-
-/* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */
-typedef struct lsa_q_lookup_sids
-{
- POLICY_HND pol; /* policy handle */
- LSA_SID_ENUM sids;
- LSA_TRANS_NAME_ENUM names;
- uint16 level;
- uint32 mapped_count;
-
-} LSA_Q_LOOKUP_SIDS;
-
-/* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */
-typedef struct lsa_r_lookup_sids
-{
- uint32 ptr_dom_ref;
- DOM_R_REF *dom_ref; /* domain reference info */
-
- LSA_TRANS_NAME_ENUM names;
- uint32 mapped_count;
-
- NTSTATUS status; /* return code */
-
-} LSA_R_LOOKUP_SIDS;
-
-/* LSA_Q_LOOKUP_SIDS2 - LSA Lookup SIDs 2*/
-typedef struct lsa_q_lookup_sids2
-{
- POLICY_HND pol; /* policy handle */
- LSA_SID_ENUM sids;
- LSA_TRANS_NAME_ENUM2 names;
- uint16 level;
- uint32 mapped_count;
- uint32 unknown1;
- uint32 unknown2;
-
-} LSA_Q_LOOKUP_SIDS2;
-
-/* LSA_R_LOOKUP_SIDS2 - response to LSA Lookup SIDs 2*/
-typedef struct lsa_r_lookup_sids2
-{
- uint32 ptr_dom_ref;
- DOM_R_REF *dom_ref; /* domain reference info */
-
- LSA_TRANS_NAME_ENUM2 names;
- uint32 mapped_count;
-
- NTSTATUS status; /* return code */
-
-} LSA_R_LOOKUP_SIDS2;
-
-/* LSA_Q_LOOKUP_SIDS3 - LSA Lookup SIDs 3 */
-typedef struct lsa_q_lookup_sids3
-{
- LSA_SID_ENUM sids;
- LSA_TRANS_NAME_ENUM2 names;
- uint16 level;
- uint32 mapped_count;
- uint32 unknown1;
- uint32 unknown2;
-
-} LSA_Q_LOOKUP_SIDS3;
-
-/* LSA_R_LOOKUP_SIDS3 - response to LSA Lookup SIDs 3 */
-typedef struct lsa_r_lookup_sids3
-{
- uint32 ptr_dom_ref;
- DOM_R_REF *dom_ref; /* domain reference info */
-
- LSA_TRANS_NAME_ENUM2 names;
- uint32 mapped_count;
-
- NTSTATUS status; /* return code */
-
-} LSA_R_LOOKUP_SIDS3;
-
#endif /* _RPC_LSA_H */
diff --git a/source/rpc_parse/parse_lsa.c b/source/rpc_parse/parse_lsa.c
deleted file mode 100644
index 81b6fc9..0000000
--- a/source/rpc_parse/parse_lsa.c
+++ /dev/null
@@ -1,630 +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) Andrew Bartlett 2002,
- * Copyright (C) Jim McDonough <jmcd at us.ibm.com> 2002.
- * 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
-
-static bool lsa_io_trans_names(const char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth);
-static bool lsa_io_trans_names2(const char *desc, LSA_TRANS_NAME_ENUM2 *trn, prs_struct *ps, int depth);
-
-/*******************************************************************
- Inits a LSA_TRANS_NAME structure.
-********************************************************************/
-
-void init_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name,
- uint16 sid_name_use, const char *name, uint32 idx)
-{
- trn->sid_name_use = sid_name_use;
- init_unistr2(uni_name, name, UNI_FLAGS_NONE);
- init_uni_hdr(&trn->hdr_name, uni_name);
- trn->domain_idx = idx;
-}
-
-/*******************************************************************
- Reads or writes a LSA_TRANS_NAME structure.
-********************************************************************/
-
-static bool lsa_io_trans_name(const char *desc, LSA_TRANS_NAME *trn, prs_struct *ps,
- int depth)
-{
- prs_debug(ps, depth, desc, "lsa_io_trans_name");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint16("sid_name_use", ps, depth, &trn->sid_name_use))
- return False;
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_unihdr ("hdr_name", &trn->hdr_name, ps, depth))
- return False;
- if(!prs_uint32("domain_idx ", ps, depth, &trn->domain_idx))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- Inits a LSA_TRANS_NAME2 structure.
-********************************************************************/
-
-void init_lsa_trans_name2(LSA_TRANS_NAME2 *trn, UNISTR2 *uni_name,
- uint16 sid_name_use, const char *name, uint32 idx)
-{
- trn->sid_name_use = sid_name_use;
- init_unistr2(uni_name, name, UNI_FLAGS_NONE);
- init_uni_hdr(&trn->hdr_name, uni_name);
- trn->domain_idx = idx;
- trn->unknown = 0;
-}
-
-/*******************************************************************
- Reads or writes a LSA_TRANS_NAME2 structure.
-********************************************************************/
-
-static bool lsa_io_trans_name2(const char *desc, LSA_TRANS_NAME2 *trn, prs_struct *ps,
- int depth)
-{
- prs_debug(ps, depth, desc, "lsa_io_trans_name2");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint16("sid_name_use", ps, depth, &trn->sid_name_use))
- return False;
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_unihdr ("hdr_name", &trn->hdr_name, ps, depth))
- return False;
- if(!prs_uint32("domain_idx ", ps, depth, &trn->domain_idx))
- return False;
- if(!prs_uint32("unknown ", ps, depth, &trn->unknown))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- Reads or writes a DOM_R_REF structure.
-********************************************************************/
-
-static bool lsa_io_dom_r_ref(const char *desc, DOM_R_REF *dom, prs_struct *ps, int depth)
-{
- unsigned int i;
-
- prs_debug(ps, depth, desc, "lsa_io_dom_r_ref");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("num_ref_doms_1", ps, depth, &dom->num_ref_doms_1)) /* num referenced domains? */
- return False;
- if(!prs_uint32("ptr_ref_dom ", ps, depth, &dom->ptr_ref_dom)) /* undocumented buffer pointer. */
- return False;
- if(!prs_uint32("max_entries ", ps, depth, &dom->max_entries)) /* 32 - max number of entries */
- return False;
-
- SMB_ASSERT_ARRAY(dom->hdr_ref_dom, dom->num_ref_doms_1);
-
- if (dom->ptr_ref_dom != 0) {
-
- if(!prs_uint32("num_ref_doms_2", ps, depth, &dom->num_ref_doms_2)) /* 4 - num referenced domains? */
- return False;
-
- SMB_ASSERT_ARRAY(dom->ref_dom, dom->num_ref_doms_2);
-
- for (i = 0; i < dom->num_ref_doms_1; i++) {
- fstring t;
-
- slprintf(t, sizeof(t) - 1, "dom_ref[%d] ", i);
- if(!smb_io_unihdr(t, &dom->hdr_ref_dom[i].hdr_dom_name, ps, depth))
- return False;
-
- slprintf(t, sizeof(t) - 1, "sid_ptr[%d] ", i);
- if(!prs_uint32(t, ps, depth, &dom->hdr_ref_dom[i].ptr_dom_sid))
- return False;
- }
-
- for (i = 0; i < dom->num_ref_doms_2; i++) {
- fstring t;
-
- if (dom->hdr_ref_dom[i].hdr_dom_name.buffer != 0) {
- slprintf(t, sizeof(t) - 1, "dom_ref[%d] ", i);
- if(!smb_io_unistr2(t, &dom->ref_dom[i].uni_dom_name, True, ps, depth)) /* domain name unicode string */
- return False;
- if(!prs_align(ps))
- return False;
- }
-
- if (dom->hdr_ref_dom[i].ptr_dom_sid != 0) {
- slprintf(t, sizeof(t) - 1, "sid_ptr[%d] ", i);
- if(!smb_io_dom_sid2(t, &dom->ref_dom[i].ref_dom, ps, depth)) /* referenced domain SIDs */
- return False;
- }
- }
- }
-
- return True;
-}
-
-/*******************************************************************
- Inits a LSA_SID_ENUM structure.
-********************************************************************/
-
-static void init_lsa_sid_enum(TALLOC_CTX *mem_ctx, LSA_SID_ENUM *sen,
- int num_entries, const DOM_SID *sids)
-{
- int i;
-
- DEBUG(5, ("init_lsa_sid_enum\n"));
-
- sen->num_entries = num_entries;
- sen->ptr_sid_enum = (num_entries != 0);
- sen->num_entries2 = num_entries;
-
- /* Allocate memory for sids and sid pointers */
-
- if (num_entries) {
- if ((sen->ptr_sid = TALLOC_ZERO_ARRAY(mem_ctx, uint32, num_entries )) == NULL) {
- DEBUG(3, ("init_lsa_sid_enum(): out of memory for ptr_sid\n"));
- return;
- }
-
- if ((sen->sid = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID2, num_entries)) == NULL) {
- DEBUG(3, ("init_lsa_sid_enum(): out of memory for sids\n"));
- return;
- }
- }
-
- /* Copy across SIDs and SID pointers */
-
- for (i = 0; i < num_entries; i++) {
- sen->ptr_sid[i] = 1;
- init_dom_sid2(&sen->sid[i], &sids[i]);
- }
-}
-
-/*******************************************************************
- Reads or writes a LSA_SID_ENUM structure.
-********************************************************************/
-
-static bool lsa_io_sid_enum(const char *desc, LSA_SID_ENUM *sen, prs_struct *ps,
- int depth)
-{
- unsigned int i;
-
- prs_debug(ps, depth, desc, "lsa_io_sid_enum");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("num_entries ", ps, depth, &sen->num_entries))
- return False;
- if(!prs_uint32("ptr_sid_enum", ps, depth, &sen->ptr_sid_enum))
- return False;
-
- /*
- if the ptr is NULL, leave here. checked from a real w2k trace.
- JFM, 11/23/2001
- */
-
- if (sen->ptr_sid_enum==0)
- return True;
-
- if(!prs_uint32("num_entries2", ps, depth, &sen->num_entries2))
- return False;
-
- /* Mallocate memory if we're unpacking from the wire */
-
- if (UNMARSHALLING(ps) && sen->num_entries) {
- if ((sen->ptr_sid = PRS_ALLOC_MEM( ps, uint32, sen->num_entries)) == NULL) {
- DEBUG(3, ("init_lsa_sid_enum(): out of memory for "
- "ptr_sid\n"));
- return False;
- }
-
- if ((sen->sid = PRS_ALLOC_MEM( ps, DOM_SID2, sen->num_entries)) == NULL) {
- DEBUG(3, ("init_lsa_sid_enum(): out of memory for "
- "sids\n"));
- return False;
- }
- }
-
- for (i = 0; i < sen->num_entries; i++) {
- fstring temp;
-
- slprintf(temp, sizeof(temp) - 1, "ptr_sid[%d]", i);
- if(!prs_uint32(temp, ps, depth, &sen->ptr_sid[i])) {
- return False;
- }
- }
-
- for (i = 0; i < sen->num_entries; i++) {
- fstring temp;
-
- slprintf(temp, sizeof(temp) - 1, "sid[%d]", i);
- if(!smb_io_dom_sid2(temp, &sen->sid[i], ps, depth)) {
- return False;
- }
- }
-
- return True;
-}
-
-/*******************************************************************
- Inits an LSA_R_ENUM_TRUST_DOM structure.
-********************************************************************/
-
-void init_q_lookup_sids(TALLOC_CTX *mem_ctx, LSA_Q_LOOKUP_SIDS *q_l,
- POLICY_HND *hnd, int num_sids, const DOM_SID *sids,
- uint16 level)
-{
- DEBUG(5, ("init_q_lookup_sids\n"));
-
- ZERO_STRUCTP(q_l);
-
- memcpy(&q_l->pol, hnd, sizeof(q_l->pol));
- init_lsa_sid_enum(mem_ctx, &q_l->sids, num_sids, sids);
-
- q_l->level = level;
-}
-
-/*******************************************************************
- Reads or writes a LSA_Q_LOOKUP_SIDS structure.
-********************************************************************/
--
Samba Shared Repository
More information about the samba-cvs
mailing list