From: Michael Tremer Date: Thu, 10 Mar 2011 10:42:01 +0000 (+0100) Subject: Change libc loading for personality function. X-Git-Tag: 0.9.3~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b5bdf43cb173d9ac51ebe6f57b0bd3a08b04795;p=pakfire.git Change libc loading for personality function. This caused a SEGV on the glibc that is in IPFire 2.x. --- diff --git a/pakfire/util.py b/pakfire/util.py index ad40a38ac..ced8ca01d 100644 --- a/pakfire/util.py +++ b/pakfire/util.py @@ -15,12 +15,8 @@ from errors import Error from packages.util import calc_hash1, format_size _libc = ctypes.cdll.LoadLibrary(None) -_errno = ctypes.c_int.in_dll(_libc, "errno") _libc.personality.argtypes = [ctypes.c_ulong] _libc.personality.restype = ctypes.c_int -_libc.unshare.argtypes = [ctypes.c_int,] -_libc.unshare.restype = ctypes.c_int -CLONE_NEWNS = 0x00020000 def cli_is_interactive(): """ @@ -192,7 +188,7 @@ class ChildPreExec(object): if self.personality: res = _libc.personality(self.personality) if res == -1: - raise OSError(_errno.value, os.strerror(_errno.value)) + raise OSError, "Could not set personality" # Change into new root. if self.chrootPath: