Skip to content

docker-entrypoint.sh incorrectly sets permissions of all user uploaded files to 0755, making them executable for everybody #94

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

Closed
casdevs opened this issue Nov 9, 2017 · 6 comments

Comments

@casdevs
Copy link

casdevs commented Nov 9, 2017

just found out that after restarting my redmine container, all files uploaded by users get 0755 file permissions, which effectively makes them executable (we don't want that, do we?)

After investigating docker-entrypoint.sh (found in all current releases), I think instead of
chmod -R 755 files log tmp public/plugin_assets

you should rather use something like

find files log tmp public/plugin_assets -type d -exec chmod 775 {} +
find files log tmp public/plugin_assets -type f -exec chmod 664 {} +

instead.

@casdevs
Copy link
Author

casdevs commented Nov 9, 2017

maybe the official redmine docs at
https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions
should be updated accordingly.

@tianon
Copy link
Member

tianon commented Nov 15, 2017

Agreed, ideally the official documentation would be updated before we make any changes here.

@casdevs
Copy link
Author

casdevs commented Nov 15, 2017

I've filed a bug with their issue tracker at https://www.redmine.org/issues/27538

@casdevs
Copy link
Author

casdevs commented Nov 17, 2017

I'm not sure if they are willing to update their documentation, see discussion in https://www.redmine.org/issues/27538

But as their documentation isn't tailored for the redmine-in-a-container usecase, I think you shouldn't wait for them any longer and fix the incorrect permission settings anyway.

@casdevs
Copy link
Author

casdevs commented Dec 14, 2017

ok the official redmine docs have been updated:
https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions

however, as in the docker container usecase most of the times files do exist when the entrypoint script gets executed, I think you should set the permissions correctly in the first place instead of removing the incorrectly set executable bit afterwards as proposed in the docs now.

@yosifkit
Copy link
Member

PR made: #98. Thanks @stefan-hausmann.

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

No branches or pull requests

3 participants