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

From Magnus Hagander
Subject Re: [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags
Date
Msg-id AANLkTi=r+GYNzyF7FcU_cg=o8eyRpP7tOuLcBRFr2hBe@mail.gmail.com
Whole thread Raw
Responses Re: [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
This broke the buildfarm on Windows, and I'm not sure of the best way to fix it.

We currently define read and write permissions in port/win32.h
specifically for windows. A quick-fix to just add these new ones as
aliases won't work, because they are used in both open and umask
calls.

Since umask() "turns off" permissions, they can't be defined to the
same, or all files are created readonly. For umask, it would work to
define them to 0. But for open() and other such calls that "turn on"
permissions", it needs to be defined to the same value as "read
permissions for user".

Not sure of the best way to fix this. Perhaps we need to invent
PG_UMASK_xyz macros?

//Magnus

On Fri, Dec 10, 2010 at 23:35, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Use symbolic names not octal constants for file permission flags.
>
> Purely cosmetic patch to make our coding standards more consistent ---
> we were doing symbolic some places and octal other places.  This patch
> fixes all C-coded uses of mkdir, chmod, and umask.  There might be some
> other calls I missed.  Inconsistency noted while researching tablespace
> directory permissions issue.
>
> Branch
> ------
> master
>
> Details
> -------
> http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=04f4e10cfc158239ca00a6ed6a84428c7acb1e6d
>
> Modified Files
> --------------
> src/backend/access/transam/xlog.c   |    2 +-
> src/backend/commands/copy.c         |    2 +-
> src/backend/commands/tablespace.c   |    2 +-
> src/backend/libpq/be-fsstubs.c      |    7 ++++---
> src/backend/postmaster/postmaster.c |    4 ++--
> src/backend/postmaster/syslogger.c  |    6 +++---
> src/backend/storage/file/copydir.c  |    2 +-
> src/backend/storage/ipc/ipc.c       |    4 ++--
> src/bin/initdb/initdb.c             |   16 ++++++++--------
> src/bin/pg_ctl/pg_ctl.c             |    2 +-
> 10 files changed, 24 insertions(+), 23 deletions(-)
>
>
> --
> Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-committers
>



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


pgsql-hackers by date:

Previous
From: Daniel Loureiro
Date:
Subject: Re: Anyone for SSDs?
Next
From: Magnus Hagander
Date:
Subject: Re: Final(?) proposal for wal_sync_method changes