mardi 27 janvier 2015

How passwd command from non-root account succeeds


I am trying to change my password as a non root user :



passwd


The data is updated in /etc/shadow, but checking the permission i get:



---------- 1 root root 6076 Jan 27 17:14 /etc/shadow
cat /etc/shadow
cat: /etc/shadow: Permission denied


Clearly there were no permissions on the file for anyone, even then the passwd command succeeds, and i am indirectly updating data to a non-previliged resource (shadow file)! So can anyone explain the mechanism that how the updation takes place in background ? Explanation with reference to the system calls will be very useful.



Aucun commentaire:

Enregistrer un commentaire