#29027: file_move_safe() PermissionError with SELinux
--------------------------------------+------------------------------------
Reporter: bhargu | Owner: nobody
Type: Bug | Status: new
Component: File uploads/storage | Version: 1.11
Severity: Normal | Resolution:
Keywords: selinux | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by Paul Boddie):
One factor that may be involved is the user of the process when a Django
application is deployed using mod_wsgi.
I found that using the WSGIDaemonProcess directive with a user other than
apache (on Fedora, perhaps www-user on Debian), attempts to upload files
failed in the way described, but with the apache user involved (and with
appropriate permissions on directories for writing uploaded content) no
such error occurred.
It occurs to me that the apache user may be configured in SELinux to not
attempt to relabel files in an inappropriate way, or that the apache user
is able to preserve httpd_sys_rw_content_t labels whereas other users are
not. This is speculation, however, since I have not investigated this in
any depth (and the SELinux documentation is often incoherent or opaque).
--
Ticket URL: <https://code.djangoproject.com/ticket/29027#comment:6>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.76cdca6c9850ddb94372e11bea51a9de%40djangoproject.com.