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 13:18:26
Message-ID: AANLkTi=r+GYNzyF7FcU_cg=o8eyRpP7tOuLcBRFr2hBe@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers 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(at)sss(dot)pgh(dot)pa(dot)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(at)postgresql(dot)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/

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2010-12-11 13:20:08 pgsql: Add required new port files to MSVC builds.
Previous Message Robert Haas 2010-12-11 04:25:07 pgsql: Minor documentation cleanup.

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2010-12-11 13:27:37 Re: Final(?) proposal for wal_sync_method changes
Previous Message Vaibhav Kaushal 2010-12-11 08:49:51 Re: Anyone for SSDs?