diff -ur Python-2.6.2/Modules/posixmodule.c Python-2.6.2-res/Modules/posixmodule.c --- Python-2.6.2/Modules/posixmodule.c 2009-04-06 01:47:37.000000000 -0500 +++ Python-2.6.2-res/Modules/posixmodule.c 2009-09-17 13:15:49.000000000 -0500 @@ -8351,6 +8351,84 @@ } #endif +#ifdef HAVE_SETRESUID +PyDoc_STRVAR(posix_setresuid__doc__, +"setresuid(ruid, euid, suid)\n\n\ +Set the current process's real, effective, and saved user ids."); + +static PyObject* +posix_setresuid (PyObject *self, PyObject *args) +{ + int ruid, euid, suid; + if (!PyArg_ParseTuple(args, "iii", &ruid, &euid, &suid)) + return NULL; + if (setresuid(ruid, euid, suid) < 0) + return posix_error(); + Py_INCREF(Py_None); + return Py_None; +} +#endif + +#ifdef HAVE_SETRESGID +PyDoc_STRVAR(posix_setresgid__doc__, +"setresgid(rgid, egid, sgid)\n\n\ +Set the current process's real, effective, and saved group ids."); + +static PyObject* +posix_setresgid (PyObject *self, PyObject *args) +{ + int rgid, egid, sgid; + if (!PyArg_ParseTuple(args, "iii", &rgid, &egid, &sgid)) + return NULL; + if (setresgid(rgid, egid, sgid) < 0) { + return posix_error(); + Py_INCREF(Py_None); + return Py_None; +} +#endif + +#ifdef HAVE_GETRESUID +PyDoc_STRVAR(posix_getresuid__doc__, +"getresuid() -> (ruid, euid, sgid)\n\n\ +Get tuple of the current process's real, effective, and saved user ids."); + +static PyObject* +posix_getresuid (PyObject *self, PyObject *noargs) +{ + int ruid, euid, suid; + n = getresuid(&ruid, &euid, &suid); + if (n < 0) + posix_error(); + } else { + return PyTuple_Pack(3, + PyInt_FromLong((long)ruid), + PyInt_FromLong((long)euid), + PyInt_FromLong((long)suid)); + } +} +#endif + +#ifdef HAVE_GETRESGID +PyDoc_STRVAR(posix_getresgid__doc__, +"getresgid() -> (rgid, egid, sgid)\n\n\ +Get tuple of the current process's real, effective, and saved user ids."); + +static PyObject* +posix_getresgid (PyObject *self, PyObject *noargs) +{ + int rgid, egid, sgid; + n = getresgid(&rgid, &egid, &sgid); + if (n < 0) + posix_error(); + } else { + return PyTuple_Pack(3, + PyInt_FromLong((long)rgid), + PyInt_FromLong((long)egid), + PyInt_FromLong((long)sgid)); + } +} +#endif + static PyMethodDef posix_methods[] = { {"access", posix_access, METH_VARARGS, posix_access__doc__}, #ifdef HAVE_TTYNAME @@ -8661,6 +8739,19 @@ #ifdef __VMS {"urandom", vms_urandom, METH_VARARGS, vms_urandom__doc__}, #endif +#ifdef HAVE_SETRESUID + {"setresuid", posix_setresuid, METH_VARARGS, posix_setresuid__doc__), +#endif +#ifdef HAVE_SETRESGID + {"setresgid", posix_setresgid, METH_VARARGS, posix_setresgid__doc__), +#endif +#ifdef HAVE_GETRESUID + {"getresuid", posix_getresuid, METH_VARARGS, posix_getresuid__doc__), +#endif +#ifdef HAVE_GETRESGID + {"getresgid", posix_getresgid, METH_VARARGS, posix_getresgid__doc__), +#endif + {NULL, NULL} /* Sentinel */ }; Only in Python-2.6.2-res: autom4te.cache diff -ur Python-2.6.2/configure Python-2.6.2-res/configure --- Python-2.6.2/configure 2009-03-30 12:56:14.000000000 -0500 +++ Python-2.6.2-res/configure 2009-09-17 13:16:53.000000000 -0500 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 68599 . +# From configure.in Revision: 70731 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -16183,15 +16183,20 @@ + + + + for ac_func in alarm setitimer getitimer bind_textdomain_codeset chown \ clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \ - getpriority getpwent getspnam getspent getsid getwd \ + getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \ kill killpg lchmod lchown lstat mkfifo mknod mktime \ mremap nice pathconf pause plock poll pthread_init \ putenv readlink realpath \ select setegid seteuid setgid \ - setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \ + setlocale setregid setreuid setresuid setresgid \ + setsid setpgid setpgrp setuid setvbuf snprintf \ sigaction siginterrupt sigrelse strftime \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll _getpty diff -ur Python-2.6.2/configure.in Python-2.6.2-res/configure.in --- Python-2.6.2/configure.in 2009-03-30 12:56:14.000000000 -0500 +++ Python-2.6.2-res/configure.in 2009-09-17 13:12:04.000000000 -0500 @@ -2457,12 +2457,13 @@ AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \ clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \ - getpriority getpwent getspnam getspent getsid getwd \ + getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \ kill killpg lchmod lchown lstat mkfifo mknod mktime \ mremap nice pathconf pause plock poll pthread_init \ putenv readlink realpath \ select setegid seteuid setgid \ - setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \ + setlocale setregid setreuid setresuid setresgid \ + setsid setpgid setpgrp setuid setvbuf snprintf \ sigaction siginterrupt sigrelse strftime \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll _getpty)