Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Re: Locate versus slocate' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Re: Locate versus slocate
Authored by: sjk on Mar 25, '02 10:27:22PM
/etc/weekly runs /usr/libexec/locate.updatedb as user "nobody" so only filenames within directories nobody can read+search will end up in /var/db/locate.db. If you update the database from Locator it runs locate.updatedb as root and won't be restricted by directory permissions so all (well, nearly all) filenames on your local disk will be in /var/db/locate.db. If you want every user to have the ability to "locate" their own files it's easiest to create the db as root, but that also allows them to "locate" anyone's files. A sysadmin-centric approach is to create /var/db/locate.db as root and make it group-readable for a trusted group, restricting everyone else. This is useful for tracking down files for administrative purposes in a server environment. Implementing a more general, user-specific "locate" scheme is nearly futile without file ownership information in locate.db and only worth attempting if the location of each users' files were regulated (e.g. only under home directories). Better to write a locate-style utility that doesn't rely only on pathnames. Or if you only have a couple users you can create a locate.db for each of them. Sorry for the long post; e-mail me if you want more info.


[ Reply to This | # ]