1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-03 04:23:50 +03:00

r4746: add server support for lsa_enum_acct_rights(); last checkin for the night

This commit is contained in:
Gerald Carter
2005-01-15 03:54:03 +00:00
committed by Gerald (Jerry) Carter
parent 7bf1312287
commit ccdff4a998
5 changed files with 105 additions and 19 deletions

View File

@@ -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; 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.
********************************************************************/