projects
/
sudo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68c1073
)
No need to check whether the fd we opened is really a directory in
author
Todd C. Miller
<Todd.Miller@courtesan.com>
Mon, 11 Jan 2016 18:15:42 +0000
(11:15 -0700)
committer
Todd C. Miller
<Todd.Miller@courtesan.com>
Mon, 11 Jan 2016 18:15:42 +0000
(11:15 -0700)
sudo_edit_open_nonwritable() since if not, the openat() will fail
with ENOTDIR anyway.
src/sudo_edit.c
patch
|
blob
|
history
diff --git
a/src/sudo_edit.c
b/src/sudo_edit.c
index ce060d9721e1c3352a5798df201c87a7c0b603d8..c09d793544338a94506c50e7a45c9a4548b6ade7 100644
(file)
--- a/
src/sudo_edit.c
+++ b/
src/sudo_edit.c
@@
-364,13
+364,7
@@
restart:
#endif
debug_return_int(-1);
}
-#ifndef O_DIRECTORY
- if (!S_ISDIR(sb.st_mode)) {
- close(dfd);
- errno = ENOTDIR;
- debug_return_int(-1);
- }
-#endif
+
is_writable = dir_is_writable(&sb, user_details.uid, user_details.gid,
user_details.ngroups, user_details.groups);