Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Fix npm's package.json permissions #2005

Merged
merged 1 commit into from
Jun 9, 2020

Conversation

disconnect3d
Copy link
Contributor

Changed created file permissions from 644 (-w----r--) to 0644 (rw-r--r--) when calling WriteFile(...).

PoC:

dc@jhtc:~/gogo$ cat main.go
package main

import "io/ioutil"

func main() {
    ioutil.WriteFile("644", []byte("content"), 644)
    ioutil.WriteFile("0644", []byte("content"), 0644)
}
dc@jhtc:~/gogo$ go run main.go
dc@jhtc:~/gogo$ ls -la
total 28
drwxrwxr-x   2 dc dc  4096 Jun  9 16:42 .
drwxr-xr-x 124 dc dc 12288 Jun  9 16:42 ..
-rw-r--r--   1 dc dc     7 Jun  9 16:42 0644
--w----r--   1 dc dc     7 Jun  9 16:42 644
-rw-rw-r--   1 dc dc   156 Jun  9 16:42 main.go

Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`) when calling `WriteFile(...)`.

PoC:
```
dc@jhtc:~/gogo$ cat main.go
package main

import "io/ioutil"

func main() {
    ioutil.WriteFile("644", []byte("content"), 644)
    ioutil.WriteFile("0644", []byte("content"), 0644)
}
dc@jhtc:~/gogo$ go run main.go
dc@jhtc:~/gogo$ ls -la
total 28
drwxrwxr-x   2 dc dc  4096 Jun  9 16:42 .
drwxr-xr-x 124 dc dc 12288 Jun  9 16:42 ..
-rw-r--r--   1 dc dc     7 Jun  9 16:42 0644
--w----r--   1 dc dc     7 Jun  9 16:42 644
-rw-rw-r--   1 dc dc   156 Jun  9 16:42 main.go
```
@disconnect3d disconnect3d requested a review from a team as a code owner June 9, 2020 15:57
@paganotoni paganotoni changed the base branch from master to development June 9, 2020 16:00
@paganotoni
Copy link
Member

Thanks for this one @disconnect3d !

@paganotoni paganotoni merged commit 7827df3 into gobuffalo:development Jun 9, 2020
@disconnect3d disconnect3d deleted the patch-1 branch June 9, 2020 16:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants