Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-28-2005, 05:38 AM   #1
Registered: Sep 2003
Posts: 52

Rep: Reputation: 15
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.
Old 03-28-2005, 05:51 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 5,388

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

On my system, it has the setgid bit set
Old 03-28-2005, 05:54 AM   #3
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,703

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
slocate binary has the sgid bit set (-rwxr-sr-x), so it actually runs under slocate group permissions, not yours.
Old 03-28-2005, 08:09 PM   #4
Registered: Sep 2003
Posts: 52

Original Poster
Rep: Reputation: 15
Thanks. Got it.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
slocate dajomu Ubuntu 1 09-16-2005 08:08 PM
Quick slocate/updatedb question? King of Japan Linux - Newbie 4 08-29-2004 01:35 PM
help with slocate plan9 Slackware 8 07-10-2004 01:41 AM
Using slocate in RH 7.2 hominy Linux - Newbie 1 08-10-2003 02:59 PM
really dumb shell question.. (slocate) NGraphiX Linux - General 5 09-18-2002 06:51 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration