Final Suggestion (Re: suggested bsd-setproctitle.c)

Ben Lindstrom mouring at pconline.com
Wed Nov 8 17:01:23 EST 2000



On Tue, 7 Nov 2000, Mark D. Roth wrote:

> On Tue Nov 07 22:59 2000 -0600, Ben Lindstrom wrote:
> > I would perfer using basename() over strrchar() and NULL check.  Even it
> > it required me to snag basename() from the OpenBSD tree. (Which I was
> > happy to see compiled without any changes!! =)
> 
> The NULL check actually had nothing to do with strrchr() (although now
> that you mention it, I should have checked strrchr()'s result as
> well).  The real purpose was to make sure xstrdup() didn't fail
> because we're out of memory.  Admittedly, this is a very unprobable
> situation, but there might be problems if __progname is set to NULL
> later in the code.
> 

xstrdup() would fail during the xmalloc() call which would cause a
call to fatal() and it would quit.  So the check is really not
valid for that reason.  Which is why I figured you were doing it for
strrchr().  because xmalloc(0) is valid. 

> Also, I have encountered some fairly serious problems in the past with
> systems which have basename() calls that don't work properly.  The
> most notable example of this was Linux systems running early versions
> of glibc 2.0.  None of these bugs should affect the code we're talking
> about, but I'd feel a lot more comfortable if some folks with RedHat
> 6.0 systems could test it for us.  (All my Linux machines are at 6.1
> or 6.2 by now.)
> 
Noted.  And either it may have to go into an FAQ begging people to upgrade
at least their glibc or add in another sprintf() hack type check.

> Other than these nitpicks, it looks fine to me.  I'll actually test it
> once we have a bit more of a consensus. ;)
> 
I'm not going anywhere.=)  Bush is *BARELY* leading the presidental race,
and it's way too dang close.=)

- Ben






More information about the openssh-unix-dev mailing list