Re: [Django] #18150: Uploading a file ending with a backslash fails

2020-06-15 Thread Django
#18150: Uploading a file ending with a backslash fails
--+
 Reporter:  Peter Kuma|Owner:  (none)
 Type:  Bug   |   Status:  new
Component:  File uploads/storage  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+

Comment (by felixxm):

 Filenames with double trailing backslashes are ignored after
 4b129ac81f4fa38004950d0b307f81d1e9b44af8, but the ticket is still valid
 because they should be accepted as a valid filenames on Linux.

-- 
Ticket URL: 
Django 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.ae0ea91041ca7bb4d65c865e612c937b%40djangoproject.com.


Re: [Django] #18150: Uploading a file ending with a backslash fails

2016-10-12 Thread Django
#18150: Uploading a file ending with a backslash fails
--+
 Reporter:  Peter Kuma|Owner:  (none)
 Type:  Bug   |   Status:  new
Component:  File uploads/storage  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tim Graham):

 * owner:  supersteve9219 => (none)
 * status:  assigned => new


Comment:

 When updating a patch (please send a pull request these days), you also
 need update the ticket flags (uncheck "Needs documentation" and "Patch
 needs improvement") so that the ticket appears in the patch review queue.

--
Ticket URL: 
Django 
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 
https://groups.google.com/d/msgid/django-updates/068.d9cf115f5202334cf30d050ffa33e177%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18150: Uploading a file ending with a backslash fails

2015-03-15 Thread Django
#18150: Uploading a file ending with a backslash fails
-+-
 Reporter:  Peter Kuma   |Owner:
 |  supersteve9219
 Type:  Bug  |   Status:  assigned
Component:  File |  Version:  1.4
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by vigneshsarma):

 We are facing this issue.

 I have updated the patch and should apply cleanly against master.

 If there is anything more that needs to be done to get this patch into the
 next bugfix release I can help with that.

--
Ticket URL: 
Django 
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 
https://groups.google.com/d/msgid/django-updates/068.28890af2b6df313489eec0dc0c4541a4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18150: Uploading a file ending with a backslash fails

2015-03-15 Thread Django
#18150: Uploading a file ending with a backslash fails
-+-
 Reporter:  Peter Kuma   |Owner:
 |  supersteve9219
 Type:  Bug  |   Status:  assigned
Component:  File |  Version:  1.4
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by vigneshsarma):

 * Attachment "patch_3_15_15.diff" added.

 Should apply cleanly against master now

--
Ticket URL: 
Django 
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 
https://groups.google.com/d/msgid/django-updates/068.9653d103a7c4b48594dc0c4e6b28e78a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18150: Uploading a file ending with a backslash fails

2014-06-25 Thread Django
#18150: Uploading a file ending with a backslash fails
-+-
 Reporter:  Peter Kuma   |Owner:
 Type:  Bug  |  supersteve9219
Component:  File |   Status:  assigned
  uploads/storage|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timo):

 * needs_better_patch:  0 => 1
 * needs_docs:  0 => 1


Comment:

 Patch no longer applies cleanly. Also, if we drop `IE_santize`, we need to
 document the consequences of that in the release notes.

-- 
Ticket URL: 
Django 
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 
https://groups.google.com/d/msgid/django-updates/068.b917c5b517936d3bb87a78dc6fb60087%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18150: Uploading a file ending with a backslash fails

2013-02-09 Thread Django
#18150: Uploading a file ending with a backslash fails
-+-
 Reporter:  Peter Kuma   |Owner:
 Type:  Bug  |  supersteve9219
Component:  File |   Status:  assigned
  uploads/storage|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by supersteve9219):

 Replying to [comment:5 anonymous]:
 > Added a new patch, added the test method to the patch.
 >
 > Changed os.path to ntpath in uploadedfile.py, os.path has inconsistent
 behavior depending on operating system. In this case we need os.path to
 handle filenames with both forward and back slashes, on unix operating
 systems os.path will not remove backslashes, by forcing ntpath we can
 avoid this. Since forward and backslashes are now handled in
 uploadedfile.py we can remove it from multipartparser.py since it is
 redundant.

 Accidentally posted this while logged out.

-- 
Ticket URL: 
Django 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18150: Uploading a file ending with a backslash fails

