summaryrefslogtreecommitdiff
path: root/source4/libcli/security/create_descriptor.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-20 12:15:15 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-08-23 08:50:55 +1000
commit6cf29b3e4f3880882eb7df45dbcfaf7bd2b8d9f4 (patch)
tree04d4e97f0505568e2ec333e27dcd9e26c3467af4 /source4/libcli/security/create_descriptor.c
parentabcfc114978fd2d065f800bcfe53f63ab567c069 (diff)
downloadsamba-6cf29b3e4f3880882eb7df45dbcfaf7bd2b8d9f4.tar.gz
samba-6cf29b3e4f3880882eb7df45dbcfaf7bd2b8d9f4.tar.bz2
samba-6cf29b3e4f3880882eb7df45dbcfaf7bd2b8d9f4.zip
s4:security Change struct security_token->sids from struct dom_sid * to struct dom_sid
This makes the structure much more like NT_USER_TOKEN in the source3/ code. (The remaining changes are that privilages still need to be merged) Andrew Bartlett
Diffstat (limited to 'source4/libcli/security/create_descriptor.c')
-rw-r--r--source4/libcli/security/create_descriptor.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/libcli/security/create_descriptor.c b/source4/libcli/security/create_descriptor.c
index cb52d6502e..ad6a599969 100644
--- a/source4/libcli/security/create_descriptor.c
+++ b/source4/libcli/security/create_descriptor.c
@@ -367,7 +367,7 @@ struct security_descriptor *create_security_descriptor(TALLOC_CTX *mem_ctx,
if ((inherit_flags & SEC_OWNER_FROM_PARENT) && parent_sd) {
new_owner = parent_sd->owner_sid;
} else if (!default_owner) {
- new_owner = token->sids[PRIMARY_USER_SID_INDEX];
+ new_owner = &token->sids[PRIMARY_USER_SID_INDEX];
} else {
new_owner = default_owner;
new_sd->type |= SEC_DESC_OWNER_DEFAULTED;
@@ -379,11 +379,11 @@ struct security_descriptor *create_security_descriptor(TALLOC_CTX *mem_ctx,
if (!creator_sd || !creator_sd->group_sid){
if ((inherit_flags & SEC_GROUP_FROM_PARENT) && parent_sd) {
new_group = parent_sd->group_sid;
- } else if (!default_group && token->sids[PRIMARY_GROUP_SID_INDEX]) {
- new_group = token->sids[PRIMARY_GROUP_SID_INDEX];
+ } else if (!default_group && token->num_sids > PRIMARY_GROUP_SID_INDEX) {
+ new_group = &token->sids[PRIMARY_GROUP_SID_INDEX];
} else if (!default_group) {
/* This will happen only for anonymous, which has no other groups */
- new_group = token->sids[PRIMARY_USER_SID_INDEX];
+ new_group = &token->sids[PRIMARY_USER_SID_INDEX];
} else {
new_group = default_group;
new_sd->type |= SEC_DESC_GROUP_DEFAULTED;