From 97e86c74ff31ee8935507b58ac2514a33d7f7146 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 29 Dec 2015 13:38:14 -0700 Subject: [PATCH] Call openat() with the basename not the full path. From Ben Hutchings. --- src/sudo_edit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.50.1