Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
Commitc700477
committed
mknod: set cli specified file mode
libc's mknod function applies the process' umask in the usual way:the permissions of the created node are `mode & ~umask`.the umask of uu-mknod is currently only set to 0 (= no mask)when the supplied mode is not 0o666:```rustlet set_umask_0 = config.mode & MODE_RW_UGO != MODE_RW_UGO;```because `MODE_RW_UGO == 0o666` is also the default `--mode` argument value.but when `--mode 0666` is given explicitly, the permissions should be setexactly to the requested bits, and the umask should not be applied.this patch fixes the issue by tracking if a custom mode was supplied by argument.interestingly, GNU coreutils issue a call to `fchmodat2` after `mknod` was called,even though they also set the umask to 0 if a custom mode was specified via `--mode`.this patch doesn't add that, but it may be necessary for other cases in the future.fixes#83421 parent213389c commitc700477
1 file changed
+35
-28
lines changedLines changed: 35 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
53 |
| - | |
| 53 | + | |
54 | 54 |
| |
| 55 | + | |
55 | 56 |
| |
56 | 57 |
| |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 |
| |
58 | 62 |
| |
59 | 63 |
| |
| |||
66 | 70 |
| |
67 | 71 |
| |
68 | 72 |
| |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 | 73 |
| |
73 |
| - | |
74 |
| - | |
| 74 | + | |
| 75 | + | |
75 | 76 |
| |
76 | 77 |
| |
77 | 78 |
| |
78 | 79 |
| |
79 |
| - | |
80 |
| - | |
| 80 | + | |
| 81 | + | |
81 | 82 |
| |
82 | 83 |
| |
83 | 84 |
| |
| |||
110 | 111 |
| |
111 | 112 |
| |
112 | 113 |
| |
113 |
| - | |
114 |
| - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
115 | 124 |
| |
116 | 125 |
| |
117 | 126 |
| |
| |||
144 | 153 |
| |
145 | 154 |
| |
146 | 155 |
| |
| 156 | + | |
147 | 157 |
| |
148 | 158 |
| |
149 | 159 |
| |
| |||
211 | 221 |
| |
212 | 222 |
| |
213 | 223 |
| |
214 |
| - | |
215 |
| - | |
216 |
| - | |
217 |
| - | |
218 |
| - | |
219 |
| - | |
220 |
| - | |
221 |
| - | |
222 |
| - | |
223 |
| - | |
224 |
| - | |
225 |
| - | |
226 |
| - | |
227 |
| - | |
228 |
| - | |
229 |
| - | |
230 |
| - | |
231 |
| - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
232 | 239 |
| |
233 | 240 |
| |
234 | 241 |
| |
|
0 commit comments
Comments
(0)