diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-06-16 14:55:47 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-06-16 15:00:17 -0400 |
commit | 53fffe30cbdd2422dbbc648677faef4eb2c6c43e (patch) | |
tree | 04f8790dbbee18f346ead8d579deb7206ae2f01c /exec.c | |
parent | 78dfcf6237400281940a7bd97c05ac18eb69c577 (diff) | |
download | bfs-53fffe30cbdd2422dbbc648677faef4eb2c6c43e.tar.xz |
exec: Assert that at_fd is the immediate parent
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -266,6 +266,9 @@ static int bfs_exec_openwd(struct bfs_exec *execbuf, const struct BFTW *ftwbuf) assert(!execbuf->wd_path); if (ftwbuf->at_fd != AT_FDCWD) { + // Rely on at_fd being the immediate parent + assert(ftwbuf->at_path == xbasename(ftwbuf->at_path)); + execbuf->wd_fd = ftwbuf->at_fd; if (!(execbuf->flags & BFS_EXEC_MULTI)) { return 0; |