Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Oct 2002 19:27:43 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Juli Mallett <jmallett@FreeBSD.org>
Cc:        Kris Kennaway <kris@obsecurity.org>, current@FreeBSD.org, alfred@FreeBSD.org
Subject:   Re: rpcgen dumping core
Message-ID:  <3DA8DA1F.886BEF21@mindspring.com>
References:  <20021012225839.GA96586@xor.obsecurity.org> <3DA8D1BA.D440D106@mindspring.com> <20021012191510.A39512@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DA8DA1F.886BEF21>