diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-12-14 05:20:38 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:07:24 -0500 |
commit | 9927ffd600fcccb918a0ff9ff56c79faf099ad3e (patch) | |
tree | f642cbc9f834a4924febde92fc1761a18aaa40c4 /source4/rpc_server | |
parent | 8a3d15127b8abe5861f35552f02fad1d41af9d3d (diff) | |
download | samba-9927ffd600fcccb918a0ff9ff56c79faf099ad3e.tar.gz samba-9927ffd600fcccb918a0ff9ff56c79faf099ad3e.tar.bz2 samba-9927ffd600fcccb918a0ff9ff56c79faf099ad3e.zip |
r4194: added server side implementation of lsa_EnumPrivs
(This used to be commit 710732033261f6355893b94b43e6c532baa105e0)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/lsa/dcesrv_lsa.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c index 234071b523..8ebbca5186 100644 --- a/source4/rpc_server/lsa/dcesrv_lsa.c +++ b/source4/rpc_server/lsa/dcesrv_lsa.c @@ -98,7 +98,40 @@ static NTSTATUS lsa_Delete(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_c static NTSTATUS lsa_EnumPrivs(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct lsa_EnumPrivs *r) { - DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); + struct dcesrv_handle *h; + struct lsa_policy_state *state; + int i; + const char *privname; + + DCESRV_PULL_HANDLE(h, r->in.handle, LSA_HANDLE_POLICY); + + state = h->data; + + i = *r->in.resume_handle; + if (i == 0) i = 1; + + while ((privname = sec_privilege_name(i)) && + r->out.privs->count < r->in.max_count) { + struct lsa_PrivEntry *e; + + r->out.privs->privs = talloc_realloc_p(r->out.privs, + r->out.privs->privs, + struct lsa_PrivEntry, + r->out.privs->count+1); + if (r->out.privs->privs == NULL) { + return NT_STATUS_NO_MEMORY; + } + e = &r->out.privs->privs[r->out.privs->count]; + e->luid_low = i; + e->luid_high = 0; + e->name.string = privname; + r->out.privs->count++; + i++; + } + + *r->in.resume_handle = i; + + return NT_STATUS_OK; } |