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@FreeBSD.org
          Reporter: li...@peter.de.com

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

[root@host:~]# locate emacs
locate: database too small: /var/db/locate.database
Run /usr/libexec/locate.updatedb
[root@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@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.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to