]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Remove unused marshalling for LSA_ENUM_ACCT_RIGHTS.
authorGünther Deschner <gd@samba.org>
Thu, 14 Feb 2008 14:11:35 +0000 (15:11 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 14 Feb 2008 14:11:35 +0000 (15:11 +0100)
Guenther

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

index 1b82342cfcb58241efaeb5b7c81f0aa8fdc3f18a..0cfee2da61d68771757ddd5933ab56889fa615a4 100644 (file)
@@ -446,22 +446,6 @@ typedef struct lsa_r_lookup_names4
        NTSTATUS status; /* return code */
 } LSA_R_LOOKUP_NAMES4;
 
-/* LSA_Q_ENUM_ACCT_RIGHTS - LSA enum account rights */
-typedef struct
-{
-       POLICY_HND pol; /* policy handle */
-       DOM_SID2 sid;
-} LSA_Q_ENUM_ACCT_RIGHTS;
-
-/* LSA_R_ENUM_ACCT_RIGHTS - LSA enum account rights */
-typedef struct
-{
-       uint32 count;
-       UNISTR4_ARRAY *rights;
-       NTSTATUS status;
-} LSA_R_ENUM_ACCT_RIGHTS;
-
-
 /* LSA_Q_REMOVE_ACCT_RIGHTS - LSA remove account rights */
 typedef struct
 {
index 1395aa66324c91b3b37d5458ec103410a4296009..1de95920de092eac7b0e330cc5875763fc3f4379 100644 (file)
@@ -452,76 +452,6 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
        return result;
 }
 
-/* Enumerate account rights This is similar to enum_privileges but
-   takes a SID directly, avoiding the open_account call.
-*/
-
-NTSTATUS rpccli_lsa_enum_account_rights(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
-                                    POLICY_HND *pol, DOM_SID *sid,
-                                    uint32 *count, char ***priv_names)
-{
-       prs_struct qbuf, rbuf;
-       LSA_Q_ENUM_ACCT_RIGHTS q;
-       LSA_R_ENUM_ACCT_RIGHTS r;
-       NTSTATUS result;
-       int i;
-       fstring *privileges;
-       char **names;
-
-       ZERO_STRUCT(q);
-       ZERO_STRUCT(r);
-
-       /* Marshall data and send request */
-       init_q_enum_acct_rights(&q, pol, 2, sid);
-
-       CLI_DO_RPC( cli, mem_ctx, PI_LSARPC, LSA_ENUMACCTRIGHTS,
-               q, r,
-               qbuf, rbuf,
-               lsa_io_q_enum_acct_rights,
-               lsa_io_r_enum_acct_rights,
-               NT_STATUS_UNSUCCESSFUL);
-
-       result = r.status;
-
-       if (!NT_STATUS_IS_OK(result)) {
-               goto done;
-       }
-
-       *count = r.count;
-       if (! *count) {
-               goto done;
-       }
-
-
-       privileges = TALLOC_ARRAY( mem_ctx, fstring, *count );
-       names      = TALLOC_ARRAY( mem_ctx, char *, *count );
-
-       if ((privileges == NULL) || (names == NULL)) {
-               TALLOC_FREE(privileges);
-               TALLOC_FREE(names);
-               return NT_STATUS_NO_MEMORY;
-       }
-
-       for ( i=0; i<*count; i++ ) {
-               UNISTR4 *uni_string = &r.rights->strings[i];
-
-               if ( !uni_string->string )
-                       continue;
-
-               rpcstr_pull( privileges[i], uni_string->string->buffer, sizeof(privileges[i]), -1, STR_TERMINATE );
-
-               /* now copy to the return array */
-               names[i] = talloc_strdup( mem_ctx, privileges[i] );
-       }
-
-       *priv_names = names;
-
-done:
-
-       return result;
-}
-
-
 /* remove account rights for an account. */
 
 NTSTATUS rpccli_lsa_remove_account_rights(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
index 05841e59a7cc5487f932daa14bc3f457c67b42d4..1a5c5e8a3e7c087a45347d7b968eafec9ba732f9 100644 (file)
@@ -1219,98 +1219,6 @@ bool policy_handle_is_valid(const POLICY_HND *hnd)
        return ((memcmp(&zero_pol, hnd, sizeof(POLICY_HND)) == 0) ? False : True );
 }
 
-/*******************************************************************
- Inits an LSA_Q_ENUM_ACCT_RIGHTS structure.
-********************************************************************/
-void init_q_enum_acct_rights(LSA_Q_ENUM_ACCT_RIGHTS *in, 
-                            POLICY_HND *hnd, 
-                            uint32 count, 
-                            DOM_SID *sid)
-{
-       DEBUG(5, ("init_q_enum_acct_rights\n"));
-
-       in->pol = *hnd;
-       init_dom_sid2(&in->sid, sid);
-}
-
-/*******************************************************************
-********************************************************************/
-NTSTATUS init_r_enum_acct_rights( LSA_R_ENUM_ACCT_RIGHTS *out, PRIVILEGE_SET *privileges )
-{
-       uint32 i;
-       const char *privname;
-       const char **privname_array = NULL;
-       int num_priv = 0;
-
-       for ( i=0; i<privileges->count; i++ ) {
-               privname = luid_to_privilege_name( &privileges->set[i].luid );
-               if ( privname ) {
-                       if ( !add_string_to_array( talloc_tos(), privname, &privname_array, &num_priv ) )
-                               return NT_STATUS_NO_MEMORY;
-               }
-       }
-
-       if ( num_priv ) {
-               out->rights = TALLOC_P( talloc_tos(), UNISTR4_ARRAY );
-               if (!out->rights) {
-                       return NT_STATUS_NO_MEMORY;
-               }
-
-               if ( !init_unistr4_array( out->rights, num_priv, privname_array ) ) 
-                       return NT_STATUS_NO_MEMORY;
-
-               out->count = num_priv;
-       }
-
-       return NT_STATUS_OK;
-}
-
-/*******************************************************************
-reads or writes a LSA_Q_ENUM_ACCT_RIGHTS structure.
-********************************************************************/
-bool lsa_io_q_enum_acct_rights(const char *desc, LSA_Q_ENUM_ACCT_RIGHTS *in, prs_struct *ps, int depth)
-{
-       
-       if (in == NULL)
-               return False;
-
-       prs_debug(ps, depth, desc, "lsa_io_q_enum_acct_rights");
-       depth++;
-
-       if (!smb_io_pol_hnd("", &in->pol, ps, depth))
-               return False;
-
-       if(!smb_io_dom_sid2("sid", &in->sid, ps, depth))
-               return False;
-
-       return True;
-}
-
-
-/*******************************************************************
-reads or writes a LSA_R_ENUM_ACCT_RIGHTS structure.
-********************************************************************/
-bool lsa_io_r_enum_acct_rights(const char *desc, LSA_R_ENUM_ACCT_RIGHTS *out, prs_struct *ps, int depth)
-{
-       prs_debug(ps, depth, desc, "lsa_io_r_enum_acct_rights");
-       depth++;
-
-       if(!prs_uint32("count   ", ps, depth, &out->count))
-               return False;
-
-       if ( !prs_pointer("rights", ps, depth, (void*)&out->rights, sizeof(UNISTR4_ARRAY), (PRS_POINTER_CAST)prs_unistr4_array) )
-               return False;
-
-       if(!prs_align(ps))
-               return False;
-
-       if(!prs_ntstatus("status", ps, depth, &out->status))
-               return False;
-
-       return True;
-}
-
-
 /*******************************************************************
  Inits an LSA_Q_REMOVE_ACCT_RIGHTS structure.
 ********************************************************************/