[pkg-discuss] [REVIEW] Fix for bug 5603
Shawn Walker
swalker at opensolaris.org
Wed Jan 7 11:40:04 PST 2009
Danek Duvall wrote:
> On Wed, Jan 07, 2009 at 01:26:35PM -0600, Shawn Walker wrote:
>
>> We don't do a chmod() right now for the attrs file after it's created since
>> (unlike everything else) we don't create a temporary file first; it opens
>> the file in wb+ mode.
>
> Right. If we were to use a temporary file, the chmod would be necessary.
> It's correct as is.
>
>> I suppose this means that there is a race condition for the attrs file too
>> just as there was for the catalog files.
>
> How? The file is just created mode 644 to start, never any worry. The
...unless the user's umask is set incorrectly. umask 0066, for example,
causes the attrs file to get 600 instead of 644 permissions when the
attrs file gets created during startup for a new repository.
>> I figured that since the chmod needs to happen during __init__ anyway, I
>> might as well rely on it to setup the correct permissions for the attrs
>> file.
>
> Sure, that's fine. I just wanted to point out that wasn't necessary.
It is if their umask is wrong.
Cheers,
--
Shawn Walker
More information about the pkg-discuss
mailing list