Bug 124119 - locate(1) doesn't check /etc/locate.rc for the default database
Summary: locate(1) doesn't check /etc/locate.rc for the default database
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 7.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
: 160225 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-30 07:20 UTC by edwin
Modified: 2021-10-26 15:07 UTC (History)
2 users (show)

See Also:


Attachments
a (3.12 KB, text/plain; charset=us-ascii)
2008-08-18 06:49 UTC, Edwin Groothuis
no flags Details
b (473 bytes, text/plain; charset=us-ascii)
2008-08-18 06:49 UTC, Edwin Groothuis
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description edwin 2008-05-30 07:20:01 UTC
    [~] root@k7>grep FCODES /etc/locate.rc 
    FCODES="/usr/var/locate/locate.database"
    [~] root@k7>locate foo
    locate: database too small: /var/db/locate.database

    This PR is more a placeholder for me to remember to fix it. Or
    at least discuss it.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2008-08-18 06:49:00 UTC
The PR is about that if you change the location of the database in
/etc/rc.local, not all locate-related tools (locate(1),
/etc/periodic/weekly/310.locate) do follow up on them.

The first patch is the 310.locate script, which needs to know that
it should initialize the right database.

The second patch updates the man-page, adds some more comments to
the locate.rc and the patches locate.c file itself to first see if
the -d option was given, then if LOCATE_PATH exists in the environment,
then checks for the line FCODES in /etc/locate.rc, and then if
everything fails it uses _PATH_FCODES value.

What do you think of it?

-- 
Edwin Groothuis
edwin@freebsd.org
http://www.mavetju.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2008-08-18 07:00:16 UTC
Responsible Changed
From-To: freebsd-bugs->edwin

It's mine
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-01-08 04:14:29 UTC
For the following conditions
Product: Base System, Documentation Status: New, Open, In Progress, UNCONFIRMED 
Assignee: Former FreeBSD committer 

Reset to default assignee. Reset status to "Open".
Comment 4 Piotr Pawel Stefaniak freebsd_committer freebsd_triage 2021-10-07 19:56:30 UTC
*** Bug 160225 has been marked as a duplicate of this bug. ***
Comment 5 Wolfram Schneider freebsd_committer freebsd_triage 2021-10-26 15:07:57 UTC
I'm not sure if I like the idea that the c program locate(1) parse a shell like configuration file /etc/locate.rc

If you change the path for the locate database in /etc/locate.rc then you can also add the new path to /etc/profile - and we are done.