Re: [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags
Date: 2010-12-11 17:55:43
Message-ID: AANLkTi=YHjgfRmN__E+othsHg_QPXJwF_E5cL50cMPrm@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Sat, Dec 11, 2010 at 18:46, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> On Sat, Dec 11, 2010 at 17:55, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> 1. How did all those pre-existing references to S_IRXWU compile?
>
>> Yeah, that's weird. IIRC (I stopped looking for the moment, need a
>> step back) some of them were protected by #ifndef WIN32, but not all
>> of them..
>
> The lightbulb just went on: in win32.h,
>
> #define mkdir(a,b)      mkdir(a)
>
> I didn't go through in complete detail, but I'll bet all the "working"
> instances are in mkdir calls, or else inside #ifndef WIN32.

Ah, that certainly looks like a smoking gun.

> I think we can just #define the other cases as zeroes.  I'm not sure why
> you think that's an issue for open --- the privileges don't exist.

Hmm. I was/am worried about any case that specifies *just* one of the
permissions that don't exist. That'll leave it at zero, whereas the
correct one might be the user-only version of whatever (read/write)
was given.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-12-11 18:00:26 Re: [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags
Previous Message Tom Lane 2010-12-11 17:46:23 Re: [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-12-11 18:00:26 Re: [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags
Previous Message Tom Lane 2010-12-11 17:46:23 Re: [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags