Commit graph

12 commits

Author SHA1 Message Date
Eelco Dolstra
5737d31d4e Test the case hack a bit more 2024-09-12 17:27:41 +02:00
Eelco Dolstra
7aa3e7e3a5 Make the NAR parser much stricter wrt field order
We really want to enforce a canonical representation since NAR
hashing/signing/deduplication depends on that.
2024-09-12 15:57:46 +02:00
Eelco Dolstra
421aa1add1 Add tests for invalid file names in NARs
Note: in general, we rely on the OS to tell us if a name is invalid or
if two names normalize in the same way. But for security, we do want
to make sure that we catch '.', '..', slashes and NUL characters. (NUL
characters aren't really a security issue, but since they would be
truncated when we pass them to the OS, it would be canonicity problem.)
2024-09-12 15:02:30 +02:00
Eelco Dolstra
4cfa59fdb3 Typo 2024-09-09 14:11:35 +02:00
Eelco Dolstra
52ba3cc5ea Test that deserializing regular files / symlinks is exclusive 2024-09-06 16:28:09 +02:00
Eelco Dolstra
9fcb588dd8 RestoreSink::createDirectory(): Use append()
On macOS, `mkdir("x/')` behaves differently than `mkdir("x")` if `x` is
a dangling symlink (the formed succeed while the latter fails). So make
sure we always strip the trailing slash.
2024-09-05 22:21:53 +02:00
Eelco Dolstra
21dcbd7e83 Fix test on macOS 2024-09-05 20:55:24 +02:00
Eelco Dolstra
7a765a6aaf Test that deserializing NARs with names with equal Unicode normal forms fails on macOS
The test is based on the one by @puckipedia but with the file names
swapped to make them sorted.
2024-09-05 20:37:26 +02:00
Eelco Dolstra
3557587381 Detect NAR directory entries that collide with another path after case-hacking
The test was made by @puckipedia.
2024-09-05 19:26:10 +02:00
Eelco Dolstra
77c090cdbd More tests 2024-09-05 16:54:12 +02:00
Eelco Dolstra
da1ad28912 Test that nix-store --restore fails if the output already exists
This restores the behaviour from before the std::filesystem
refactorings.
2024-09-05 16:48:43 +02:00
Eelco Dolstra
83d5b32803 Add test case for NARs with duplicate directory entries
This test was made by @puckipedia.
2024-09-05 16:41:15 +02:00
Renamed from tests/functional/case-hack.sh (Browse further)