HardenedBSD/etc/periodic/weekly/310.locate
Sheldon Hearn e9ebca08d7 Update the locate database even if user nobody can't stat root's
home directory.

PR:	10700
Submitted by:	Sergey Korsak <skif@1plus1.net>
1999-06-21 18:36:18 +00:00

18 lines
375 B
Bash
Executable File

#!/bin/sh -
#
# $Id: 310.locate,v 1.2 1997/11/01 15:00:40 wosch Exp $
#
locdb=/var/db/locate.database
if [ -x /usr/libexec/locate.updatedb -a -f $locdb ] ; then
echo ""
echo "Rebuilding locate database:"
touch ${locdb}; chown nobody ${locdb}; chmod 644 ${locdb}
cd /
echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody
chmod 444 ${locdb}
fi