Date: Wed, 9 Oct 2002 12:40:04 -0700 (PDT) From: Giorgos Keramidas <keramida@freebsd.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/43865: unterminated string in rc.conf leaves system unuseable / disk readonly Message-ID: <200210091940.g99Je4HP079294@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/43865; it has been noted by GNATS. From: Giorgos Keramidas <keramida@freebsd.org> To: Ian Dowse <iedowse@maths.tcd.ie> Cc: Ceri Davies <ceri@freebsd.org>, walterk1@earthlink.net, bug-followup@freebsd.org Subject: Re: bin/43865: unterminated string in rc.conf leaves system unuseable / disk readonly Date: Wed, 9 Oct 2002 22:36:08 +0300 [-- Please keep bug-followup@freebsd.org in the Cc: list. --] On 2002-10-09 19:10, Ian Dowse <iedowse@maths.tcd.ie> wrote: > In message <200210091713.g99HD2Ut063553@freefall.freebsd.org>, > Ceri Davies writes: > >State-Changed-From-To: open->closed > >Pilot error. > > > >/etc/rc.conf is sourced by /bin/sh, and > >therefore must be in valid /bin/sh syntax. > > I actually think that this is a perfectly reasonable bug report. > It is far too easy to miss a quote in rc.conf, yet the file would > rarely contain more than name="value" lines. That's a lot of > foot-shooting potential for very little gain, and is especially > problematic when making configuration changes remotely. One of the ideas I had and never actually got around to implementing was a shell wrapper around $EDITOR that allows root to edit rc.conf and then checks to see that sh(1) can still parse the resulting file. Something along the lines of: # viconf >>> copy /etc/rc.conf to /tmp/rc.conf.orig.$$ and /tmp/rc.conf.$$$ >>> fire up $EDITOR on /tmp/rc.conf.$$$ >>> check to see if the following command works fine: /bin/sh -c '. /tmp/rc.conf.$$' >>> on failure, show a diff -u, and prompt the user for a) abort, e) edit again Does that sound a useful thing to have around? The idea is similar to vipw(8), but it still won't stop anyone from messing around with rc.conf manually. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210091940.g99Je4HP079294>