if (strcmp(path, ".") == 0 && strcmp(parent, ".") == 0) {
parent_fd = safe_open("..", O_DIRECTORY | O_NOFOLLOW);
}
+ else if (strcmp(path, "..") == 0 && strcmp(parent, ".") == 0) {
+ parent_fd = safe_open("../..", O_DIRECTORY | O_NOFOLLOW);
+ }
else {
parent_fd = safe_open(parent, O_DIRECTORY | O_NOFOLLOW);
}
if (strcmp(path, ".") == 0 && strcmp(parent, ".") == 0) {
fd = open(".", O_NOFOLLOW);
}
+ else if (strcmp(path, "..") == 0 && strcmp(parent, ".") == 0) {
+ fd = open("..", O_NOFOLLOW);
+ }
else {
fd = openat(parent_fd, basename(basename_path_copy), O_NOFOLLOW);
}