tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rpcgen with env variable CPP set to "cc -E"



der Mouse writes:
| Does this actually work?  Based on the manpage, popen() expects a shell
| command line as a single string, not the argv array you appear to be
| passing it.  Am I missing something?

I'm not passing an argv array, but a single string. I admit that I could
have renamed arglist into something else...
And yes, this string is leaked. There should be a call to clear_args()
before the final exit().

Also the pclose() should be called three time when rpcgen is invoked with
no flags (parses 3 times the input), but the fclose was already
missing in the current version and I wasn't 100% sure why.

| Furthermore, if you do construct a shell command, won't that lose when
| the filename in question contains shell metacharacters such as
| whitespace?  (This may not be enough of a problem in practice to nix
| the technique, but IMO should be loudly warned about in the relevant
| manpage.)

Yes that's true, I missed this one. Ideally the input file should be
passed through cpp's stdin. But I'm not sure if '-' as a filename can be
used in a standard way?

-- 
Anthony



Home | Main Index | Thread Index | Old Index