Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hoe can non-root use locate?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
edcjones
n00b
n00b


Joined: 04 Jul 2002
Posts: 60

PostPosted: Mon Oct 07, 2002 4:05 am    Post subject: Hoe can non-root use locate? Reply with quote

I would like to use locate when I am logged on as a non-root user. I get the message

warning: slocate: could not open database: /var/lib/slocate/slocate.db: Permission denied

Here are the permissions:

-rw-r--r-- 1 root slocate 5815180 Oct 6 23:39 /var/lib/slocate/slocate.db

The database was created by:

slocate -u -l0 -e "/mnt, ...."

What should I do?
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Mon Oct 07, 2002 4:44 am    Post subject: Reply with quote

Well, usually the updatedb script is ran in a cron job of some kind, under root. I don't think this is done by default, though I coulc be wrong. (it's been documented once or twice, my being wrong that is)

As long as updatedb is ran by root occasionally, anyone can use locate.

EDIT: I just re-read your post, and I've never heard of slocate. Though I'm not doubting you, and I just checked in "emerge -s slocate" and came up with sys-apps/slocate (which I don't have installed), I use sys-apps/findutils which has "locate" in it.
wow.. that last paragraph was really twisted, I donno if you'll understand it or not lol. Basically, I don't have slocate installed, I have sys-apps/findutils installed which has "locate" and works with non-root users quite easily.
Back to top
View user's profile Send private message
edcjones
n00b
n00b


Joined: 04 Jul 2002
Posts: 60

PostPosted: Mon Oct 07, 2002 6:24 pm    Post subject: Reply with quote

"/usr/bin/locate" is a symlink to "usr/nin/slocate". On my system, "sys-apps/slocate" is installed.
_________________
Python, Swig & computer vision
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Mon Oct 07, 2002 9:49 pm    Post subject: Reply with quote

Then I donno what to tell you.
I have locate installed and working fine, from the findutils ebuild.
"qpkg -fp locate" shows me that sys-apps/findutils contains locate, and "qpkg -l findutils | grep -i locate" shows exactly what locate contains:
Code:

/usr/bin/locate
/usr/share/man/man1/locate.1.gz
/usr/share/man/man5/locatedb.5.gz
/var/spool/locate
/var/spool/locate/.keep


replacing "locate" with "update" shows you that it also installs updatedb.
I'm not saying your wrong, but what I am saying is perhaps you can try the findutils ebuild, considering it works fine for me as a non-root user. If anyone else can speak about slocate, that'd be great. I will admit that the description of slocate seems quite nice. ("secure locate provides a secure way to index and quickly search for files on your system (drop-in replacement for 'locate'")
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Mon Oct 07, 2002 10:43 pm    Post subject: Reply with quote

Sounds to me like the 'secure' part includes taking away access from non-root users.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Mon Oct 07, 2002 10:47 pm    Post subject: Reply with quote

FWIW, on Mandrake, /usr/bin/locate is sgid slocate.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
edcjones
n00b
n00b


Joined: 04 Jul 2002
Posts: 60

PostPosted: Tue Oct 08, 2002 2:14 am    Post subject: Reply with quote

Thanks. I needed to suid slocate:

chmod u+s /usr/bin/slocate

Meta-questions:
What search or what documentation has the answer to my problem?
How do I discover what to search for or which documentation to read?
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Tue Oct 08, 2002 2:22 am    Post subject: Reply with quote

edcjones wrote:
What search or what documentation has the answer to my problem?
How do I discover what to search for or which documentation to read?

A magician never reveals her secrets. :twisted:

I found that one with a google search for "slocate user permission". There's also lots of good tips in Have any searching techniques to share?.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum