Re: [PATCH] /etc/netstart: unquoted command substitution inside arithmetic expression

2021-10-10 Thread bm1les
Exactly my point. Even if the circumstances were contrived, I think it would good to fix it just for the sake of correctness. The issue is actually a pattern I found not only in /etc/netstart but also in /etc/rc. (( )) cannot deal with an empty result yet it sometimes includes calls to sysctl

Re: [PATCH] /etc/netstart: unquoted command substitution inside arithmetic expression

2021-10-10 Thread Philip Guenther
On Sun, Oct 10, 2021 at 1:48 PM bm1les wrote: > Exactly my point. Even if the circumstances were contrived, I think it > would good to fix it just for the sake of correctness. > Sure, knowing what circumstances could cause a problem assists in achieving correctness. > The issue is actually a

Re: [PATCH] /etc/netstart: unquoted command substitution inside arithmetic expression

2021-10-08 Thread Theo de Raadt
Philip Guenther wrote: > On Fri, Oct 8, 2021 at 8:57 AM Theo de Raadt wrote: > > Philip Guenther wrote: > > > On Thu, Oct 7, 2021 at 5:57 PM bm1les wrote: > > > > > --- netstart2 Sep 2021 19:38:20 - 1.216 > > > +++ netstart8 Oct 2021 02:43:30 - > > > @@ -365,7

Re: [PATCH] /etc/netstart: unquoted command substitution inside arithmetic expression

2021-10-08 Thread Philip Guenther
On Fri, Oct 8, 2021 at 8:57 AM Theo de Raadt wrote: > Philip Guenther wrote: > > > On Thu, Oct 7, 2021 at 5:57 PM bm1les wrote: > > > > > --- netstart2 Sep 2021 19:38:20 - 1.216 > > > +++ netstart8 Oct 2021 02:43:30 - > > > @@ -365,7 +365,7 @@ ifmstart "tun tap gif

Re: [PATCH] /etc/netstart: unquoted command substitution inside arithmetic expression

2021-10-08 Thread Theo de Raadt
Philip Guenther wrote: > On Thu, Oct 7, 2021 at 5:57 PM bm1les wrote: > > > --- netstart2 Sep 2021 19:38:20 - 1.216 > > +++ netstart8 Oct 2021 02:43:30 - > > @@ -365,7 +365,7 @@ ifmstart "tun tap gif etherip gre egre p > > if [[ $ip6kernel == YES ]]; then > > #

Re: [PATCH] /etc/netstart: unquoted command substitution inside arithmetic expression

2021-10-08 Thread bm1les
Since you obviously care enough to reply and wonder about what I'm doing, I can happily let you know. I was trying to configure the network while running bsd.rd. I figured I could reuse netstart when I spotted this bug. The bug is that the second part of the expression breaks when sysctl

Re: [PATCH] /etc/netstart: unquoted command substitution inside arithmetic expression

2021-10-08 Thread bm1les
The first problem is the lack of correctness; that should be enough. The second problem is that such command actually breaks when run using bsd.rd. ‐‐‐ Original Message ‐‐‐ On Friday, October 8th, 2021 at 12:11 AM, Philip Guenther wrote: > On Thu, Oct 7, 2021 at 5:57 PM bm1les wrote:

[PATCH] /etc/netstart: unquoted command substitution inside arithmetic expression

2021-10-08 Thread bm1les
Index: netstart === RCS file: /cvs/src/etc/netstart,v retrieving revision 1.216 diff -u -p -u -r1.216 netstart --- netstart2 Sep 2021 19:38:20 - 1.216 +++ netstart8 Oct 2021 02:43:30 - @@ -365,7 +365,7 @@

Re: [PATCH] /etc/netstart: unquoted command substitution inside arithmetic expression

2021-10-07 Thread Klemens Nanni
On Fri, Oct 08, 2021 at 05:15:36AM +, bm1les wrote: > The first problem is the lack of correctness; that should be enough. > The second problem is that such command actually breaks when run using bsd.rd. netstart(8) has nothing to do in or with bsd.rd, whatever you do: you own all the pieces.

Re: [PATCH] /etc/netstart: unquoted command substitution inside arithmetic expression

2021-10-07 Thread Philip Guenther
On Thu, Oct 7, 2021 at 5:57 PM bm1les wrote: > --- netstart2 Sep 2021 19:38:20 - 1.216 > +++ netstart8 Oct 2021 02:43:30 - > @@ -365,7 +365,7 @@ ifmstart "tun tap gif etherip gre egre p > if [[ $ip6kernel == YES ]]; then > # Ensure IPv6 Duplicate Address Detection