-
Notifications
You must be signed in to change notification settings - Fork 343
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
Fix PXB-3141 - fix folder permission on fifo get #1508
Conversation
https://jira.percona.com/browse/PXB-3141 Problem When creating a folder without executing permission, a user gets limited action on that folder. For a folder, the x privilege means the user can cd into the folder. Currently, if we are doing a xbcloud get and the folder does not exists, xbcloud will create it as 600. The same problem does no happens with xtrabackup as the thread stream-dir as target-dir, and that is created as 777. Fix Adjusted folder creation on ds_fifo.cc and xbcloud to use 777 as permission. The same mask is used on xtrabackup.
https://pxb.cd.percona.com/job/percona-xtrabackup-8.0-test-param/369/ - failures are due to centos7 issues on bootstrap (fixed on trunk already) and rhel9 not reporting junit (fixed on trunk) |
Hi @altmannmarcelo , I need help understanding the problem. Is the problem that the user cannot "cd" to the directory created by xbcloud and the fifo-stream-dir? 777 on stream files seems a bit too generous and can any other users attach to the FIFOs? You are right that backup creates all directories with 777 and this also seems very liberal. Is xtrabackup mainly used as a root user? |
@satya-bodapati The key point here is that we are only changing the directory to 777,the files are still being created as 600. |
and if I understand correctly, you are changing the permission of fifo_stream_dir only? |
@satya-bodapati correct. Also, adjusting the test to cover this scenario - When we download the files we don't have the folder created. |
@altmannmarcelo ok, thanks for confirming. Just out of curiosity, why did we find this now? It seems a very basic scenario and the test should have failed in the first commit? 🤔 |
Yeah I had the same thought when I first saw this while doing some unrelated testing. There are two reasons for this not been caught under current testing and probably QA too:
|
Thanks for the detailed explanation. Can you please add a test with different target-dir and --fifo-dir ? |
--target-dir gets replaced unconditionally if --fifo-dir is set. It has no effect. I can add the test if you want, but it will not be covering anything :) |
https://jira.percona.com/browse/PXB-3141
Problem
When creating a folder without executing permission, a user gets limited action on that folder. For a folder, the x privilege means the user can cd into the folder.
Currently, if we are doing a xbcloud get and the folder does not exists, xbcloud will create it as 600. The same problem does no happens with xtrabackup as the thread stream-dir as target-dir, and that is created as 777.
Fix
Adjusted folder creation on ds_fifo.cc and xbcloud to use 777 as permission. The same mask is used on xtrabackup.