BUG #15502: pg_dump -Fd does not honor umask

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: kevin(at)kevinlocke(dot)name
Subject: BUG #15502: pg_dump -Fd does not honor umask
Date: 2018-11-13 23:31:40
Message-ID: 15502-891a0555f33c7d82@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15502
Logged by: Kevin Locke
Email address: kevin(at)kevinlocke(dot)name
PostgreSQL version: 11.1
Operating system: Debian GNU/Linux
Description:

The backup file created by `pg_dump -f <path> <db name>` has file
permissions which correspond to the umask for -Fp (plain format), -Fc
(custom format), and -Ft (tar format). For -Fd (directory format) the .dat
files match the umask, but the containing directory never has group or world
permissions, regardless of the umask. For example:

$ umask 002 && pg_dump -Fd -f postgres-dump postgres && ls -al
postgres-dump
total 4
drwx------ 2 postgres postgres 60 Nov 13 16:23 .
drwxrwxrwt 23 root root 600 Nov 13 16:23 ..
-rw-r--r-- 1 postgres postgres 1032 Nov 13 16:23 toc.dat

The postgres-dump directory is created with mode 0700 instead of 0775 which
would be expected based on the umask (e.g. if mkdir were invoked before
pg_dump).

This does not appear to be a security issue, since the permissions are
always more restrictive than the umask. It is an inconsistency and minor
annoyance for users which I thought you might like to fix.

Thanks for considering,
Kevin

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-11-14 06:23:21 BUG #15503: Bytea type column select failed when the length of the value is more than 512M
Previous Message PG Bug reporting form 2018-11-13 20:51:45 BUG #15501: postgresql 9.6.11 packages missing from rhel6 64bit repos