Call openat() with the basename not the full path. From Ben Hutchings.

This commit is contained in:
Todd C. Miller
2015-12-29 13:38:14 -07:00
parent 330a209695
commit 97e86c74ff

View File

@@ -293,7 +293,7 @@ sudo_edit_open_nonwritable(char *path, int oflags, mode_t mode)
debug_return_int(-1);
}
fd = openat(dfd, path, oflags, mode);
fd = openat(dfd, base, oflags, mode);
close(dfd);
debug_return_int(fd);
}