Initial statement
I was installing open source ntfs-3g on my mac (Catalina). At some point, while crsutil was enabled (i.e. System Integrity Protection was on) , I had to modify one line in the ntfs-3g package and I couldn't write on the file due to the crsutil protection (I was using vim).
However, I found this answer https://superuser.com/a/1518414/1220896. With nano, I could modify the "protected" file without any reboot nor switching crsutil to disable.
And now, I am still trying to figure out how sudo nano
can bypass SIP while sudo vim
or any other text editor can't (update by the author: here I make the mistake of assuming it was SIP related).
Complete command:
sudo nano /usr/local/sbin/mount_ntfs
/usr/local/sbin/mount_ntfs
is a soft link to /usr/local/Cellar/ntfs-3g/2017.3.23_3/sbin/mount_ntfs
. In order to create the soft link, I had performed the csrutil disable/enable.
output of ls -ls /usr/local/sbin/mount_ntfs
0 lrwxr-xr-x 1 user admin 45 Sep 18 16:33 /usr/local/sbin/mount_ntfs -> ../Cellar/ntfs-3g/2017.3.23_3/sbin/mount_ntfs
output of ls -ls /usr/local/Cellar/ntfs-3g/2017.3.23_3/sbin/mount_ntfs
8 -r-xr-xr-x 1 user admin 613 Sep 19 14:17 mount_ntfs
Any idea ?
Update
The problem doesn't come from SIP as pointed out by the contributors to this question. I mark this question as solved and will try to find out why sudo vim
could only access the file in readonly despite the permissions being well set.
I thank you all for your input.
As a personal not, i would say that sometimes being on the wrong path doesn't mean you can't learn from it --- consider this when replying to someone misleaded like I was.
sudo nano
can bypass SIP and there is probably a logical explanation, but without duplicating exactly what you did, I'll wait till I replicate what you did. – user3439894 Sep 19 '20 at 15:21