diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-08-20 12:15:15 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-08-23 08:50:55 +1000 |
commit | 6cf29b3e4f3880882eb7df45dbcfaf7bd2b8d9f4 (patch) | |
tree | 04d4e97f0505568e2ec333e27dcd9e26c3467af4 /source4/libcli/security | |
parent | abcfc114978fd2d065f800bcfe53f63ab567c069 (diff) | |
download | samba-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')
-rw-r--r-- | source4/libcli/security/create_descriptor.c | 8 | ||||
-rw-r--r-- | source4/libcli/security/security_token.c | 6 |
2 files changed, 7 insertions, 7 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; diff --git a/source4/libcli/security/security_token.c b/source4/libcli/security/security_token.c index f9be977a26..e5ea598565 100644 --- a/source4/libcli/security/security_token.c +++ b/source4/libcli/security/security_token.c @@ -65,7 +65,7 @@ void security_token_debug(int dbg_lev, const struct security_token *token) (unsigned long)token->num_sids)); for (i = 0; i < token->num_sids; i++) { DEBUGADD(dbg_lev, (" SID[%3lu]: %s\n", (unsigned long)i, - dom_sid_string(mem_ctx, token->sids[i]))); + dom_sid_string(mem_ctx, &token->sids[i]))); } security_token_debug_privileges(dbg_lev, token); @@ -77,7 +77,7 @@ void security_token_debug(int dbg_lev, const struct security_token *token) bool security_token_is_sid(const struct security_token *token, const struct dom_sid *sid) { - if (token->sids && dom_sid_equal(token->sids[PRIMARY_USER_SID_INDEX], sid)) { + if (token->sids && dom_sid_equal(&token->sids[PRIMARY_USER_SID_INDEX], sid)) { return true; } return false; @@ -109,7 +109,7 @@ bool security_token_has_sid(const struct security_token *token, const struct dom { int i; for (i = 0; i < token->num_sids; i++) { - if (dom_sid_equal(token->sids[i], sid)) { + if (dom_sid_equal(&token->sids[i], sid)) { return true; } } |