You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/10/19 22:48:31 UTC

[GitHub] kocolosk commented on a change in pull request #110: Conditionally set ownership and permissions in entrypoint

kocolosk commented on a change in pull request #110: Conditionally set ownership and permissions in entrypoint
URL: https://github.com/apache/couchdb-docker/pull/110#discussion_r226799727
 
 

 ##########
 File path: 2.2.0/docker-entrypoint.sh
 ##########
 @@ -25,13 +25,26 @@ if [ "$1" = 'couchdb' ]; then
 fi
 
 if [ "$1" = '/opt/couchdb/bin/couchdb' ]; then
-	# we need to set the permissions here because docker mounts volumes as root
-	chown -fR couchdb:couchdb /opt/couchdb || true
+	# Check that we own everything in /opt/couchdb and fix if necessary
+	find /opt/couchdb \! \( -user couchdb -group couchdb \) -exec chown couchdb:couchdb '{}' +
 
 Review comment:
   So ... I want to test that one a bit. I've already scoped down the chown so it only executes on files that have incorrect ownership. I'm struggling to think of a case where we have files in /opt/couchdb that are not owned by couchdb and yet we're OK to proceed without that ownership change. I guess the best example would be a config file with 0644 permissions owned by root coming in from a volume mount?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services