Bug 913 - Editing with sudo fails on recent versions of macOS
Editing with sudo fails on recent versions of macOS
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.30
Macintosh MacOS X
: low low
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-01-16 10:43 MST by Dan Villiom Podlaski Christiansen
Modified: 2020-06-19 06:14 MDT (History)
0 users

See Also:


Attachments
A quick attempt at fixing this (966 bytes, application/octet-stream)
2020-01-16 10:43 MST, Dan Villiom Podlaski Christiansen
Details
The same quick attempt at fixing this, but marked as a patch (966 bytes, patch)
2020-01-16 10:44 MST, Dan Villiom Podlaski Christiansen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Villiom Podlaski Christiansen 2020-01-16 10:43:34 MST
Created attachment 537 [details]
A quick attempt at fixing this

Recent versions of macOS — from Catalina, at least — mount the root file system as read-only. This breaks both 'sudo -e' and 'sudoedit':

$ sudo -e /etc/hosts
sudo: /etc/hosts: Read-only file system

I've attached a small patch that fixes this on my Mac.
Comment 1 Dan Villiom Podlaski Christiansen 2020-01-16 10:44:12 MST
Created attachment 538 [details]
The same quick attempt at fixing this, but marked as a patch
Comment 2 Todd C. Miller 2020-01-16 10:48:37 MST
Thanks, that fix looks good.
Comment 3 Todd C. Miller 2020-06-19 06:14:02 MDT
The fixed was included in Sudo 1.8.31