- got the gethostbyname() failure problem solved.

(the resolver needs a shared lib that was tried
  to load AFTER chrooting...)
This commit is contained in:
Thomas Ries 2003-11-23 08:58:17 +00:00
parent 00dfe93a0d
commit 4f96757513
2 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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);