summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2019-12-30 16:49:51 +0000
committerespie <espie@openbsd.org>2019-12-30 16:49:51 +0000
commitcedd04accc720fede31873624cbbebeea11c93e0 (patch)
tree27bb86fb3bc14026f96352a17e1296314be7e5a6
parentsimplify the list for moduli options - no need for -compact; (diff)
downloadwireguard-openbsd-cedd04accc720fede31873624cbbebeea11c93e0.tar.xz
wireguard-openbsd-cedd04accc720fede31873624cbbebeea11c93e0.zip
don't suppress error output from running updatelocatedb
check that the resulting db works instead of some more specific test okay schwarze@
-rw-r--r--etc/weekly12
1 files changed, 7 insertions, 5 deletions
diff --git a/etc/weekly b/etc/weekly
index f4609e4e66b..c86b9a57c86 100644
--- a/etc/weekly
+++ b/etc/weekly
@@ -1,5 +1,5 @@
#
-# $OpenBSD: weekly,v 1.28 2017/04/15 13:12:08 schwarze Exp $
+# $OpenBSD: weekly,v 1.29 2019/12/30 16:49:51 espie Exp $
#
# For local additions, create the file /etc/weekly.local.
# To get section headers, use the function next_part in weekly.local.
@@ -49,13 +49,15 @@ if [ -f /var/db/locate.database ]; then
trap 'rm -f $TMP; exit 1' 0 1 15
UPDATEDB="/usr/libexec/locate.updatedb"
echo "${UPDATEDB} --fcodes=- --tmpdir=${TMPDIR:-/tmp}" | \
- nice -5 su -m nobody 2>/dev/null 1>$TMP
- if [ -s "$TMP" ]; then
+ nice -5 su -m nobody 1>$TMP
+ if [ $? -ne 0 ]; then
+ echo "Rebuilding locate database failed"
+ elif ! locate -d $TMP /etc/weekly >/dev/null; then
+ echo "Not installing invalid locate database"
+ else
chmod 444 $TMP
chown root:wheel $TMP
mv -f $TMP /var/db/locate.database
- else
- echo "Not installing locate database; zero size"
fi
else
echo "Not rebuilding locate database; can't create temp file"