[PATCH 2/2] server: Include user groups in file mode calculation when user is file owner

Alexandre Julliard julliard at winehq.org
Thu Dec 10 08:50:27 CST 2009


"Ben Peddell" <klightspeed at netspace.net.au> writes:

> @@ -474,7 +475,9 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
>                          if (access & FILE_EXECUTE)
>                              denied_mode |= S_IXUSR|S_IXGRP|S_IXOTH;
>                      }
> -                    else if (security_equal_sid( sid, owner ))
> +                    else if (security_equal_sid( sid, owner ) ||
> +                             (security_equal_sid( user, owner ) &&
> +                              token_sid_present( current->process->token, sid, TRUE )))
>                      {
>                          unsigned int access = generic_file_map_access( ad_ace->Mask );
>                          if (access & FILE_READ_DATA)
> @@ -498,7 +501,9 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
>                          if (access & FILE_EXECUTE)
>                              new_mode |= S_IXUSR|S_IXGRP|S_IXOTH;
>                      }
> -                    else if (security_equal_sid( sid, owner ))
> +                    else if (security_equal_sid( sid, owner ) ||
> +                             (security_equal_sid( user, owner ) &&
> +                              token_sid_present( current->process->token, sid, FALSE )))

You should most likely set the group permissions too in that case.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list