2013-02-09 Thread Django
#18150: Uploading a file ending with a backslash fails
-+-
 Reporter:  Peter Kuma   |Owner:
 Type:  Bug  |  supersteve9219
Component:  File |   Status:  assigned
  uploads/storage|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by anonymous):

 Added a new patch, added the test method to the patch.

 Changed os.path to ntpath in uploadedfile.py, os.path has inconsistent
 behavior depending on operating system. In this case we need os.path to
 handle filenames with both forward and back slashes, on unix operating
 systems os.path will not remove backslashes, by forcing ntpath we can
 avoid this. Since forward and backslashes are now handled in
 uploadedfile.py we can remove it from multipartparser.py since it is
 redundant.

-- 
Ticket URL: 
Django 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18150: Uploading a file ending with a backslash fails

2013-02-03 Thread Django
#18150: Uploading a file ending with a backslash fails
-+-
 Reporter:  Peter Kuma   |Owner:
 Type:  Bug  |  supersteve9219
Component:  File |   Status:  assigned
  uploads/storage|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by supersteve9219):

 I added an updated patch. The file name was also being sanitized in
 django/core/files/uploadedfile.py.

 I added an if statement that checks if the last character in a file name
 is "\", if it does not end in "\" normal sanitation continues, however, if
 it does end in "\" it replaces the "\" with "0", we could simply strip the
 "\" from the end of the file name but if there is multiple backslashes at
 the end or the file name is a single backslash it could result in a empty
 string for the file name.

 I also attached django\tests\regressiontests\file_uploads\test.py with a
 test method I added to test for this bug, it fails with the same error
 mentioned in the bug report, but passes without issue after the patch is
 applied.

 Here is the test method alone:

 {{{
 def test_fail_backslash(self):
 """Tests filename ending with a backslash, issue #18150 reports
 crashes when a filename ends with a backslash"""
 backSlashName = "backslash.jpg\\"
 payload = client.FakePayload()
 payload.write('\r\n'.join([
 '--' + client.BOUNDARY,
 'Content-Disposition: form-data; name="file1"; filename="%s"'
 % backSlashName,
 'Content-Type: application/octet-stream',
 '',
 ''
 ]))
 payload.write('\r\n--' + client.BOUNDARY + '--\r\n')

 r = {
 'CONTENT_LENGTH': len(payload),
 'CONTENT_TYPE':   client.MULTIPART_CONTENT,
 'PATH_INFO':  "/file_uploads/echo/",
 'REQUEST_METHOD': 'POST',
 'wsgi.input': payload,
 }
 response = self.client.request(**r)
 self.assertEqual(response.status_code, 200)
 }}}

-- 
Ticket URL: 
Django 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18150: Uploading a file ending with a backslash fails

2013-01-25 Thread Django
#18150: Uploading a file ending with a backslash fails
-+-
 Reporter:  Peter Kuma   |Owner:
 Type:  Bug  |  supersteve9219
Component:  File |   Status:  assigned
  uploads/storage|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by supersteve9219):

 * has_patch:  0 => 1


Comment:

 I added a patch.

 Given IE_sanitize is only used with files uploaded from Internet Explorer
 7 and earlier which represents less than 3% of the total browser share, I
 don't think it is no longer necessary to use this method. Especially given
 that using IE_sanitize causes issues with all unix users.

 Using IE_sanitize only on files starting with something like {{{X:\}}}
 does not fix the issue since {{{:}}} is still a valid unix filename char.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18150: Uploading a file ending with a backslash fails

2013-01-16 Thread Django
#18150: Uploading a file ending with a backslash fails
-+-
 Reporter:  Peter Kuma   |Owner:
 Type:  Bug  |  supersteve9219
Component:  File |   Status:  assigned
  uploads/storage|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by supersteve9219):

 * cc: supersteve9219 (added)
 * owner:  nobody => supersteve9219
 * status:  new => assigned


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18150: Uploading a file ending with a backslash fails

2012-06-07 Thread Django
#18150: Uploading a file ending with a backslash fails
--+
 Reporter:  Peter Kuma|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  File uploads/storage  |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Nuno Maltez ):

 * cc: nuno@… (added)
 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.