server: Include groups in file mode calculation if the security descriptor matches the current user.

This commit is contained in:
Hans Leidekker 2011-07-19 09:52:54 +02:00 committed by Alexandre Julliard
parent a28c7caf3e
commit 3321c45038
1 changed files with 8 additions and 8 deletions

View File

@ -505,15 +505,15 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
{
denied_mode |= (mode << 6) | (mode << 3) | mode; /* all */
}
else if (security_equal_sid( sid, owner ))
{
denied_mode |= (mode << 6); /* user only */
}
else if ((security_equal_sid( user, owner ) &&
token_sid_present( current->process->token, sid, TRUE )))
{
denied_mode |= (mode << 6) | (mode << 3); /* user + group */
}
else if (security_equal_sid( sid, owner ))
{
denied_mode |= (mode << 6); /* user only */
}
break;
case ACCESS_ALLOWED_ACE_TYPE:
aa_ace = (const ACCESS_ALLOWED_ACE *)ace;
@ -523,15 +523,15 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
{
new_mode |= (mode << 6) | (mode << 3) | mode; /* all */
}
else if (security_equal_sid( sid, owner ))
{
new_mode |= (mode << 6); /* user only */
}
else if ((security_equal_sid( user, owner ) &&
token_sid_present( current->process->token, sid, FALSE )))
{
new_mode |= (mode << 6) | (mode << 3); /* user + group */
}
else if (security_equal_sid( sid, owner ))
{
new_mode |= (mode << 6); /* user only */
}
break;
}
}