View previous topic :: View next topic |
Author |
Message |
edcjones n00b
Joined: 04 Jul 2002 Posts: 60
|
Posted: Mon Oct 07, 2002 4:05 am Post subject: Hoe can non-root use locate? |
|
|
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 |
|
|
arkane l33t
Joined: 30 Apr 2002 Posts: 918 Location: Phoenix, AZ
|
Posted: Mon Oct 07, 2002 4:44 am Post subject: |
|
|
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 |
|
|
edcjones n00b
Joined: 04 Jul 2002 Posts: 60
|
Posted: Mon Oct 07, 2002 6:24 pm Post subject: |
|
|
"/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 |
|
|
arkane l33t
Joined: 30 Apr 2002 Posts: 918 Location: Phoenix, AZ
|
Posted: Mon Oct 07, 2002 9:49 pm Post subject: |
|
|
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 |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Mon Oct 07, 2002 10:43 pm Post subject: |
|
|
Sounds to me like the 'secure' part includes taking away access from non-root users. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Mon Oct 07, 2002 10:47 pm Post subject: |
|
|
FWIW, on Mandrake, /usr/bin/locate is sgid slocate. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
edcjones n00b
Joined: 04 Jul 2002 Posts: 60
|
Posted: Tue Oct 08, 2002 2:14 am Post subject: |
|
|
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 |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Tue Oct 08, 2002 2:22 am Post subject: |
|
|
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.
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 |
|
|
|