From ee8831258eab4dd1ddd10a07a70b43ecd27d19e5 Mon Sep 17 00:00:00 2001 From: rpe <> Date: Mon, 20 Jul 2015 06:59:39 +0000 Subject: [PATCH] Disable Strict Bourne shell mode for /etc/rc and /etc/netstart to be able to use ksh syntax within these scripts. This way init doesn't need to be changed, which starts /etc/rc using /bin/sh and people can still use "sh /etc/netstart ifname". Idea from and OK halex@ OK deraadt@ krw@ guenther@ --- src/etc/netstart | 5 ++++- src/etc/rc | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/etc/netstart b/src/etc/netstart index 4832fa31..27999ba4 100644 --- a/src/etc/netstart +++ b/src/etc/netstart @@ -1,6 +1,9 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.152 2015/07/19 23:42:58 florian Exp $ +# $OpenBSD: netstart,v 1.153 2015/07/20 06:59:39 rpe Exp $ + +# Turn off Strict Bourne shell mode. +set +o sh # Strip comments (and leading/trailing whitespace if IFS is set) from a file # and spew to stdout. diff --git a/src/etc/rc b/src/etc/rc index dd065cc4..5cf41da1 100644 --- a/src/etc/rc +++ b/src/etc/rc @@ -1,9 +1,12 @@ -# $OpenBSD: rc,v 1.453 2015/07/19 04:44:36 rpe Exp $ +# $OpenBSD: rc,v 1.454 2015/07/20 06:59:39 rpe 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 # controlling terminal. +# Turn off Strict Bourne shell. +set +o sh + # Subroutines (have to come first).