`dotnet new` should not set executable mode on generated files; also, obey umask
See original GitHub issueSteps to reproduce
$ ssh some-mac-box
$ mkdir foo
$ cd foo
$ dotnet new
$ ls -l
Expected behavior
Given the OS X default umask
= 0022, the output of the ls -l
command should be:
-rw-r--r-- 1 wyoung staff 386 Mar 9 10:54 NuGet.Config
-rw-r--r-- 1 wyoung staff 202 Mar 9 10:54 Program.cs
-rw-r--r-- 1 wyoung staff 227 Mar 9 10:54 project.json
Actual behavior
All three generated plain text files have their executable bit set, and the default permissions selected by the user with their umask
setting are ignored:
-rwx------ 1 wyoung staff 386 Mar 9 10:54 NuGet.Config*
-rwx------ 1 wyoung staff 202 Mar 9 10:54 Program.cs*
-rwx------ 1 wyoung staff 227 Mar 9 10:54 project.json*
Environment data
dotnet --version
output:
.NET Command Line Tools (1.0.0-beta-001598)
Product Information:
Version: 1.0.0-beta-001598
Commit Sha: 7582649f88
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.10
OS Platform: Darwin
Runtime Id: osx.10.10-x64
This also affects the current Ubuntu 14.04 build as well:
.NET Command Line Tools (1.0.0-beta-001668)
Product Information:
Version: 1.0.0-beta-001668
Commit Sha: N/A
Runtime Environment:
OS Name: ubuntu
OS Version: 14.04
OS Platform: Linux
Runtime Id: ubuntu.14.04-x64
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
dotnet new should not set executable mode on generated ...
Looking through the new command code, it seems like it just extracts a zip file with the template structure in it. So, maybe...
Read more >Why doesn't umask change execute permissions on files?
umask is subtractive, not prescriptive: permission bits set in umask are removed by default from modes specified by programs, but umask ...
Read more >Avoid having subversion modify Linux file permissions.
Every time I run an svn update , or svn co , even though the files may not be created (i.e. svn update...
Read more >Why are newly-created files under /root not executable ...
My /root directory permissions are dr-xr-x--- and my umask is 0022 . As I understand, I should expect new files to be 0755...
Read more >Why umask 555 is setting the file mods to "222" instead of " ...
Short answer: Because with a 5 you are removing the read (4) and executable (1) bit, so you end up with only write...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@seancpeters lets try this out on in the morning to make sure the files in the archive have the right permissions set
Thanks @mlorbetske, will close this one then since the fix is not in the CLI and we have dotnet/coreclr#7995.