LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Got a question about slocate code (https://www.linuxquestions.org/questions/programming-9/got-a-question-about-slocate-code-306931/)

neo_in_matrix 03-28-2005 05:38 AM

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.

keefaz 03-28-2005 05:51 AM

Read the output with
ls -l /usr/bin/slocate
(or other path to slocate command)

On my system, it has the setgid bit set

jlliagre 03-28-2005 05:54 AM

slocate binary has the sgid bit set (-rwxr-sr-x), so it actually runs under slocate group permissions, not yours.

neo_in_matrix 03-28-2005 08:09 PM

Thanks. Got it.


All times are GMT -5. The time now is 04:00 PM.