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.
This commit is contained in:
@@ -73,6 +73,11 @@ TEST(chase) {
|
||||
assert_se(path_equal(result, "/usr"));
|
||||
result = mfree(result);
|
||||
|
||||
r = chase(p, "/.//../../../", 0, &result, NULL);
|
||||
assert_se(r > 0);
|
||||
assert_se(path_equal(result, "/usr"));
|
||||
result = mfree(result);
|
||||
|
||||
pslash = strjoina(p, "/");
|
||||
r = chase(pslash, NULL, 0, &result, NULL);
|
||||
assert_se(r > 0);
|
||||
|
||||
Reference in New Issue
Block a user