From: Todd C. Miller Date: Tue, 29 Dec 2015 20:38:14 +0000 (-0700) Subject: Call openat() with the basename not the full path. From Ben Hutchings. X-Git-Tag: SUDO_1_8_16^2~85 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97e86c74ff31ee8935507b58ac2514a33d7f7146;p=sudo Call openat() with the basename not the full path. From Ben Hutchings. --- diff --git a/src/sudo_edit.c b/src/sudo_edit.c index b49d90bc9..3a9c06dfb 100644 --- a/src/sudo_edit.c +++ b/src/sudo_edit.c @@ -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); }