Hm, this is minor, but I notice that Ns_DriverInit() calls the
(non-thread-safe) gethostbyname() and gethostbyaddr() directly:

  $ find . -name "*.c" -print | xargs egrep -n '(gethostbyname|gethostbyaddr)'
  ./driver.c:261:        he = gethostbyname(host ? host : Ns_InfoHostname());
  ./driver.c:274:            he = gethostbyaddr(he->h_addr, he->h_length, 
he->h_addrtype);

SF bug #1008721 (closed since 2004) says that's ok, no danger:

  
http://sourceforge.net/tracker/index.php?func=detail&aid=1008721&group_id=3152&atid=103152

  AOLserver uses gethostbyname() in two places - once
  in nsd/driver.c at server start-up, which is safe since
  we're only running one thread in the config interp at
  that time.

But, why call these non-thread-safe functions there, rather than
Ns_GetAddrByHost() and Ns_GetHostByAddr()?

Alos, if we do keep the use of gethostbyname(), ideally someone would
add a comment saying why, and that it's safe, like Dossy explained in
that old ticket.

-- 
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to