Re: [hypermail] Followup [was New bug: attachments are not being overwritten]

From: Jose Kahan <jose.kahan_at_w3.org_at_hypermail-project.org>
Date: Wed, 30 Jul 2003 11:02:06 +0200
Message-ID: <20030730090206.GA4864_at_inrialpes.fr>


Hi Daniel,

On Wed, Jul 30, 2003 at 07:18:17AM +0200, Daniel Stenberg wrote:
> On Tue, 29 Jul 2003, Jose Kahan wrote:
>
> > The solution is either to unlink the file if it already exists or remove the
> > O_CREAT flag and use a chmod afterwards to set the access rights.
> >
> > Which solution shall we adopt?
>
> My vote goes on the removal of the O_CREAT flag. But why do you need to chmod
> afterwards, open() sets the properties as the third argument specifies, right?

That's right. However, there was already a call to chmod right after creating the file. Maybe this was added because of a portability problem. I don't know why.

Anyway, I did some more tests and finally solved the problem. Rather than suppressing the O_CREAT flag, I also added an O_TRUNK flag and this did the trick.

I commited the change.

Thanks for your answer :)

-jose Received on Wed 30 Jul 2003 11:02:37 AM GMT

This archive was generated by hypermail 2.2.0 : Thu 22 Feb 2007 07:33:54 PM GMT GMT