Re: [Django] #4282: startproject should honor umask

29 views
Skip to first unread message

Django

unread,
Sep 9, 2011, 4:29:30 PM9/9/11
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
talex5+django@… | Status: new
Type: New | Component: Core (Management
feature | commands)
Milestone: | Severity: Normal
Version: SVN | Keywords:
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 1 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by baumer1122):

* 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.

Django

unread,
Dec 10, 2013, 3:19:12 PM12/10/13
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: merb
Type: New feature | Status: assigned
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by merb):

* owner: nobody => merb
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:9>

Django

unread,
Dec 26, 2013, 2:34:23 PM12/26/13
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: merb
Type: New feature | Status: assigned
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

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>

Django

unread,
Jun 14, 2014, 11:43:23 AM6/14/14
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: merb
Type: New feature | Status: assigned
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by claudep):

Comment added on the pull request.

--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:11>

Django

unread,
Nov 14, 2021, 11:19:26 PM11/14/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: merb
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ad Timmering):

* 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>

Django

unread,
Nov 15, 2021, 3:27:24 AM11/15/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: (none)
Type: New feature | Status: new

Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ad Timmering):

* 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>

Django

unread,
Nov 16, 2021, 4:18:01 AM11/16/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: (none)
Type: New feature | Status: new
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* 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>

Django

unread,
Nov 19, 2021, 9:22:47 AM11/19/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: (none)
Type: New feature | Status: new
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Nov 20, 2021, 12:27:42 AM11/20/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: Ad
| Timmering

Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ad Timmering):

* owner: (none) => Ad Timmering


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:16>

Django

unread,
Nov 20, 2021, 1:43:34 AM11/20/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: Ad
| Timmering
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Nov 21, 2021, 8:34:20 AM11/21/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: Ad
| Timmering
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
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 Ad Timmering):

* 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>

Django

unread,
Nov 23, 2021, 2:54:50 AM11/23/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: Ad
| Timmering
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:19>

Django

unread,
Nov 23, 2021, 8:37:20 AM11/23/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: Ad
| Timmering
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
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 Ad Timmering):

* 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>

Django

unread,
Nov 24, 2021, 7:10:23 AM11/24/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: Ad
| Timmering
Type: Bug | Status: assigned

Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* type: New feature => Bug
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/4282#comment:21>

Django

unread,
Nov 24, 2021, 11:35:09 AM11/24/21
to django-...@googlegroups.com
#4282: startproject should honor umask
-------------------------------------+-------------------------------------
Reporter: talex5+django@… | Owner: Ad
| Timmering
Type: Bug | Status: closed

Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* 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>

Reply all
Reply to author
Forward
0 new messages