> From: Alan DeKok
> Sent: Sunday, 22 June 2003 9:48 AM

> Oliver Graf <[EMAIL PROTECTED]> wrote:
> > > > This patchs enables the detection of the correct
> > > > gethostby(name|addr)_r command, which is needed by a threaded radiusd.

>   Unless I'm greatly mistaken, that functionality was added many
> months ago.  See 'src/main/misc.c'

(That's src/lib/misc.c)

Currently this file uses gethostbyaddr{,_r} either BSD, GNU or SYSV
However, gethostbyname{,_r} is only using BSD or SYSV

> > > I haven't looked at the diffs though, so it may not be relevant.

> > For me its relevant. Without freeradius is not thread-safe.

>   But the server ALREADY uses the '..._r' functions.  What's the
> problem?  Or am I missing something?

The problems are:
gethostbyaddr_r determination will pick BSD (The non-_r version)
over GNU or SYSV. This is because the BSD version was added to configure
after the other two, and added _after_.

gethostbyname_r detection was backed out of configure (meaning only the
BSD (non-_r) version is used) because it was using a simple "Does
gethostbyname_r exist" test, at the link I posted earlier... and hence
not able to tell the difference between the SYSV and GNU versions.

However, problems with the patch:
the patch to src/lib/misc.c shows a cut and paste oversight by testing
GETHOSTBYADDRRSTYLE when choosing the gethostbyname_r function to call.

Oh, and when submitting patches to configure.in, I'd suggest submitting
the equivalent patch to configure. Otherwise if someone overlooks the
regeneration, it appears to not work for no apparent reason.

The rest looks OK. I'm going to apply it to my copy, try it out,
and commit it this evening barring problems.

--
=========================================================
Paul "TBBle" Hampson
Bubblesworth Pty Ltd (ABN: 51 095 284 361)
[EMAIL PROTECTED]

The Creation of the Universe was made
possible by a grant from Texas Instruments.
        -- PBS
---------------------------------------------------------
Random signature generator 3.0 by Paul "TBBle" Hampson
=========================================================


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to