1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-07-28 10:42:06 +03:00

Update permissions from 777 to 1777

This still supports the "arbitrary user" use case but with slightly tighter permissions on the end result.

This one is a little bit more "special" other images (due to the existing runtime/entrypoint modification of the directory modes) so I've tried to pick reasonable values for both halves.
This commit is contained in:
Tianon Gravi
2023-03-10 16:05:06 -08:00
parent 156d0659d0
commit 25b3034e9b
17 changed files with 34 additions and 34 deletions

View File

@ -38,11 +38,11 @@ docker_create_db_directories() {
mkdir -p "$PGDATA"
# ignore failure since there are cases where we can't chmod (and PostgreSQL might fail later anyhow - it's picky about permissions of this directory)
chmod 700 "$PGDATA" || :
chmod 00700 "$PGDATA" || :
# ignore failure since it will be fine when using the image provided directory; see also https://github.com/docker-library/postgres/pull/289
mkdir -p /var/run/postgresql || :
chmod 775 /var/run/postgresql || :
chmod 03775 /var/run/postgresql || :
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
if [ -n "${POSTGRES_INITDB_WALDIR:-}" ]; then