You've already forked postgres
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:
@ -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
|
||||
|
Reference in New Issue
Block a user