summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-31 09:28:51 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-09-11 18:46:11 +1000
commita32cdadb7cbff255b5a0133a3bb54352d0d42f61 (patch)
tree8d8ac093e65941ebd57ced9a8f30f991fbcb4c6c
parent0b41ef789575e5194e9b499cf5fe0df4616f1bb8 (diff)
downloadsamba-a32cdadb7cbff255b5a0133a3bb54352d0d42f61.tar.gz
samba-a32cdadb7cbff255b5a0133a3bb54352d0d42f61.tar.bz2
samba-a32cdadb7cbff255b5a0133a3bb54352d0d42f61.zip
libcli/security Make sec_privilege_from_index() return SEC_PRIV_INVALID on failure
This is clearer and more consistent than using a magic -1 return Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rw-r--r--libcli/security/privileges.c2
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libcli/security/privileges.c b/libcli/security/privileges.c
index 5c33f04693..f5fa836472 100644
--- a/libcli/security/privileges.c
+++ b/libcli/security/privileges.c
@@ -379,7 +379,7 @@ enum sec_privilege sec_privilege_from_index(int idx)
if (idx >= 0 && idx<ARRAY_SIZE(privs)) {
return privs[idx].luid;
}
- return -1;
+ return SEC_PRIV_INVALID;
}
/*
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index dedb21cd39..0a304d380c 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -300,7 +300,7 @@ static NTSTATUS dcesrv_lsa_EnumPrivs(struct dcesrv_call_state *dce_call, TALLOC_
i = *r->in.resume_handle;
- while (((priv = sec_privilege_from_index(i)) != -1) &&
+ while (((priv = sec_privilege_from_index(i)) != SEC_PRIV_INVALID) &&
r->out.privs->count < r->in.max_count) {
struct lsa_PrivEntry *e;
privname = sec_privilege_name(priv);