summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/open.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 955660c148..03e8feb302 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3538,7 +3538,11 @@ static NTSTATUS inherit_new_acl(files_struct *fsp)
owner_sid = &token->sids[PRIMARY_USER_SID_INDEX];
}
if (group_sid == NULL) {
- group_sid = &token->sids[PRIMARY_GROUP_SID_INDEX];
+ if (token->num_sids == PRIMARY_GROUP_SID_INDEX) {
+ group_sid = &token->sids[PRIMARY_USER_SID_INDEX];
+ } else {
+ group_sid = &token->sids[PRIMARY_GROUP_SID_INDEX];
+ }
}
status = se_create_child_secdesc(frame,