From owner-freebsd-bugs Wed Oct 9 13:30: 4 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9216937B401 for ; Wed, 9 Oct 2002 13:30:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C2A843E3B for ; Wed, 9 Oct 2002 13:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g99KU3Co087054 for ; Wed, 9 Oct 2002 13:30:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g99KU3iC087053; Wed, 9 Oct 2002 13:30:03 -0700 (PDT) Date: Wed, 9 Oct 2002 13:30:03 -0700 (PDT) Message-Id: <200210092030.g99KU3iC087053@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ceri Davies Subject: Re: bin/43865: unterminated string in rc.conf leaves system unuseable / disk readonly Reply-To: Ceri Davies Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/43865; it has been noted by GNATS. From: Ceri Davies To: Giorgos Keramidas Cc: Ian Dowse , bug-followup@freebsd.org Subject: Re: bin/43865: unterminated string in rc.conf leaves system unuseable / disk readonly Date: Wed, 9 Oct 2002 21:20:18 +0100 On Wed, Oct 09, 2002 at 10:36:08PM +0300, Giorgos Keramidas wrote: > [-- Please keep bug-followup@freebsd.org in the Cc: list. --] > 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 Sounds good. lockf is your friend. Ceri -- you can't see when light's so strong you can't see when light is gone To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message