From owner-freebsd-current Sat Oct 12 19:29:25 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADBFB37B401; Sat, 12 Oct 2002 19:29:23 -0700 (PDT) Received: from conure.mail.pas.earthlink.net (conure.mail.pas.earthlink.net [207.217.120.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 443FC43EA9; Sat, 12 Oct 2002 19:29:23 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0069.cvx21-bradley.dialup.earthlink.net ([209.179.192.69] helo=mindspring.com) by conure.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 180YVN-0002eT-00; Sat, 12 Oct 2002 19:29:22 -0700 Message-ID: <3DA8DA1F.886BEF21@mindspring.com> Date: Sat, 12 Oct 2002 19:27:43 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Juli Mallett Cc: Kris Kennaway , current@FreeBSD.org, alfred@FreeBSD.org Subject: Re: rpcgen dumping core References: <20021012225839.GA96586@xor.obsecurity.org> <3DA8D1BA.D440D106@mindspring.com> <20021012191510.A39512@FreeBSD.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Juli Mallett wrote: > > The fix works by substituting "" for NULL before this happens, > > but *after* the output file names have been created, to avoid > > creating files with a bogus prefix name. > > Personally, I'd rather see it be: > if (infile == NULL) > infile = "-"; > > As that's how we tend to represent stdin, yes? The value represents the prefix value in the openlog(3) call in the generated code, as well as a prefix value for the name generation of the files. It is correct to not put a prefix value in there at all when using "stdin". The alternative is: openlog( "-", ...) and the name of the files beginning with "-", e.g.: -.h -_xdr.c -_svc.c -_clnt.c -_tbl.i IMO, that would be Bad(tm). Technically, it's bad mojo to use stdin as the input to rpcgen, unless you plan on hacking the resulting code anyway. Since the first crash is in the openlog/syslog generation code, I felt it was better to have an empty ident prefix value, than a bogus one. The resulting output naming conventions for everything end up the same as if the "-b" were specified, rather than core dumping. If you feel strongly about this, though, feel free to set the string to whatever bogus value you want, instead of the one that makes the output compatable with that before the change that broke things went in. The canonically correct fix would most likely be to: o Add a new "-p" option to specify the prefix value o Require the use of the "-p" when using stdin as the source for the rpcgen command o Refactor the code, so that the derivation of the prefix occurs only once, and the derived prefix is passed around, either from the "-p", or from the "infile", up to the rightmost period That's a lot of work for code that's probalby never going to be used in practice for most things, since "-b" will be required for backward compatability with previous versions of FreeBSD for, say, NFS. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message