Package: sudo Version: 1.6.9p6-1 On a setup where the limit for open files is set to 1048576, sudo takes half a second to do the simplest task. The reason behind this is that at startup it closes all fds after the one associated with stderr, which makes 1048573 system calls.
There is code in sudo which looks for open fds in /dev/fd/, but the configure fails to detect that the libc has dirfd, and so sudo uses the dumb algorithm. Configure tries to compile this code, #include <sys/types.h> #include <dirent.h> int main () { DIR d; (void)dirfd(&d); ; return 0; } which fails because the glibc (at least in 2.6.1-1+b1) includes do not expose the structure of a DIR * (and there seems no reason to do so) I suggest the following patch be applied. (autoconf has to be rerun after this) --- Signed-off-by: Quentin Godfroy <[EMAIL PROTECTED]> --- configure.in.bak 2007-11-15 00:20:03.000000000 +0100 +++ configure.in 2007-11-15 00:20:54.000000000 +0100 @@ -1727,7 +1727,7 @@ dnl dnl Check for the dirfd function/macro. If not found, look for dd_fd in DIR. dnl AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> -#include <$ac_header_dirent>]], [[DIR d; (void)dirfd(&d);]])], [AC_DEFINE(HAVE_DIRFD)], [AC_TRY_LINK([#include <sys/types.h> +#include <$ac_header_dirent>]], [[DIR *d; (void)dirfd(d);]])], [AC_DEFINE(HAVE_DIRFD)], [AC_TRY_LINK([#include <sys/types.h> #include <$ac_header_dirent>], [DIR d; memset(&d, 0, sizeof(d)); return(d.dd_fd);], [AC_DEFINE(HAVE_DD_FD)])]) dnl dnl If NEED_SNPRINTF is set, add snprintf.c to LIBOBJS -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]