Treat EROFS (like EACCES) as a non-fatal error in dir_is_writable().

Fixes sudoedit on macOS 10.15 and above where the root file system
is mounted read-only.  See https://support.apple.com/en-us/HT210650.
From Dan Villiom Podlaski Christiansen.  Bug #913
This commit is contained in:
Todd C. Miller
2020-01-16 13:55:32 -07:00
parent 161750fc56
commit 9e12b71776

View File

@@ -133,7 +133,7 @@ dir_is_writable(int dfd, struct user_details *ud, struct command_details *cd)
if (rc == 0) if (rc == 0)
debug_return_int(true); debug_return_int(true);
if (errno == EACCES) if (errno == EACCES || errno == EROFS)
debug_return_int(false); debug_return_int(false);
debug_return_int(-1); debug_return_int(-1);
} }