summaryrefslogtreecommitdiff
path: root/source4/rpc_server/lsa
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-26 18:38:59 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-09-11 18:46:05 +1000
commit9abfd8fe3bf4fd3bfae34e7b621369d3f67cf73c (patch)
tree52fc20f47054e78058da719b5909c47b36b14114 /source4/rpc_server/lsa
parente113af6fb11504a87fd821fb0d77ff855a36e6d5 (diff)
downloadsamba-9abfd8fe3bf4fd3bfae34e7b621369d3f67cf73c.tar.gz
samba-9abfd8fe3bf4fd3bfae34e7b621369d3f67cf73c.tar.bz2
samba-9abfd8fe3bf4fd3bfae34e7b621369d3f67cf73c.zip
s4-privs Add a lookup by index of privilages
Now that privileges are no longer given luid values sequentially, we need another way to look them up for enumeration. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/rpc_server/lsa')
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index 51b6339a12..988acda10b 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -291,6 +291,7 @@ static NTSTATUS dcesrv_lsa_EnumPrivs(struct dcesrv_call_state *dce_call, TALLOC_
struct dcesrv_handle *h;
struct lsa_policy_state *state;
uint32_t i;
+ enum sec_privilege priv;
const char *privname;
DCESRV_PULL_HANDLE(h, r->in.handle, LSA_HANDLE_POLICY);
@@ -298,12 +299,11 @@ static NTSTATUS dcesrv_lsa_EnumPrivs(struct dcesrv_call_state *dce_call, TALLOC_
state = h->data;
i = *r->in.resume_handle;
- if (i == 0) i = 1;
- while ((privname = sec_privilege_name(i)) &&
+ while (((priv = sec_privilege_from_index(i)) != -1) &&
r->out.privs->count < r->in.max_count) {
struct lsa_PrivEntry *e;
-
+ privname = sec_privilege_name(priv);
r->out.privs->privs = talloc_realloc(r->out.privs,
r->out.privs->privs,
struct lsa_PrivEntry,