]> granicus.if.org Git - sudo/commitdiff
Call openat() with the basename not the full path. From Ben Hutchings.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 29 Dec 2015 20:38:14 +0000 (13:38 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 29 Dec 2015 20:38:14 +0000 (13:38 -0700)
src/sudo_edit.c

index b49d90bc9273e8ce3804e95e8cdcd7e79ffe2221..3a9c06dfb142cfac3a25512a35949f9822f7965d 100644 (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);
 }