Got a question about slocate code
On Fedora, the db file is at /var/lib/slocate/slocate.db, with permisions 0640 and group owner slocate.
I am quite puzzled about how the program can read from that file while I log in under a normal user account which is not in root or slocate group. I read thru the code but failed to find a clue - perhaps that's because I am new to Linux programming and underlying concepts, or just I am too stupid :shock: . Can any one explain how the process is done to read that file under a normal user id? Great thanks. |
Read the output with
ls -l /usr/bin/slocate (or other path to slocate command) On my system, it has the setgid bit set |
slocate binary has the sgid bit set (-rwxr-sr-x), so it actually runs under slocate group permissions, not yours.
|
Thanks. Got it.
|
All times are GMT -5. The time now is 04:00 PM. |