From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 23:31:57 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AFE3016A4CE for ; Thu, 15 Apr 2004 23:31:57 -0700 (PDT) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36A3C43D1F for ; Thu, 15 Apr 2004 23:31:56 -0700 (PDT) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (localhost [127.0.0.1]) (authenticated bits=0) by cain.gsoft.com.au (8.12.9/8.12.8) with ESMTP id i3G6VNQ9019058; Fri, 16 Apr 2004 16:01:24 +0930 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-hackers@freebsd.org Date: Fri, 16 Apr 2004 16:01:21 +0930 User-Agent: KMail/1.6.1 References: <20040414215601.GA3923@crodrigues.org> <407F73C8.8090306@kientzle.com> In-Reply-To: <407F73C8.8090306@kientzle.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200404161601.21446.doconnor@gsoft.com.au> X-Spam-Score: -3.6 () CARRIAGE_RETURNS,IN_REP_TO,REFERENCES,SPAM_PHRASE_02_03,USER_AGENT,USER_AGENT_KMAIL X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) cc: Craig Rodrigues Subject: Re: C code for parsing rc.conf? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2004 06:31:57 -0000 On Fri, 16 Apr 2004 15:18, Tim Kientzle wrote: > > The shell's environment will be exported to your program's environment. > > Not quite. This approach gives you the rc.conf settings > intermingled with the rest of the environment, which is > probably not what you want. > > (It's okay if you're just testing a few particular > rc.conf settings, but if you want to collect an accurate > list of all rc.conf settings, it won't do.) And it still only gives you read-only access to shell-trick mangled parameters. I suspect those are pretty rare and a parser which noted which parameters it couldn't parse and reproduced them verbatim out write-out would probably be OK. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5