[Bug 211501] locate(1): Misleading help message

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Aug 1 12:19:03 UTC 2016


            Bug ID: 211501
           Summary: locate(1): Misleading help message
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: lists at peter.de.com

Using locate(1) on a fresh install prints misleading and slightly dangerous

[root at host:~]# locate emacs
locate: database too small: /var/db/locate.database
Run /usr/libexec/locate.updatedb
[root at host:~]# /usr/libexec/locate.updatedb
>>> Executing updatedb as root.  This WILL reveal all filenames
>>> on your machine to all login users, which is a security risk.

It would be better to link to the periodic job in /etc:

[root at host:~]# /etc/periodic/weekly/310.locate 

Rebuilding locate database:

diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c
index 3a87b14..a6aa8de 100644
--- a/usr.bin/locate/locate/locate.c
+++ b/usr.bin/locate/locate/locate.c
@@ -293,7 +293,7 @@ search_mmap(db, s)
        len = sb.st_size;
        if (len < (2*NBG))
-                   "database too small: %s\nRun /usr/libexec/locate.updatedb",
+                   "database too small: %s\nRun

        if ((p = mmap((caddr_t)0, (size_t)len,

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list