server: Include groups in file mode calculation if the security descriptor matches the current user.
This commit is contained in:
parent
a28c7caf3e
commit
3321c45038
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue