mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-29 21:38:05 +00:00
No need to check whether the fd we opened is really a directory in
sudo_edit_open_nonwritable() since if not, the openat() will fail with ENOTDIR anyway.
This commit is contained in:
parent
68c1073fe5
commit
c7c80913ef
@ -364,13 +364,7 @@ restart:
|
|||||||
#endif
|
#endif
|
||||||
debug_return_int(-1);
|
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,
|
is_writable = dir_is_writable(&sb, user_details.uid, user_details.gid,
|
||||||
user_details.ngroups, user_details.groups);
|
user_details.ngroups, user_details.groups);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user