-
Notifications
You must be signed in to change notification settings - Fork 14
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
Hack permission fix until core is updated #658
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you merge this with #657 to see if tests pass? (or re-implement my test here)
Okay, I see what's happening. You put the test on the non-cli calls. Do you (@StevenClontz) think we need to patch this now, or can that wait for fixes to core? |
Turns out it was easy to move into the project's build command, so I just did that. |
Alright @StevenClontz. Can you mark your review as approved so we can merge? |
Thanks. IMO the lighter-weight CLI is, the better. It's somewhat interesting that |
I think this PR (or maybe the underlying core problem??) is the cause of recent unpleasantness on Runestone Academy. Suddenly and mysteriously the permissions on the output folder for runestone build books namely I don't think it is good practice to override a users |
Can you say more @bnmnetp? I agree that I don't want to be in the business of permission management. The problem is that:
The hack that this PR uses assumes that the output folder's parent folder has the permissions that should be on the output folder, and just coerces those after moving the built files. The proposed fix to core would set the permissions to the temp directories created to 755, and then we can revert the hack. But I'm not sure that would help your situation. What do you think? |
To make sure I understand: you want For clarity, somewhere (can't find the thread) we found that a core Python routine sets the temporary directory permission at pretext-cli/pretext/project/__init__.py Line 657 in 745602a
777 ?
As I recall, we have a better fix that needs to be merged into PreTeXtBook/pretext - I'll ping that now... |
I'm not asking for 777 I'm asking for at least 755 or 775. Perhaps using shutil.copy to copy from a tmp directory is not the best solution. I don't think I would get very far with the Python maintainers. I think I may not have had the version with Oscar's hack in it. because either remembering what the permissions on the output directory were and then restoring them after the copy, or using the permissions of the parent is also pretty reasonable. In any case I have not seen any of the output folders set to 700. |
Sounds likely - we've since added tests to our suite to ensure that the lowest permissions our new projects and builds should be are Line 55 in 745602a
pretext-cli/tests/test_project.py Line 308 in 745602a
|
No description provided.