In Unix,
if you are a guest user and did:
chmod 777 /
It would fail.
But how does this internally happen at the hardware level?
So far, I think this is what happens:
- The OS tries to execute that instruction.
- Information about permissions is perhaps somewhere in secondary memory. So it would issue a write instruction.
- Before 2, It would check if the user is privileged to do this. If he isn't it would just issue an error message.
Is this how it happens, or is an interrupt raised when such a situation arises? Is there a routine in the ISR table in main memory corresponding to unprivileged instructions?