Remove unused marshalling for LSA_ENUMPRIVSACCOUNT.
authorGünther Deschner <gd@samba.org>
Thu, 14 Feb 2008 11:15:17 +0000 (12:15 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 14 Feb 2008 12:13:09 +0000 (13:13 +0100)
Guenther
(This used to be commit 004598bc1322b6e2deb62115713768682fee988e)

source3/include/rpc_lsa.h
source3/rpc_client/cli_lsarpc.c
source3/rpc_parse/parse_lsa.c

index 46a01d53e5d9e5b21afba3b0356421c3b1f38cad..0e61b7b2d94bbb8bd1082f65c20aa28b8d6c2936 100644 (file)
@@ -495,19 +495,6 @@ typedef struct
 } LSA_R_REMOVE_ACCT_RIGHTS;
 
 
-typedef struct lsa_q_enumprivsaccount
-{
-       POLICY_HND pol; /* policy handle */
-} LSA_Q_ENUMPRIVSACCOUNT;
-
-typedef struct lsa_r_enumprivsaccount
-{
-       uint32 ptr;
-       uint32 count;
-       PRIVILEGE_SET set;
-       NTSTATUS status;
-} LSA_R_ENUMPRIVSACCOUNT;
-
 typedef struct {
        UNIHDR hdr;
        UNISTR2 unistring;
index 20a0fe28b61fe9f02a0557e13a4a464e13693e14..c5ad98c3ada62b1c361b2faff5844e6bed50d746 100644 (file)
@@ -452,62 +452,6 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
        return result;
 }
 
-/** Enumerate user privileges
- *
- * @param cli Handle on an initialised SMB connection */
-
-NTSTATUS rpccli_lsa_enum_privsaccount(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
-                             POLICY_HND *pol, uint32 *count, LUID_ATTR **set)
-{
-       prs_struct qbuf, rbuf;
-       LSA_Q_ENUMPRIVSACCOUNT q;
-       LSA_R_ENUMPRIVSACCOUNT r;
-       NTSTATUS result;
-       int i;
-
-       ZERO_STRUCT(q);
-       ZERO_STRUCT(r);
-
-       /* Initialise input parameters */
-
-       init_lsa_q_enum_privsaccount(&q, pol);
-
-       CLI_DO_RPC( cli, mem_ctx, PI_LSARPC, LSA_ENUMPRIVSACCOUNT,
-               q, r,
-               qbuf, rbuf,
-               lsa_io_q_enum_privsaccount,
-               lsa_io_r_enum_privsaccount,
-               NT_STATUS_UNSUCCESSFUL);
-
-       /* Return output parameters */
-
-       result = r.status;
-
-       if (!NT_STATUS_IS_OK(result)) {
-               goto done;
-       }
-
-       if (r.count == 0)
-               goto done;
-
-       if (!((*set = TALLOC_ARRAY(mem_ctx, LUID_ATTR, r.count)))) {
-               DEBUG(0, ("(cli_lsa_enum_privsaccount): out of memory\n"));
-               result = NT_STATUS_UNSUCCESSFUL;
-               goto done;
-       }
-
-       for (i=0; i<r.count; i++) {
-               (*set)[i].luid.low = r.set.set[i].luid.low;
-               (*set)[i].luid.high = r.set.set[i].luid.high;
-               (*set)[i].attr = r.set.set[i].attr;
-       }
-
-       *count=r.count;
- done:
-
-       return result;
-}
-
 /** Get a privilege value given its name */
 
 NTSTATUS rpccli_lsa_lookup_priv_value(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
index 6a80bb28a82aa5ad2744cff727074650fd8afbde..2230c9147f9119f78eb8e685ec5d605ce941ec66 100644 (file)
@@ -1207,30 +1207,6 @@ bool lsa_io_r_lookup_names4(const char *desc, LSA_R_LOOKUP_NAMES4 *out, prs_stru
        return True;
 }
 
-void init_lsa_q_enum_privsaccount(LSA_Q_ENUMPRIVSACCOUNT *trn, POLICY_HND *hnd)
-{
-       memcpy(&trn->pol, hnd, sizeof(trn->pol));
-
-}
-
-/*******************************************************************
- Reads or writes an LSA_Q_ENUMPRIVSACCOUNT structure.
-********************************************************************/
-
-bool lsa_io_q_enum_privsaccount(const char *desc, LSA_Q_ENUMPRIVSACCOUNT *out, prs_struct *ps, int depth)
-{
-       prs_debug(ps, depth, desc, "lsa_io_q_enum_privsaccount");
-       depth++;
-
-       if(!prs_align(ps))
-               return False;
-       if(!smb_io_pol_hnd("pol", &out->pol, ps, depth))
-               return False;
-
-       return True;
-}
-
 /*******************************************************************
  Reads or writes an LUID structure.
 ********************************************************************/
@@ -1300,66 +1276,6 @@ static bool lsa_io_privilege_set(const char *desc, PRIVILEGE_SET *out, prs_struc
        return True;
 }
 
-NTSTATUS init_lsa_r_enum_privsaccount(TALLOC_CTX *mem_ctx, LSA_R_ENUMPRIVSACCOUNT *out, LUID_ATTR *set, uint32 count, uint32 control)
-{
-       NTSTATUS ret = NT_STATUS_OK;
-
-       out->ptr = 1;
-       out->count = count;
-
-       if ( !NT_STATUS_IS_OK(ret = privilege_set_init_by_ctx(mem_ctx, &(out->set))) )
-               return ret;
-       
-       out->set.count = count;
-       
-       if (!NT_STATUS_IS_OK(ret = dup_luid_attr(out->set.mem_ctx, &(out->set.set), set, count)))
-               return ret;
-
-       DEBUG(10,("init_lsa_r_enum_privsaccount: %d privileges\n", out->count));
-
-       return ret;
-}
-
-/*******************************************************************
- Reads or writes an LSA_R_ENUMPRIVSACCOUNT structure.
-********************************************************************/
-
-bool lsa_io_r_enum_privsaccount(const char *desc, LSA_R_ENUMPRIVSACCOUNT *out, prs_struct *ps, int depth)
-{
-       prs_debug(ps, depth, desc, "lsa_io_r_enum_privsaccount");
-       depth++;
-
-       if(!prs_align(ps))
-               return False;
-       if(!prs_uint32("ptr", ps, depth, &out->ptr))
-               return False;
-
-       if (out->ptr!=0) {
-               if(!prs_uint32("count", ps, depth, &out->count))
-                       return False;
-
-               /* malloc memory if unmarshalling here */
-
-               if (UNMARSHALLING(ps) && out->count != 0) {
-                       if (!NT_STATUS_IS_OK(privilege_set_init_by_ctx(ps->mem_ctx, &(out->set))))
-                               return False;
-
-                       if (!(out->set.set = PRS_ALLOC_MEM(ps,LUID_ATTR,out->count)))
-                               return False;
-
-               }
-               
-               if(!lsa_io_privilege_set(desc, &out->set, ps, depth))
-                       return False;
-       }
-
-       if(!prs_ntstatus("status", ps, depth, &out->status))
-               return False;
-
-       return True;
-}
-
 void init_lsa_string( LSA_STRING *uni, const char *string )
 {
        init_unistr2(&uni->unistring, string, UNI_FLAGS_NONE);