efrecon / docker-s3fs-client

Alpine-based s3fs client: mount from container, make available to other containers
BSD 3-Clause "New" or "Revised" License
181 stars 64 forks source link

UID and GID work correctly in latest; appear to be ignored in recent tags #24

Closed akhayyat closed 2 years ago

akhayyat commented 2 years ago

Using the latest tag, the UID and GID environment variables behave correctly: setting them allows only the specified user to access the mounted directory.

However, using any of the other recent tags, e.g. 1.91, 1.90, 1.89, etc., the UID and GID environment variables do nothing at all: the user whose UID and GID are specified will be granted access to the mounted directory only if the allow_other option is used. Otherwise, it gets a "permission denied" error.

BTW, which s3fs version is used in the latest tag?

efrecon commented 2 years ago

latest is hopelessly outdated (despite the name). But I think this is all because the version of latest was running s3fs as the user, which seems to have disappeared. I will have to dig in the commit history to understand why and when and return to you. The mount command should look like the following one:

su - $RUN_AS -c "s3fs $DEBUG_OPTS ${S3FS_ARGS} \
    -o passwd_file=${AWS_S3_AUTHFILE} \
    -o url=${AWS_S3_URL} \
    -o uid=$UID \
    -o gid=$GID \
    ${AWS_S3_BUCKET} ${DEST}"

I haven't got time right now, but you are welcome to give it a try in a local copy and tell me if that works better.

efrecon commented 2 years ago

I fixed it through 96052ad3f583af31149706d7560b883a9e83bdc4. Wait until the builds have finished and tell me if it works. I am closing this now, but can reopen on problems.

akhayyat commented 2 years ago

Seems to be working correctly now. Thanks!