Call openat() with the basename not the full path. From Ben Hutchings.
This commit is contained in:
@@ -293,7 +293,7 @@ sudo_edit_open_nonwritable(char *path, int oflags, mode_t mode)
|
|||||||
debug_return_int(-1);
|
debug_return_int(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
fd = openat(dfd, path, oflags, mode);
|
fd = openat(dfd, base, oflags, mode);
|
||||||
close(dfd);
|
close(dfd);
|
||||||
debug_return_int(fd);
|
debug_return_int(fd);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user