[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


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211501

            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
message:

[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
>>> WARNING
>>> 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))
                errx(1,
-                   "database too small: %s\nRun /usr/libexec/locate.updatedb",
+                   "database too small: %s\nRun
/etc/periodic/weekly/310.locate",
                    db);

        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