mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #18947 -- Don't make uploaded files executeable by default.
Thanks to Lauri Tirkkonen for the patch.
This commit is contained in:
@@ -192,7 +192,10 @@ class FileSystemStorage(Storage):
|
||||
else:
|
||||
# This fun binary flag incantation makes os.open throw an
|
||||
# OSError if the file already exists before we open it.
|
||||
fd = os.open(full_path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | getattr(os, 'O_BINARY', 0))
|
||||
flags = (os.O_WRONLY | os.O_CREAT | os.O_EXCL |
|
||||
getattr(os, 'O_BINARY', 0))
|
||||
# The current umask value is masked out by os.open!
|
||||
fd = os.open(full_path, flags, 0o666)
|
||||
try:
|
||||
locks.lock(fd, locks.LOCK_EX)
|
||||
_file = None
|
||||
|
||||
Reference in New Issue
Block a user