since ENOTDIR can be a legitimate errno. This avoids a bogus
"directory is writable" error in that case.
if (dir_is_writable(&sb, user_details.uid, user_details.gid,
user_details.ngroups, user_details.groups)) {
close(dfd);
- errno = ENOTDIR;
+ errno = EISDIR;
debug_return_int(-1);
}
if (ofd == -1 && errno == ELOOP) {
sudo_warnx(U_("%s: editing symbolic links is not permitted"),
files[i]);
- } else if (ofd == -1 && errno == ENOTDIR) {
+ } else if (ofd == -1 && errno == EISDIR) {
sudo_warnx(U_("%s: editing files in a writable directory is not permitted"),
files[i]);
} else {