From ff909274787a92fcdb0ed36bab097f7d2ae07036 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 15 Jan 2005 03:54:03 +0000 Subject: r4746: add server support for lsa_enum_acct_rights(); last checkin for the night (This used to be commit ccdff4a998405544433aa32938963e4c37962fcc) --- source3/rpc_parse/parse_lsa.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'source3/rpc_parse') 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 @@ -2299,6 +2299,33 @@ void init_q_enum_acct_rights(LSA_Q_ENUM_ACCT_RIGHTS *q_q, init_dom_sid2(&q_q->sid, sid); } +/******************************************************************* +********************************************************************/ +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; icount; 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. ********************************************************************/ -- cgit