#30004: Document TemporaryUploadedFile potential permission issues
               Reporter:  Evgeny Arshinov  |          Owner:  nobody
                   Type:  Uncategorized    |         Status:  new
              Component:  Documentation    |        Version:  2.1
               Severity:  Normal           |       Keywords:
           Triage Stage:  Unreviewed       |      Has patch:  0
    Needs documentation:  0                |    Needs tests:  0
Patch needs improvement:  0                |  Easy pickings:  0
                  UI/UX:  0                |

 As far as I can see, the
 [https://docs.djangoproject.com/en/2.1/topics/http/file-uploads/ File
 Uploads] documentation page does not mention any permission issues.

 What I would like to see is a warning that in absence of explicitly
 configured `FILE_UPLOAD_PERMISSIONS`, the permissions for a file uploaded
 to `FileSystemStorage` might not be consistent depending on whether a
 `MemoryUploadedFile` or a `TemporaryUploadedFile` was used for temporary
 storage of the uploaded data (which, with the default
 FILE_UPLOAD_HANDLERS, in turn depends on the uploaded data size).

 The `tempfile.NamedTemporaryFile` + `os.rename` sequence causes the
 resulting file permissions to be 0o0600 on some systems (I experience it
 here on CentOS 7.4.1708 and Python 3.6.5). In all probability, the
 implementation of Python's built-in `tempfile` module explicitly sets such
 permissions for temporary files due to security considerations.

 I found mentions of this issue [https://github.com/divio/django-
 filer/issues/1031 on GitHub], but did not manage to find any existing bug
 report in Django's bug tracker.

Ticket URL: <https://code.djangoproject.com/ticket/30004>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to