Commit 4d4bf89
committed
Test for excessive write permissions on nonexclusive checkout
This expands the `overwriting_files_and_lone_directories_works`
test function to check not only that executable permissions have
been added at least for the owner, but that write permissions are
not added anywhere they would be excessive.
The write permissions bits of the current test runner process umask
is used to gauge this. This means we are expecting different
permissions in different environments.
`(umask ...; cargo nextest run ...)` can be used to try it with
different umasks if desired, but this should not typically be
necessary.
Possible under-restrictive umasks could make the test pass even if
the underlying bug is not fixed; this is avoided by also testing
that the umask is sufficient to facilitate the test.
(This is really why the test accesses the umask in the first place:
in environments where files would automatically be created with
completely unrestricted permissions, the expected behavior of the
code under test may be to do that, but running the tests in such an
environment is insufficient to check if the bug is fixed.)1 parent 8e7fb99 commit 4d4bf89
1 file changed
+25
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
223 | 224 | | |
224 | | - | |
225 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
226 | 249 | | |
227 | 250 | | |
228 | 251 | | |
| |||
0 commit comments