summaryrefslogtreecommitdiff
path: root/source3/groupdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-26 20:54:13 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-09-11 18:46:05 +1000
commit4bf783d4d6693f927f5e7ef7a9855766c91983f2 (patch)
treef6cbe7bdc734997850ca85c6defd4c53a7bad148 /source3/groupdb
parent6a0176b07da0b416bc9d750ddea92c612849597c (diff)
downloadsamba-4bf783d4d6693f927f5e7ef7a9855766c91983f2.tar.gz
samba-4bf783d4d6693f927f5e7ef7a9855766c91983f2.tar.bz2
samba-4bf783d4d6693f927f5e7ef7a9855766c91983f2.zip
s3-auth Change type of num_sids to uint32_t
size_t is overkill here, and in struct security_token in the num_sids is uint32_t. This includes a change to the prototype of add_sid_to_array() and add_sid_to_array_unique(), which has had a number of consequnetial changes as I try to sort out all the callers using a pointer to the number of sids. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3/groupdb')
-rw-r--r--source3/groupdb/mapping_tdb.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c
index ee090c4ede..140fd28d97 100644
--- a/source3/groupdb/mapping_tdb.c
+++ b/source3/groupdb/mapping_tdb.c
@@ -409,14 +409,17 @@ static NTSTATUS one_alias_membership(const struct dom_sid *member,
while (next_token_talloc(frame, &p, &string_sid, " ")) {
struct dom_sid alias;
+ uint32_t num_sids;
if (!string_to_sid(&alias, string_sid))
continue;
- status= add_sid_to_array_unique(NULL, &alias, sids, num);
+ num_sids = *num;
+ status= add_sid_to_array_unique(NULL, &alias, sids, &num_sids);
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
+ *num = num_sids;
}
done:
@@ -443,7 +446,8 @@ static NTSTATUS alias_memberships(const struct dom_sid *members, size_t num_memb
static bool is_aliasmem(const struct dom_sid *alias, const struct dom_sid *member)
{
struct dom_sid *sids;
- size_t i, num;
+ size_t i;
+ size_t num;
/* This feels the wrong way round, but the on-disk data structure
* dictates it this way. */
@@ -567,6 +571,7 @@ static int collect_aliasmem(struct db_record *rec, void *priv)
while (next_token_talloc(frame, &p, &alias_string, " ")) {
struct dom_sid alias, member;
const char *member_string;
+ uint32_t num_sids;
if (!string_to_sid(&alias, alias_string))
continue;
@@ -589,13 +594,15 @@ static int collect_aliasmem(struct db_record *rec, void *priv)
if (!string_to_sid(&member, member_string))
continue;
+ num_sids = *state->num;
if (!NT_STATUS_IS_OK(add_sid_to_array(state->mem_ctx, &member,
state->sids,
- state->num)))
+ &num_sids)))
{
/* talloc fail. */
break;
}
+ *state->num = num_sids;
}
TALLOC_FREE(frame);