Commit 825f687
runtime: Detect symlinked directories in DirectoryIterator
DirectoryIterator::next() only sets `is_directory` when `dirent.d_type
== DT_DIR`. For entries whose `d_type` is `DT_LNK` (a symlink pointing
at a directory) or `DT_UNKNOWN` (returned by file systems that don't
populate `d_type`), a directory is misclassified as a regular file.
This breaks `install()` in selfhost/main.jakt: it takes the file-copy
path for such an entry, opens it, and `read()`s it, which fails with
`EISDIR`.
It reproduces during a normal SerenityOS toolchain
build. runtime/CMakeLists.txt populates runtime/AK by symlinking
every entry of SerenityOS' AK/ directory, so the AK/Math subdirectory
becomes a symlink-to-directory. Environment: Linux (Fedora 44),
reproduced via `Meta/serenity.sh build`.
Note: this surfaced after commit d4c79a3 : file(COPY ...) ->
create_symlink. Alternatively reverting to copying AK would also
resolve it. Glad to take whichever direction you'd prefer.1 parent ec3f4d3 commit 825f687
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | | - | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
103 | 110 | | |
104 | 111 | | |
105 | 112 | | |
| |||
0 commit comments