summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-14 13:30:51 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-08-18 09:50:38 +1000
commit7c6ca95bec5141707d4f19e802062731d6789cc5 (patch)
treed6ee504cf0f98ff62b5bac6b19a869f8378c3757 /source4/dsdb
parent60086dcf9a58525d400b39e9464847d73cbce6d2 (diff)
downloadsamba-7c6ca95bec5141707d4f19e802062731d6789cc5.tar.gz
samba-7c6ca95bec5141707d4f19e802062731d6789cc5.tar.bz2
samba-7c6ca95bec5141707d4f19e802062731d6789cc5.zip
s4:security Remove use of user_sid and group_sid from struct security_token
This makes the structure more like Samba3's NT_USER_TOKEN
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/acl.c4
-rw-r--r--source4/dsdb/samdb/samdb.c6
-rw-r--r--source4/dsdb/samdb/samdb_privilege.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/acl.c b/source4/dsdb/samdb/ldb_modules/acl.c
index 9965e5374b..55d252b100 100644
--- a/source4/dsdb/samdb/ldb_modules/acl.c
+++ b/source4/dsdb/samdb/ldb_modules/acl.c
@@ -709,7 +709,9 @@ static int acl_check_self_membership(TALLOC_CTX *mem_ctx,
return LDB_SUCCESS;
}
/* if we are adding/deleting ourselves, check for self membership */
- ret = dsdb_find_dn_by_sid(ldb, mem_ctx, acl_user_token(module)->user_sid, &user_dn);
+ ret = dsdb_find_dn_by_sid(ldb, mem_ctx,
+ acl_user_token(module)->sids[PRIMARY_USER_SID_INDEX],
+ &user_dn);
if (ret != LDB_SUCCESS) {
return ret;
}
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index 2b4e9a1438..2d64cc1b85 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -157,8 +157,6 @@ NTSTATUS security_token_create(TALLOC_CTX *mem_ctx,
ptoken = security_token_initialise(mem_ctx);
NT_STATUS_HAVE_NO_MEMORY(ptoken);
- ptoken->user_sid = talloc_reference(ptoken, user_sid);
- ptoken->group_sid = talloc_reference(ptoken, group_sid);
ptoken->privilege_mask = 0;
ptoken->sids = talloc_array(ptoken, struct dom_sid *, n_groupSIDs + 6 /* over-allocate */);
@@ -169,8 +167,8 @@ NTSTATUS security_token_create(TALLOC_CTX *mem_ctx,
ptoken->sids = talloc_realloc(ptoken, ptoken->sids, struct dom_sid *, ptoken->num_sids + 1);
NT_STATUS_HAVE_NO_MEMORY(ptoken->sids);
- ptoken->sids[0] = ptoken->user_sid;
- ptoken->sids[1] = ptoken->group_sid;
+ ptoken->sids[PRIMARY_USER_SID_INDEX] = talloc_reference(ptoken, user_sid);
+ ptoken->sids[PRIMARY_GROUP_SID_INDEX] = talloc_reference(ptoken, group_sid);
ptoken->num_sids++;
/*
diff --git a/source4/dsdb/samdb/samdb_privilege.c b/source4/dsdb/samdb/samdb_privilege.c
index f05b7e2a18..38e5a33831 100644
--- a/source4/dsdb/samdb/samdb_privilege.c
+++ b/source4/dsdb/samdb/samdb_privilege.c
@@ -93,7 +93,7 @@ NTSTATUS samdb_privilege_setup(struct tevent_context *ev_ctx,
NTSTATUS status;
/* Shortcuts to prevent recursion and avoid lookups */
- if (token->user_sid == NULL) {
+ if (token->sids == NULL) {
token->privilege_mask = 0;
return NT_STATUS_OK;
}