summaryrefslogtreecommitdiffstats
path: root/usr.bin/locate
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/locate')
-rw-r--r--usr.bin/locate/locate/locate.rc8
-rw-r--r--usr.bin/locate/locate/updatedb.sh4
2 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/locate/locate/locate.rc b/usr.bin/locate/locate/locate.rc
index 2d0f033..54cc6d8 100644
--- a/usr.bin/locate/locate/locate.rc
+++ b/usr.bin/locate/locate/locate.rc
@@ -22,5 +22,9 @@
# and if the SEARCHPATHS starts in such a filesystem locate will build
# an empty database.
#
-# be careful if you add 'nfs'
-#FILESYSTEMS="ufs ext2fs"
+# the default list contains all local file systems that are not synthetic,
+# loopback mounts, or read-only, according to lsvfs.
+#
+# be careful if you add 'nfs' or other network file system types or file
+# systems that generally reside on slow or removable devices like cd9660
+#FILESYSTEMS="ufs ext2fs zfs xfs"
diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh
index ea9122f..d828438 100644
--- a/usr.bin/locate/locate/updatedb.sh
+++ b/usr.bin/locate/locate/updatedb.sh
@@ -52,7 +52,9 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH
: ${FCODES:=/var/db/locate.database} # the database
: ${SEARCHPATHS:="/"} # directories to be put in the database
: ${PRUNEPATHS:="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories
-: ${FILESYSTEMS:="local"} # allowed filesystems
+: ${FILESYSTEMS:="$(lsvfs | tail -n +3 | \
+ egrep -vw "loopback|network|synthetic|read-only|0" | \
+ cut -d " " -f1)"} # allowed filesystems
: ${find:=find}
case X"$SEARCHPATHS" in
OpenPOWER on IntegriCloud