No you don't
Code:
jc@jcmain:~$ locate mtab|head
/etc/mtab
/etc/init.d/mtab.sh
/etc/init.d/udev-mtab
/etc/rcS.d/S12mtab.sh
/etc/rcS.d/S36udev-mtab
/home/redundant/toolbox/commblks/commblksdemos/commwcdma_lib_primenumtable.mat
/home/redundant/toolbox/compiler/mcr/matlab/iofun/@rptgen/@rptsummtable
/home/redundant/toolbox/compiler/mcr/matlab/iofun/@rptgen/@rptsummtable/execute.m
/home/redundant/toolbox/compiler/mcr/matlab/iofun/@rptgen/@rptsummtable/execute.p
/home/redundant/toolbox/compiler/mcr/matlab/iofun/@rptgen/@rptsummtable/getContentType.m
All of these files are in directories I don't own, yet I can run locate as a
normal user (to coin a phrase).
This is an odd one, somewhere your permissions are dodgy, as trappa said. Watch:
Code:
jc@jcmain:~$ updatedb
updatedb: can not open a temporary file for `/var/lib/mlocate/mlocate.db'
jc@jcmain:~$ ls -l /var/lib/mlocate/mlocate.db
-rw-r----- 1 root mlocate 17352445 2010-03-12 07:39 /var/lib/mlocate/mlocate.db
See, I can't run
updatedb without being root because that updates the database backend. However, I can run 'locate' (as seen above).
Chances are, the problem is in how your slocate group is setup, though I can't tell you for sure, never having had this problem.