chase: check root path in more detail
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 21 Jul 2023 04:28:39 +0000 (13:28 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 29 Jul 2023 13:09:28 +0000 (22:09 +0900)
commit83c57d8cde7ac43e5d00e2ed247c831f4e241ba8
treea19047eda0b81acc1987bff2270312ac28809d3a
parent4de5b4e3751609e6a0fe5e3f5dfef22ccae56fad
chase: check root path in more detail

In chaseat() we call dir_fd_is_root() several places, and the final
result depends on it. If the root path specified to `chase()` is not
normalized but points to "/", e.g. "/../", assertions in `chaseat()` or
`chase()` may be triggered.
src/basic/chase.c
src/basic/fd-util.h
src/test/test-chase.c