From: naddy Date: Tue, 9 Feb 2021 21:42:04 +0000 (+0000) Subject: rc: ensure that vfs.mounts.nfs check works without NFS X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0049eb19c27a711bf1a21907c9638be7c5234993;p=openbsd rc: ensure that vfs.mounts.nfs check works without NFS If NFS isn't compiled into the kernel, sysctl -n vfs.mounts.nfs will produce no numerical output. Make sure that we always have a valid arithmetic expression. Reported by and ok patrick@ --- diff --git a/etc/rc b/etc/rc index 94465add54f..cd1d02677a2 100644 --- a/etc/rc +++ b/etc/rc @@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.544 2020/11/29 20:14:06 deraadt Exp $ +# $OpenBSD: rc,v 1.545 2021/02/09 21:42:04 naddy Exp $ # System startup script run by init on autoboot or after single-user. # Output and error are redirected to console by init, and the console is the @@ -424,7 +424,7 @@ if [[ $pf != NO ]]; then pass in proto carp keep state (no-sync) pass out proto carp !received-on any keep state (no-sync)" - if (($(sysctl -n vfs.mounts.nfs 2>/dev/null) > 0)); then + if (($(sysctl -n vfs.mounts.nfs 2>/dev/null)+0 > 0)); then # Don't kill NFS. RULES="set reassemble yes no-df $RULES