From owner-freebsd-hackers Thu Jan 2 13:52:40 2003 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 E5FD737B401; Thu, 2 Jan 2003 13:52:38 -0800 (PST) Received: from jkh-gw.queasyweasel.com (adsl-64-173-3-158.dsl.sntc01.pacbell.net [64.173.3.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1773A43EA9; Thu, 2 Jan 2003 13:52:38 -0800 (PST) (envelope-from jkh@queasyweasel.com) Received: from queasyweasel.com (narcissus.freebsd.com [64.173.15.99]) by jkh-gw.queasyweasel.com (8.12.6/8.12.5) with ESMTP id h02LpsXW077912; Thu, 2 Jan 2003 13:51:55 -0800 (PST) (envelope-from jkh@queasyweasel.com) Date: Thu, 2 Jan 2003 13:52:36 -0800 Subject: Re: Reading rc.conf from C programs? Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) Cc: wgrim@siue.edu, phk@FreeBSD.ORG, kientzle@acm.org, freebsd-hackers@FreeBSD.ORG To: Terry Lambert From: Jordan K Hubbard In-Reply-To: <3E14B087.EC43701B@mindspring.com> Message-Id: <8183059A-1E9C-11D7-883C-000393BB9222@queasyweasel.com> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.551) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG You're somewhat mistaken if you think there was EVER any defined policy with respect to this, it was simply a shell configuration file that gained prominance as it went along, from its humble beginnings as /etc/sysconfig or whatever it was we called it back then. There was never any specific mandate that it be a key/value pair configuration variable database, that was simply a de-facto standard and one which was never clearly documented. In hindsight, if we'd really wanted a key/value pair database then we should have done it in XML and simply dealt with it at arm's length through a accessor utility, e.g. instead of: case ${ipsec_enable} in We'd have: case `sysconfig -r ipsec_enable` in Or something to that effect. If you're really looking for "the real solution" underlying this problem then you need to look past the format being used at the moment and at the fundamental problem it was originally trying to solve. - Jordan On Thursday, January 2, 2003, at 01:35 PM, Terry Lambert wrote: > wgrim@siue.edu wrote: >> Well, perhaps I'm missing something here, but can't you just tokenize >> the items >> in rc.conf using strtok after opening up the file in your C program? > > You are missing something. Someone violated policy, and put > shell code into rc.conf, instead of leaving it a name/value > pairs. > > -- Terry > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > -- Jordan K. Hubbard Engineering Manager, BSD technology group Apple Computer To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message