summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2004-12-07 19:08:15 +0000
committermillert <millert@openbsd.org>2004-12-07 19:08:15 +0000
commitaafc3921ef53db49a879b82112fc368a4132cfcb (patch)
tree9336c7a6b1877dbd7422d51359ddcb2626cd6526
parentwhen loading directory info, only close the handle to the Entries file (diff)
downloadwireguard-openbsd-aafc3921ef53db49a879b82112fc368a4132cfcb.tar.xz
wireguard-openbsd-aafc3921ef53db49a879b82112fc368a4132cfcb.zip
Use df to verify that we are not booted from the altboot before doing
the / -> /altroot copy. OK deraadt@
-rw-r--r--etc/daily8
1 files changed, 3 insertions, 5 deletions
diff --git a/etc/daily b/etc/daily
index 1237281eb4b..0b21614bed7 100644
--- a/etc/daily
+++ b/etc/daily
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: daily,v 1.47 2004/11/15 18:10:48 nick Exp $
+# $OpenBSD: daily,v 1.48 2004/12/07 19:08:15 millert Exp $
# From: @(#)daily 8.2 (Berkeley) 1/25/94
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
@@ -91,13 +91,11 @@ fi
# if filesystem named /altroot is type ffs, on /dev/* and mounted "xx",
# use it as a backup root filesystem to be updated daily.
[ "X$ROOTBACKUP" = X1 ] && {
- rootdev=`awk '$2 == "/" && $1 ~ /^\/dev\// && $3 == "ffs" && \
- $4 ~ /rw/ \
- { print substr($1, 6) }' < /etc/fstab`
+ rootdev=`df -n / | awk '/^\/dev\// { print substr($1, 6) }'`
rootbak=`awk '$2 == "/altroot" && $1 ~ /^\/dev\// && $3 == "ffs" && \
$4 ~ /xx/ \
{ print substr($1, 6) }' < /etc/fstab`
- [ X$rootdev != X -a X$rootbak != X ] && {
+ [ X$rootdev != X -a X$rootbak != X -a X$rootdev != X$rootbak ] && {
sync
echo ""
echo "Backing up root filesystem:"