diff --git a/ChangeLog b/ChangeLog index d2545b3..a7a64dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 0.5.0 ===== + 23-Nov-2003: - got the gethostbyname() failure problem solved. + (the resolver needs a shared lib that was tried + to load AFTER chrooting...) 22-Nov-2003: - utils.c: use gethostbyname_r() in favor of gethostbyname - if available (siproxd uses threads!) - some small items & cleanup diff --git a/src/utils.c b/src/utils.c index 77e7c46..d05f65d 100644 --- a/src/utils.c +++ b/src/utils.c @@ -233,6 +233,15 @@ void secure_enviroment (void) { * change root directory into chroot jail */ if (configuration.chrootjail) { + /* !!! + * Before chrooting I must at leat once trigger the resolver + * as it loads some dynamic libraries. Once chrootet + * these libraries will *not* be found and gethostbyname() + * calls will simply fail (return NULL pointer and h_errno=0). + * Took me a while to figure THIS one out + */ + struct in_addr dummy; + get_ip_by_host("foobar", &dummy); DEBUGC(DBCLASS_CONFIG,"chrooting to %s", configuration.chrootjail); sts = chroot(configuration.chrootjail);