bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 0.17: open-with-O_CREAT needs third argument


From: Paul Jarc
Subject: Re: 0.17: open-with-O_CREAT needs third argument
Date: Wed, 07 Nov 2007 12:43:03 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Chuck Swiger <address@hidden> wrote:
> On Nov 7, 2007, at 3:44 AM, Bruno Haible wrote:
>> 0666 is more appropriate here
>
> If you're creating a file on behalf of the user, I would expect it to
> receive permissions which reflect whatever umask(2) has been set to.

And so it will.  open() applies the umask to the permissions passed as
an argument, rather than using the argument directly.  To actually
create a world-writable file, you'd have to first set the umask to 0,
or chmod() the file after creating it.


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]