-
Notifications
You must be signed in to change notification settings - Fork 24
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 Permissions when writing export folders #37
Conversation
Relevant: https://www.computerhope.com/unix/uumask.htm My understanding of this change is that it is basically Specifically:
In short - I'm not sure this is a safe change. |
Perhaps it could be altered to use chmod as suggested by the note after writing? |
@NightJar Glad someone knows what they're doing 🙈. Change made :) |
Haha, not sure I'd go as far as to say I know what I'm doing... I'm just reviewing the change & researching the impacts ;) Having seen the newer change - it looks like the folders are already created as Are you able to confirm that this latest change resolves your issue still? It's probably also worth noting that SS4 uses a file abstraction layer - direct file system calls like this might not be the best idea (e.g. if the assets are all remotely stored on an S3 bucket or something). While this change is certainly a thing that's needed, the 'fix' might unfortunately be a bit more complex than a simply permission mask manipulation. But if this works, then that last part can certainly be it's own |
Sorry that was a bit of a hectic brain dump of a comment. TL;DR: if you can confirm this patch still works for you, I'll merge it :) |
@NightJar No stress. I confirmed it was working prior to pinging you. In our setup, the user mask is The only relevent involvement SS seems to have (which I'm looking into soon) is that our ansible profile actually defines the umask as In short, this change would make the module work more reliably, but also negate any effect from the user mask. Ultimately your call :) |
Thanks for that extra context @JoshuaCarter, most excellent! One more very minor request from me, then given this extra context I may refer with some colleagues before actually merging, sorry! I think it should be OK though, but that caveat of negating user mask (albeit in this use case only) is worthy of a second opinion I think :) My request is only this: Cheers! |
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.
In terms of your umask problem, we could add extension points if you'd like - then your user code could adjust the masks.
The real fix for this is to use the asset abstraction layer though.
@robbieaverill Extension points are a workable solution too. In our case, we figured out that cron wasn't loading a user's I'm not familiar enough with the SS asset abstraction layer to know if it uses it's own mask, etc. If so, it's a potential solution, and if not, then it would have no impact here. At this point, whether this change should be made is very much up to you guys. I've altered the commit message (as requested by @NightJar ) so I'll leave it in your hands to decide whether to merge or not. Though I will point out that a couple extension points would be the 'everyone's happy' solution. I'm happy to alter my change in that direction if that's what you decide :) |
Having had a better think about this... I think it's safe to merge if we feature flag it. Relying on the umask to behave as expected is probably a desired trait of the system.
A comment about why the As already mentioned the better fix would be to use the file system abstraction, but that can be a different PR. I do not wish to block contribution based on architectural decisions above what a PR is trying to achieve :) |
@NightJar Done and tested. Let me know if any changes need to be made. The most questionable choice I made was to force the I'd love if we could get this into a feature/patch release sometime soon if possible as my previously mentioned work-around didn't pan out as hoped, and so this would be a great work-around until we can better sort out our server environment, etc. Cheers :) |
Adds config options for: - The $permissions_mode used by mkdir (and chmod). - Wether to $ignore_umask by calling chmod after mkdir. The default values are such that there is no change in default behaviour.
Thanks for this @JoshuaCarter :) |
@NightJar great, thanks! Any idea when this will go out in a release? |
@NightJar Great, thanks :) |
Solves: #36