[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-test-2178-g7e1f334
Günther Deschner
gd at samba.org
Wed Feb 13 10:18:54 GMT 2008
The branch, v3-2-test has been updated
via 7e1f33436adb0625662969f52b501c57d4a4bc87 (commit)
via 33a97b447c1875bf1cd5a703871a84a7fb359fec (commit)
via 6f269ec8c0ad18bd0c04d5fc459fa80ab72dba63 (commit)
via 8890bc481f60cd42d96b240b2ed8e34bc3d81f13 (commit)
from d950174bcb50ecb70dfef71d4201feec4985c08b (commit)
http://gitweb.samba.org/?samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 7e1f33436adb0625662969f52b501c57d4a4bc87
Author: Günther Deschner <gd at samba.org>
Date: Wed Feb 13 11:17:40 2008 +0100
Remove unused marshalling for SAMR_ENUM_DOM_ALIASES.
Guenther
commit 33a97b447c1875bf1cd5a703871a84a7fb359fec
Author: Günther Deschner <gd at samba.org>
Date: Wed Feb 13 11:15:40 2008 +0100
Convert last caller (in winbindd) to rpccli_samr_EnumDomainAliases.
Guenther
commit 6f269ec8c0ad18bd0c04d5fc459fa80ab72dba63
Author: Günther Deschner <gd at samba.org>
Date: Wed Feb 13 11:11:34 2008 +0100
Remove unused marshalling for SAMR_ENUM_DOM_GROUPS.
Guenther
commit 8890bc481f60cd42d96b240b2ed8e34bc3d81f13
Author: Günther Deschner <gd at samba.org>
Date: Wed Feb 13 11:08:49 2008 +0100
Convert last caller (in winbindd) to rpccli_samr_EnumDomainGroups.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/include/rpc_samr.h | 74 ----------
source/rpc_client/cli_samr.c | 141 -------------------
source/rpc_parse/parse_samr.c | 292 ----------------------------------------
source/winbindd/winbindd_rpc.c | 46 +++++--
4 files changed, 32 insertions(+), 521 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/include/rpc_samr.h b/source/include/rpc_samr.h
index 9b9b4d2..62c6b16 100644
--- a/source/include/rpc_samr.h
+++ b/source/include/rpc_samr.h
@@ -153,80 +153,6 @@ SamrTestPrivateFunctionsUser
/* The following should be the greater of the preceeding two. */
#define MAX_SAM_ENTRIES MAX_SAM_ENTRIES_W2K
-typedef struct samr_entry_info
-{
- uint32 rid;
- UNIHDR hdr_name;
-
-} SAM_ENTRY;
-
-/* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
-typedef struct q_samr_enum_dom_groups_info
-{
- POLICY_HND pol; /* policy handle */
-
- /* this is possibly an enumeration context handle... */
- uint32 start_idx; /* 0x0000 0000 */
-
- uint32 max_size; /* 0x0000 ffff */
-
-} SAMR_Q_ENUM_DOM_GROUPS;
-
-
-/* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
-typedef struct r_samr_enum_dom_groups_info
-{
- uint32 next_idx;
- uint32 ptr_entries1;
-
- uint32 num_entries2;
- uint32 ptr_entries2;
-
- uint32 num_entries3;
-
- SAM_ENTRY *sam;
- UNISTR2 *uni_grp_name;
-
- uint32 num_entries4;
-
- NTSTATUS status;
-
-} SAMR_R_ENUM_DOM_GROUPS;
-
-
-/* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
-typedef struct q_samr_enum_dom_aliases_info
-{
- POLICY_HND pol; /* policy handle */
-
- /* this is possibly an enumeration context handle... */
- uint32 start_idx; /* 0x0000 0000 */
-
- uint32 max_size; /* 0x0000 ffff */
-
-} SAMR_Q_ENUM_DOM_ALIASES;
-
-
-/* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
-typedef struct r_samr_enum_dom_aliases_info
-{
- uint32 next_idx;
- uint32 ptr_entries1;
-
- uint32 num_entries2;
- uint32 ptr_entries2;
-
- uint32 num_entries3;
-
- SAM_ENTRY *sam;
- UNISTR2 *uni_grp_name;
-
- uint32 num_entries4;
-
- NTSTATUS status;
-
-} SAMR_R_ENUM_DOM_ALIASES;
-
/* these are from the old rpc_samr.h - they are needed while the merge
is still going on */
#define MAX_SAM_SIDS 15
diff --git a/source/rpc_client/cli_samr.c b/source/rpc_client/cli_samr.c
index a994db9..c805f00 100644
--- a/source/rpc_client/cli_samr.c
+++ b/source/rpc_client/cli_samr.c
@@ -22,147 +22,6 @@
#include "includes.h"
-/* Enumerate domain groups */
-
-NTSTATUS rpccli_samr_enum_dom_groups(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx,
- POLICY_HND *pol, uint32 *start_idx,
- uint32 size, struct acct_info **dom_groups,
- uint32 *num_dom_groups)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_ENUM_DOM_GROUPS q;
- SAMR_R_ENUM_DOM_GROUPS r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- uint32 name_idx, i;
-
- DEBUG(10,("cli_samr_enum_dom_groups starting at index %u\n", (unsigned int)*start_idx));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_enum_dom_groups(&q, pol, *start_idx, size);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_ENUM_DOM_GROUPS,
- q, r,
- qbuf, rbuf,
- samr_io_q_enum_dom_groups,
- samr_io_r_enum_dom_groups,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- result = r.status;
-
- if (!NT_STATUS_IS_OK(result) &&
- NT_STATUS_V(result) != NT_STATUS_V(STATUS_MORE_ENTRIES))
- goto done;
-
- *num_dom_groups = r.num_entries2;
-
- if (*num_dom_groups == 0)
- goto done;
-
- if (!((*dom_groups) = TALLOC_ARRAY(mem_ctx, struct acct_info, *num_dom_groups))) {
- result = NT_STATUS_NO_MEMORY;
- goto done;
- }
-
- memset(*dom_groups, 0, sizeof(struct acct_info) * (*num_dom_groups));
-
- name_idx = 0;
-
- for (i = 0; i < *num_dom_groups; i++) {
-
- (*dom_groups)[i].rid = r.sam[i].rid;
-
- if (r.sam[i].hdr_name.buffer) {
- unistr2_to_ascii((*dom_groups)[i].acct_name,
- &r.uni_grp_name[name_idx],
- sizeof((*dom_groups)[i].acct_name));
- name_idx++;
- }
-
- *start_idx = r.next_idx;
- }
-
- done:
- return result;
-}
-
-/* Enumerate domain groups */
-
-NTSTATUS rpccli_samr_enum_als_groups(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx,
- POLICY_HND *pol, uint32 *start_idx,
- uint32 size, struct acct_info **dom_aliases,
- uint32 *num_dom_aliases)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_ENUM_DOM_ALIASES q;
- SAMR_R_ENUM_DOM_ALIASES r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- uint32 name_idx, i;
-
- DEBUG(10,("cli_samr_enum_als_groups starting at index %u\n", (unsigned int)*start_idx));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_enum_dom_aliases(&q, pol, *start_idx, size);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_ENUM_DOM_ALIASES,
- q, r,
- qbuf, rbuf,
- samr_io_q_enum_dom_aliases,
- samr_io_r_enum_dom_aliases,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- result = r.status;
-
- if (!NT_STATUS_IS_OK(result) &&
- NT_STATUS_V(result) != NT_STATUS_V(STATUS_MORE_ENTRIES)) {
- goto done;
- }
-
- *num_dom_aliases = r.num_entries2;
-
- if (*num_dom_aliases == 0)
- goto done;
-
- if (!((*dom_aliases) = TALLOC_ARRAY(mem_ctx, struct acct_info, *num_dom_aliases))) {
- result = NT_STATUS_NO_MEMORY;
- goto done;
- }
-
- memset(*dom_aliases, 0, sizeof(struct acct_info) * *num_dom_aliases);
-
- name_idx = 0;
-
- for (i = 0; i < *num_dom_aliases; i++) {
-
- (*dom_aliases)[i].rid = r.sam[i].rid;
-
- if (r.sam[i].hdr_name.buffer) {
- unistr2_to_ascii((*dom_aliases)[i].acct_name,
- &r.uni_grp_name[name_idx],
- sizeof((*dom_aliases)[i].acct_name));
- name_idx++;
- }
-
- *start_idx = r.next_idx;
- }
-
- done:
- return result;
-}
-
/* User change password */
NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
diff --git a/source/rpc_parse/parse_samr.c b/source/rpc_parse/parse_samr.c
index 14b6e2a..ad55e48 100644
--- a/source/rpc_parse/parse_samr.c
+++ b/source/rpc_parse/parse_samr.c
@@ -27,295 +27,3 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_PARSE
-
-/*******************************************************************
-reads or writes a SAM_ENTRY structure.
-********************************************************************/
-
-static bool sam_io_sam_entry(const char *desc, SAM_ENTRY * sam,
- prs_struct *ps, int depth)
-{
- if (sam == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "sam_io_sam_entry");
- depth++;
-
- if(!prs_align(ps))
- return False;
- if(!prs_uint32("rid", ps, depth, &sam->rid))
- return False;
- if(!smb_io_unihdr("unihdr", &sam->hdr_name, ps, depth)) /* account name unicode string header */
- return False;
-
- return True;
-}
-
-/*******************************************************************
-inits a SAMR_Q_ENUM_DOM_GROUPS structure.
-********************************************************************/
-
-void init_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS * q_e,
- POLICY_HND *pol,
- uint32 start_idx, uint32 size)
-{
- DEBUG(5, ("init_samr_q_enum_dom_groups\n"));
-
- q_e->pol = *pol;
-
- q_e->start_idx = start_idx;
- q_e->max_size = size;
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-bool samr_io_q_enum_dom_groups(const char *desc, SAMR_Q_ENUM_DOM_GROUPS * q_e,
- prs_struct *ps, int depth)
-{
- if (q_e == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "samr_io_q_enum_dom_groups");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_pol_hnd("pol", &(q_e->pol), ps, depth))
- return False;
-
- if(!prs_uint32("start_idx", ps, depth, &q_e->start_idx))
- return False;
- if(!prs_uint32("max_size ", ps, depth, &q_e->max_size))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-inits a SAMR_R_ENUM_DOM_GROUPS structure.
-********************************************************************/
-
-void init_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS * r_u,
- uint32 next_idx, uint32 num_sam_entries)
-{
- DEBUG(5, ("init_samr_r_enum_dom_groups\n"));
-
- r_u->next_idx = next_idx;
-
- if (num_sam_entries != 0) {
- r_u->ptr_entries1 = 1;
- r_u->ptr_entries2 = 1;
- r_u->num_entries2 = num_sam_entries;
- r_u->num_entries3 = num_sam_entries;
-
- r_u->num_entries4 = num_sam_entries;
- } else {
- r_u->ptr_entries1 = 0;
- r_u->num_entries2 = num_sam_entries;
- r_u->ptr_entries2 = 1;
- }
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-bool samr_io_r_enum_dom_groups(const char *desc, SAMR_R_ENUM_DOM_GROUPS * r_u,
- prs_struct *ps, int depth)
-{
- uint32 i;
-
- if (r_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "samr_io_r_enum_dom_groups");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("next_idx ", ps, depth, &r_u->next_idx))
- return False;
- if(!prs_uint32("ptr_entries1", ps, depth, &r_u->ptr_entries1))
- return False;
-
- if (r_u->ptr_entries1 != 0) {
- if(!prs_uint32("num_entries2", ps, depth, &r_u->num_entries2))
- return False;
- if(!prs_uint32("ptr_entries2", ps, depth, &r_u->ptr_entries2))
- return False;
- if(!prs_uint32("num_entries3", ps, depth, &r_u->num_entries3))
- return False;
-
- if (UNMARSHALLING(ps) && r_u->num_entries2) {
- r_u->sam = PRS_ALLOC_MEM(ps,SAM_ENTRY,r_u->num_entries2);
- r_u->uni_grp_name = PRS_ALLOC_MEM(ps,UNISTR2,r_u->num_entries2);
- }
-
- if ((r_u->sam == NULL || r_u->uni_grp_name == NULL) && r_u->num_entries2 != 0) {
- DEBUG(0,
- ("NULL pointers in SAMR_R_ENUM_DOM_GROUPS\n"));
- r_u->num_entries4 = 0;
- r_u->status = NT_STATUS_MEMORY_NOT_ALLOCATED;
- return False;
- }
-
- for (i = 0; i < r_u->num_entries2; i++) {
- if(!sam_io_sam_entry("", &r_u->sam[i], ps, depth))
- return False;
- }
-
- for (i = 0; i < r_u->num_entries2; i++) {
- if(!smb_io_unistr2("", &r_u->uni_grp_name[i],
- r_u->sam[i].hdr_name.buffer, ps, depth))
- return False;
- }
- }
-
- if(!prs_align(ps))
- return False;
- if(!prs_uint32("num_entries4", ps, depth, &r_u->num_entries4))
- return False;
- if(!prs_ntstatus("status", ps, depth, &r_u->status))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-inits a SAMR_Q_ENUM_DOM_ALIASES structure.
-********************************************************************/
-
-void init_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES * q_e,
- POLICY_HND *pol, uint32 start_idx,
- uint32 size)
-{
- DEBUG(5, ("init_samr_q_enum_dom_aliases\n"));
-
- q_e->pol = *pol;
-
- q_e->start_idx = start_idx;
- q_e->max_size = size;
-}
-
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-bool samr_io_q_enum_dom_aliases(const char *desc, SAMR_Q_ENUM_DOM_ALIASES * q_e,
- prs_struct *ps, int depth)
-{
- if (q_e == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "samr_io_q_enum_dom_aliases");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_pol_hnd("pol", &q_e->pol, ps, depth))
- return False;
-
- if(!prs_uint32("start_idx", ps, depth, &q_e->start_idx))
- return False;
- if(!prs_uint32("max_size ", ps, depth, &q_e->max_size))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-inits a SAMR_R_ENUM_DOM_ALIASES structure.
-********************************************************************/
-
-void init_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, uint32 next_idx, uint32 num_sam_entries)
-{
- DEBUG(5, ("init_samr_r_enum_dom_aliases\n"));
-
- r_u->next_idx = next_idx;
-
- if (num_sam_entries != 0) {
- r_u->ptr_entries1 = 1;
- r_u->ptr_entries2 = 1;
- r_u->num_entries2 = num_sam_entries;
- r_u->num_entries3 = num_sam_entries;
-
- r_u->num_entries4 = num_sam_entries;
- } else {
- r_u->ptr_entries1 = 0;
- r_u->num_entries2 = num_sam_entries;
- r_u->ptr_entries2 = 1;
- }
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-bool samr_io_r_enum_dom_aliases(const char *desc, SAMR_R_ENUM_DOM_ALIASES * r_u,
- prs_struct *ps, int depth)
-{
- uint32 i;
-
- if (r_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "samr_io_r_enum_dom_aliases");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!prs_uint32("next_idx ", ps, depth, &r_u->next_idx))
- return False;
- if(!prs_uint32("ptr_entries1", ps, depth, &r_u->ptr_entries1))
- return False;
-
- if (r_u->ptr_entries1 != 0) {
- if(!prs_uint32("num_entries2", ps, depth, &r_u->num_entries2))
- return False;
- if(!prs_uint32("ptr_entries2", ps, depth, &r_u->ptr_entries2))
- return False;
- if(!prs_uint32("num_entries3", ps, depth, &r_u->num_entries3))
--
Samba Shared Repository
More information about the samba-cvs
mailing list