Share your knowledge at the LQ Wiki.
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, 06: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, 06:51 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
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, 06:54 AM   #3
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Tribblix, Ubuntu/WSL
Posts: 9,771

Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
slocate binary has the sgid bit set (-rwxr-sr-x), so it actually runs under slocate group permissions, not yours.
Old 03-28-2005, 09: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 09:08 PM
Quick slocate/updatedb question? King of Japan Linux - Newbie 4 08-29-2004 02:35 PM
help with slocate plan9 Slackware 8 07-10-2004 02:41 AM
Using slocate in RH 7.2 hominy Linux - Newbie 1 08-10-2003 03:59 PM
really dumb shell question.. (slocate) NGraphiX Linux - General 5 09-18-2002 07:51 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:57 AM.

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