Skip to content

Set PGDATA permissions to 700 #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 5, 2016
Merged

Set PGDATA permissions to 700 #110

merged 2 commits into from
Jan 5, 2016

Conversation

JacobHayes
Copy link

When mounting a volume to PGDATA, it may not have permissions set to 700 which causes postgres to fail with:

FATAL:  data directory "/var/lib/postgresql/data" has group or world access
Permissions should be u=rwx (0700).

To fix this, we can explicitly set it to 700 like we do with the owner.

@JacobHayes
Copy link
Author

Any feedback on this PR?

@@ -8,6 +8,7 @@ set_listen_addresses() {

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod -R 700 "$PGDATA"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does everything in the directory need to be 700 as well or should we drop the -R?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed

@yosifkit
Copy link
Member

yosifkit commented Jan 5, 2016

Thanks for the reminder!

@yosifkit
Copy link
Member

yosifkit commented Jan 5, 2016

LGTM, ping @tianon

@tianon
Copy link
Member

tianon commented Jan 5, 2016

LGTM

tianon added a commit that referenced this pull request Jan 5, 2016
@tianon tianon merged commit 4774c03 into docker-library:master Jan 5, 2016
@JacobHayes JacobHayes deleted the set-PGDATA-permissions branch January 6, 2016 00:38
@JacobHayes
Copy link
Author

Great! Now to get this actually pushed to hub.docker.com, I'll need to update https://github.com/docker-library/official-images/blob/master/library/postgres, correct? Should I set them all to 4774c03af4eabffe5646a979f102ece292111b96 or is there any reason the tags use different git commits?

@tianon
Copy link
Member

tianon commented Jan 6, 2016 via email

@JacobHayes
Copy link
Author

Awesome, thanks for the direction! Created docker-library/official-images#1319.

tianon added a commit to infosiftr/stackbrew that referenced this pull request Jan 7, 2016
- `docker`: alpine:3.3 (docker-library/docker#7)
- `drupal`: 8.0.2
- `java`: explicit `JAVA_HOME` (docker-library/openjdk#61)
- `php`: 5.5.31, 5.6.17, 7.0.2; fix edge case in `docker-php-ext-enable` (docker-library/php#172)
- `postgres`: 9.5.0; set `PGDATA` perms to `0700` (docker-library/postgres#110)
- `python`: add `alpine` variant for 3.5 (docker-library/python#74)
- `rabbitmq`: fix SSL bugs (docker-library/rabbitmq#55, docker-library/rabbitmq#56)
- `wordpress`: 4.4.1
RichardScothern pushed a commit to RichardScothern/official-images that referenced this pull request Jun 14, 2016
- `docker`: alpine:3.3 (docker-library/docker#7)
- `drupal`: 8.0.2
- `java`: explicit `JAVA_HOME` (docker-library/openjdk#61)
- `php`: 5.5.31, 5.6.17, 7.0.2; fix edge case in `docker-php-ext-enable` (docker-library/php#172)
- `postgres`: 9.5.0; set `PGDATA` perms to `0700` (docker-library/postgres#110)
- `python`: add `alpine` variant for 3.5 (docker-library/python#74)
- `rabbitmq`: fix SSL bugs (docker-library/rabbitmq#55, docker-library/rabbitmq#56)
- `wordpress`: 4.4.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants