Message125759
This is not a bug in Python: name resolution may not work in the chroot unless you add the libraries that are loaded on the fly by the libc.
It *may* also work if you make one name resolution (using socket.getaddressinfo for example) *before* chrooting.
To demonstrate that Python is not involved, you can reproduce the failure with the C program below.
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h>
int main() {
int res;
struct addrinfo *ai;
if ((res = chroot("/tmp")) < 0) {
printf("chroot failed with errno %d\n", -res);
} else if ((res = getaddrinfo("google.de", "80", NULL, &ai)) < 0) {
printf("getaddrinfo failed with errno %d: %s\n",
-res, gai_strerror(res));
}
return 0;
} |
|
Date |
User |
Action |
Args |
2011-01-08 08:08:52 | georg.brandl | set | recipients:
+ georg.brandl, ulidtko |
2011-01-08 08:08:52 | georg.brandl | set | messageid: <1294474132.38.0.26837708115.issue10865@psf.upfronthosting.co.za> |
2011-01-08 08:08:51 | georg.brandl | link | issue10865 messages |
2011-01-08 08:08:50 | georg.brandl | create | |
|