On Wed, Aug 20, 2014 at 08:03:51PM -0400, Ted Unangst wrote: > On Wed, Aug 20, 2014 at 14:10, Alexander Bluhm wrote: > > CVSROOT: /cvs > > Module name: src > > Changes by: [email protected] 2014/08/20 14:10:17 > > > > Modified files: > > usr.sbin/syslogd: privsep.c syslogd.c syslogd.h > > > > Log message: > > Replace gethostbyaddr(3) with getnameinfo(3). Remove the sigprocmask() > > that was necessary for gethostbyaddr() because the latter is not > > signal safe. Change the return code semantics of priv_getnameinfo() > > to match getnameinfo(3). > > input and OK jca@ > > The man page for getnameinfo says getnameinfo is not thread safe, > which almost guarantees it is not signal safe either.
That is right, almost nothing is signal safe. When sigprocmask(2) was added, there was a gethostbyaddr(3) in the code to protect. Now getnameinfo(3) is running in a separate prevsep process. All signal handlers set integer flags or do a simple waitpid(2) as calling privsep functions is not signal safe either. So I think my change is safe. bluhm
