LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 03-28-2005, 06:38 AM   #1
neo_in_matrix
Member
 
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
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,617

Rep: Reputation: 136Reputation: 136
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
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,520

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
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
neo_in_matrix
Member
 
Registered: Sep 2003
Posts: 52

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


Reply


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


All times are GMT -5. The time now is 09:12 AM.

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