chase: handle root path more carefully in chase_and_open()

chase_and_open() may be called with relative root path.
This commit is contained in:
Yu Watanabe
2023-06-05 15:50:46 +09:00
parent c0dff4205b
commit 3991f35fbd
3 changed files with 72 additions and 8 deletions
+1
View File
@@ -43,6 +43,7 @@ bool unsafe_transition(const struct stat *a, const struct stat *b);
int chase(const char *path_with_prefix, const char *root, ChaseFlags chase_flags, char **ret_path, int *ret_fd);
int chaseat_prefix_root(const char *path, const char *root, char **ret);
int chase_extract_filename(const char *path, const char *root, char **ret);
int chase_and_open(const char *path, const char *root, ChaseFlags chase_flags, int open_flags, char **ret_path);
int chase_and_opendir(const char *path, const char *root, ChaseFlags chase_flags, char **ret_path, DIR **ret_dir);