Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Aug 2016 12:19:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 211501] locate(1): Misleading help message
Message-ID:  <bug-211501-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211501

            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: lists@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=20

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 =3D sb.st_size;
        if (len < (2*NBG))
                errx(1,
-                   "database too small: %s\nRun /usr/libexec/locate.update=
db",
+                   "database too small: %s\nRun
/etc/periodic/weekly/310.locate",
                    db);

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

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-211501-8>