Commit acd51ef
nohup: create nohup.out with mode 0600
POSIX nohup creates the output file with permissions that block other
users from reading it. We were leaving the mode at the process umask
default, so on a typical system with umask 022 the file would land at
0644 and any other local user could read whatever the detached job
logged. That's not great on multi-user hosts.
Pass `.mode(0o600)` on the OpenOptions so newly-created `nohup.out`
files start out as owner-only. Existing files keep their current
permissions, which matches GNU.
Closes #10021.
Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>1 parent 8a271f5 commit acd51ef
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
155 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
156 | 165 | | |
157 | 166 | | |
158 | 167 | | |
| |||
0 commit comments