sudo would do nothing. Changing the (effective) user and group IDs does not magically make rm aware of the immutable bit, nor does it alter the behaviour of rm’s code to unset that bit before trying to remove it.
In the example I gave above, I did use sudo. sudo -i started an interactive shell with root permissions, and rm failed to remove the directory and file inside it.
sudo
would do nothing. Changing the (effective) user and group IDs does not magically makerm
aware of the immutable bit, nor does it alter the behaviour ofrm
’s code to unset that bit before trying to remove it.In the example I gave above, I did use
sudo
.sudo -i
started an interactive shell with root permissions, andrm
failed to remove the directory and file inside it.