diff options
author | Gerald Carter <jerry@samba.org> | 2005-01-15 03:54:03 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:53:54 -0500 |
commit | ff909274787a92fcdb0ed36bab097f7d2ae07036 (patch) | |
tree | b41eadef6832bed2cba4d9be555d258ed2975b67 /source3/rpc_parse | |
parent | c727866172b5abb1cab0913eb78f3f1d58fcb9aa (diff) | |
download | samba-ff909274787a92fcdb0ed36bab097f7d2ae07036.tar.gz samba-ff909274787a92fcdb0ed36bab097f7d2ae07036.tar.bz2 samba-ff909274787a92fcdb0ed36bab097f7d2ae07036.zip |
r4746: add server support for lsa_enum_acct_rights(); last checkin for the night
(This used to be commit ccdff4a998405544433aa32938963e4c37962fcc)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_lsa.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index a4a3917d2e..c4ff240cef 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -2300,6 +2300,33 @@ void init_q_enum_acct_rights(LSA_Q_ENUM_ACCT_RIGHTS *q_q, } /******************************************************************* +********************************************************************/ +NTSTATUS init_r_enum_acct_rights( LSA_R_ENUM_ACCT_RIGHTS *r_u, PRIVILEGE_SET *privileges ) +{ + uint32 i; + 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( get_talloc_ctx(), privname, &privname_array, &num_priv ) ) + return NT_STATUS_NO_MEMORY; + } + } + + if ( num_priv ) { + if ( !init_unistr2_array( &r_u->rights, num_priv, privname_array ) ) + return NT_STATUS_NO_MEMORY; + + r_u->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 *q_q, prs_struct *ps, int depth) |