File uploads larger than FILE_UPLOAD_MAX_MEMORY_SIZE get wrong unix group based on setgid
My MEDIA_ROOT directory has setgid set to force the group of newly created files. For file uploads less than FILE_UPLOAD_MAX_MEMORY_SIZE, django creates a file inside MEDIA_ROOT and the group is set as expected. For larger files, django creates a temporary file in another directory, then moves it to MEDIA_ROOT. Since the file was created in a temporary directory, it doesn't get the correct group. I expect uploaded media files to get the group from MEDIA_ROOT, despite whatever magic django internals are doing.
This can not be fixed with FILE_UPLOAD_PERMISSIONS, because that only sets permissions, not the group of the file.
The permissions form of this bug is referenced here: https://github.com/django-cms/django-filer/issues/1031
Change History
(8)
Component: |
Uncategorized → File uploads/storage
|
Triage Stage: |
Unreviewed → Accepted
|
Type: |
Uncategorized → Cleanup/optimization
|
Owner: |
changed from nobody to Mateo Radman
|
Status: |
new → assigned
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
OK, yes, this is related to #27334 (also #28540) - if we can make a similar adjustment for the group it should be acceptable.