[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#4099) test008 throws assertion

> Yes, apparently libwrap uses strtok() which is not thread-safe. I'm not

I'm not sure if we can get libwrap changed to strtok_r without making
hosts_ctl_r with it. Probably not an easy sell.

In tcp_wrappers there's a preprocessor define "LIBC_CALLS_STRTOK," which
apparently is enabled by default. It implements "my_strtok" in terms of
strspn/strcspn, but also has "static char *state" which probably isn't
good for reentrancy. Since libwrap is only called in the very limited area
of daemon.c, I think a mutex wrap might be sufficient in slapd's case.
I'll try to get a repro environment and then see if throwing in a
HAVE_TCPD mutex helps, unless somebody objects/has a better idea?