Index | Thread | Search

From:
Klemens Nanni <kn@openbsd.org>
Subject:
Re: add rcctl configtest ospfd/ospf6d
To:
tech@openbsd.org
Date:
Thu, 29 Feb 2024 22:01:53 +0000

Download raw body.

Thread
On Mon, Feb 26, 2024 at 02:47:04PM +0100, Claudio Jeker wrote:
> On Mon, Feb 26, 2024 at 01:39:13PM +0000, Klemens Nanni wrote:
> > On Mon, Feb 26, 2024 at 12:09:25PM +0100, Claudio Jeker wrote:
> > > On Sat, Feb 24, 2024 at 09:29:46AM -0500, aisha wrote:
> > > > Hi,
> > > >   I've attached a patch for adding configtest option for ospfd/ospf6d.
> > > > 
> > > > OK?
> > > 
> > > Please check the rc_configtest function of bgpd. You probably want to do
> > > the same here as well.
> > 
> > Is that actually still a problem?
> 
> I don't know. AFAIK there was no fix for this.
> 
> > One that can't be fixed in rc* code?
> 
> No idea, I guess it should.
>  
> > Last time I looked, we had an incosistent mix of simple rc_*() as below
> > and this one

Some ports daemons use a simple '${dameon} -n ${daemon_flags}', but all
base daemons, incl. bgpd, with an rc_configtest() use the rc_exec idiom.

> > 	rc_configtest() {
> > 		# use rc_exec here since daemon_flags may contain arguments with spaces
> > 		rc_exec "${daemon} -n ${daemon_flags}"
> > 	}
> > 
> > but I did not look further into it.
> 
> I wonder if most of those have similar issues and just work because people
> did not use complex _flags settings.

I quick test shows that rc_exec plus quoting is needed to have stuff
like this working:

	$ rcctl get dhcpd flags
	-c /tmp/dhcp\ d.conf

So ospf*d diff should use rc_exec.