Skip to content
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

Ensure that directory permissions are properly set on MySQL and MariaDB #5401

Closed

Conversation

driverpt
Copy link

@driverpt driverpt commented May 31, 2022

Fixes #914 #4952

Forces Directory/File to have the Others permission set (755 for Dir, 644 for Files), to avoid umask issues

@driverpt driverpt requested a review from a team as a code owner May 31, 2022 12:16
Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

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

thanks for your contribution @driverpt ! Can you please run ./gradlew spotlessApply? and please add tests for MariaDB too.

@@ -67,7 +68,8 @@ protected void configure() {
optionallyMapResourceParameterAsVolume(
MY_CNF_CONFIG_OVERRIDE_PARAM_NAME,
"/etc/mysql/conf.d",
"mariadb-default-conf"
"mariadb-default-conf",
Transferable.DEFAULT_FILE_MODE
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be Transferable.DEFAULT_DIR_MODE, right?

@famod
Copy link
Contributor

famod commented Jan 27, 2023

@driverpt are you able to finish this (soon)? If not I'll try and come up with a superseding PR.

@driverpt
Copy link
Author

Hi. Please proceed. I can only pick this up next week

@famod
Copy link
Contributor

famod commented Jan 30, 2023

Hi @driverpt! I haven't been able to work on this so far. Please leave a message when you have picked it up again so that we don't work on it in parallel. Thanks!

@driverpt
Copy link
Author

Hey @famod , please feel free to pick this up. I'm a bit swamped with work atm.

@famod
Copy link
Contributor

famod commented Feb 1, 2023

FYI, I have started working on this. The tests need some work though.

@driverpt
Copy link
Author

driverpt commented Feb 1, 2023

That was where I had a hard time. To reproduce you need a Linux Operating system with 027 of default umask. I've tried doing that using docker-in-docker, but it's tricky

@famod
Copy link
Contributor

famod commented Feb 1, 2023

Actually, I don't think it's that complicated (unless I'm missing something):
startFailsWithWrongPermissions (which sets the file to owner-readable only) fails before the change and must not fail after it, that's all!
The second test method is obsolete/broken IMO.

Edit: That test is obviously not exactly the same as an all-readable file + umask 0027, but I think it's a reasonable and sufficient approximation. YMMV!

@famod
Copy link
Contributor

famod commented Feb 13, 2023

Superseded by #6625, finally 😅

@eddumelendez
Copy link
Member

Close it favor of #6625

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.

Permissions error with config mounted into MySQL container
3 participants