This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author georg.brandl
Recipients georg.brandl, ulidtko
Date 2011-01-08.08:08:50
SpamBayes Score 1.1541309e-07
Marked as misclassified No
Message-id <1294474132.38.0.26837708115.issue10865@psf.upfronthosting.co.za>
In-reply-to
Content
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;
}
History
Date User Action Args
2011-01-08 08:08:52georg.brandlsetrecipients: + georg.brandl, ulidtko
2011-01-08 08:08:52georg.brandlsetmessageid: <1294474132.38.0.26837708115.issue10865@psf.upfronthosting.co.za>
2011-01-08 08:08:51georg.brandllinkissue10865 messages
2011-01-08 08:08:50georg.brandlcreate