* ui_ux: => 0
* easy: => 0
Comment:
Confirmed issue still exists in r16741. This patch applies cleanly and
fixes the issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => merb
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:9>
Comment (by merb):
I uploaded & updated the pull request.
https://github.com/django/django/pull/2061
would be great if somebody will making suggestions.
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:10>
Comment (by claudep):
Comment added on the pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:11>
* cc: Ad Timmering (added)
Comment:
Browsing some ancient tickets, wondering if this ticket can perhaps be
closed as obsolete? If not - what is still missing?
Ticket isn't very clear on what the issue is and how to reproduce is, but
a lot has changed on permission handling between the time of the ticket
and #17042, #26494, #27628.
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:12>
* owner: merb => (none)
* status: assigned => new
Comment:
(de-assigning as not touched in 8 years)
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:13>
* cc: Claude Paroz (added)
Comment:
Hey Adam — thanks for looking!
Seems like the behaviour is unchanged (to 4.0b1):
{{{
% mkdir issue4282
% cd issue4282
issue4282 % umask 077
issue4282 % touch foo
issue4282 % ls -l foo
-rw------- 1 carlton staff 0 Nov 16 10:06 foo
issue4282 % django-admin startproject mysite
issue4282 % ls -l mysite/mysite/settings.py
-rw-r--r-- 1 carlton staff 3221 Nov 16 10:06 mysite/mysite/settings.py
issue4282 % django-admin --version
4.0b1
}}}
Expected behaviour is that the created files have the restricted
permissions, I think.
The original patch didn't look too complex… 🤔 (We do similar in
[https://github.com/django/django/blob/12fe3224f5086161462faf614cad91f3fad32e78/django/core/files/storage.py#L246-L255
storage.py] — I didn't look into Claude's comments there.
It may be that if we're not going to fix this, we can mark it wontfix. (Is
this something Django needs to handle that a `find ... | xargs chmod`
wouldn't be more appropriate for?)
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:14>
Comment (by Ad Timmering):
Thanks for context Claude.
I have updated the original PR - however got stuck on the fact that
`subprocess.run()` does not support `umask` (at least not prior to 3.9),
and just setting `umask` has no effect - which renders this untestable. If
you (or anyone reading this) has any suggestions please lmk.
PR that does not passes the tests (because of `umask`):
https://github.com/django/django/pull/15102
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:15>
* owner: (none) => Ad Timmering
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:16>
Comment (by Ad Timmering):
Still need to fix the PR for Windows (checking `hasattr(os, 'umask')`
doesn't cut it), but keen to know if PR is directionally fine.
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:17>
* needs_better_patch: 1 => 0
Comment:
Modified and tests pass- but as said in previous comment, tests are
skipped on Python 3.8 as it does not support setting `umask` in
`subprocess.run()` so we can't test.
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:18>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:19>
* needs_better_patch: 1 => 0
Comment:
Thanks for the review Mariusz, learning from your comments. Applied the
changes.
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:20>
* type: New feature => Bug
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:21>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"59f4796918235e70f0c6429c3f8e2e979f4ba0b4" 59f47969]:
{{{
#!CommitTicketReference repository=""
revision="59f4796918235e70f0c6429c3f8e2e979f4ba0b4"
Fixed #4282 -- Made startapp/startproject management commands honor umask.
Co-authored-by: Christian Schmitt <c.sc...@briefdomain.de>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:22>