I can't believe there is no simple solution to this (because it seems potentially a very useful feature to me), but so far I couldn't find any.
I'd like to be able to (temporarily) turn off my own write permission to the filesystem I'm using. Let's say, I'm logged in on a sensitive system where all I want is to view files but I want to avoid making any changes by mistake.
A lighter version:
If all the write permissions I have are due to the groups to which I belong (I disregard now my home directory), can I turn off these permissions by somehow temporarily removing myself from these groups (newgrp only changes my default group but not the whole group list)?
Of course, in either version I'm asking about doing this without the root privileges.
mount -o remount, ro /dev/sda1
– Ramesh Apr 24 '14 at 16:18open()
and return an error if passedO_WRONLY
orO_RDWR
, and then put it in$LD_LIBRARY_PATH
. Not sure if I would consider that a good, or terribly evil solution :-/ – phemmer Apr 25 '14 at 00:36ulimit
is for. – mikeserv Jan 24 '16 at 05:15