#29027: file_move_safe error with SELinux
-------------------------------------+-------------------------------------
     Reporter:  bhargu               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  File                 |                  Version:  1.11
  uploads/storage                    |
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  selinux              |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Phillip Marshall):

 I'm also getting error code 13 after doing a large upgrade recently, but
 am not using SELinux like bhargu. I have a CIFS mount set up in debian,
 and am using a subclass of FileSystemStorage. Outside of python, the mount
 is being finicky and throws permission errors when i try and chmod
 anything in it, but adding removing and editing files works fine. In
 previous django versions, I believe this kind of behavior was just
 ignored. However my deployment environment has been upgraded as well, so
 I'm not 100% sure of this.

 Like OP says, this does not happen when the file size is smaller than
 (DATA|FILE)_UPLOAD_MAX_MEMORY_SIZE (which default to 2.5 megs), and
 setting those to a higher threshold works around the issue.

 I wrote a simple patch below to allow for error 13, and this also remedied
 the issue for me. I'm not sure if it's a good idea to merge, as code 13
 seems to be a general permission error. But it would be nice to be able to
 override this behaviour myself without having to do such a deep fork.

 
https://github.com/agrimgt/django/commit/f9b48086d083b1eee800ea752f2c3fd60a8cc448

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29027#comment:3>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.ca78afdc72c47e76dae26fe25741deed%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to