This patch will upgrade Sudo version 1.7.4 patchlevel 1 to Sudo version 1.7.4 patchlevel 2. To apply: $ cd sudo-1.7.4 $ patch -p1 < sudo-1.7.4p1.patch diff -urNa sudo-1.7.4p1/ChangeLog sudo-1.7.4p2/ChangeLog --- sudo-1.7.4p1/ChangeLog Fri Aug 6 10:12:53 2010 +++ sudo-1.7.4p2/ChangeLog Mon Aug 9 06:36:47 2010 @@ -1,9 +1,32 @@ +2010-08-09 Todd C. Miller + + * exec.c: + Fix waitpid() loop termination condition. + [97719b3259f2] + + * exec_pty.c: + Use sudo_waitpid() instead of bare waitpid() + [624a40269189] + +2010-08-07 Todd C. Miller + + * sudo.pp: + Set pp_kit_version and strip off patchlevel + [814c87778567] + + * sudo.pp: + Better handling of versions with a patchlevel. For rpm and deb, use + the patchlevel+1 as the release. For AIX, use the patchlevel as the + 4th version number. For the rest, just leave the patchlevel in the + version string. + [d18ef30f0a72] + 2010-08-06 Todd C. Miller * check.c: When removing/resetting the timestamp file ignore the tty ticket contents. - [8b285f601ec0] [tip] + [8b285f601ec0] 2010-08-04 Todd C. Miller diff -urNa sudo-1.7.4p1/configure sudo-1.7.4p2/configure --- sudo-1.7.4p1/configure Fri Aug 6 10:17:57 2010 +++ sudo-1.7.4p2/configure Mon Aug 9 06:35:37 2010 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for sudo 1.7.4p1. +# Generated by GNU Autoconf 2.65 for sudo 1.7.4p2. # # Report bugs to . # @@ -701,8 +701,8 @@ # Identity of this package. PACKAGE_NAME='sudo' PACKAGE_TARNAME='sudo' -PACKAGE_VERSION='1.7.4p1' -PACKAGE_STRING='sudo 1.7.4p1' +PACKAGE_VERSION='1.7.4p2' +PACKAGE_STRING='sudo 1.7.4p2' PACKAGE_BUGREPORT='http://www.sudo.ws/bugs/' PACKAGE_URL='' @@ -1552,7 +1552,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sudo 1.7.4p1 to adapt to many kinds of systems. +\`configure' configures sudo 1.7.4p2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1617,7 +1617,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sudo 1.7.4p1:";; + short | recursive ) echo "Configuration of sudo 1.7.4p2:";; esac cat <<\_ACEOF @@ -1828,7 +1828,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sudo configure 1.7.4p1 +sudo configure 1.7.4p2 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2527,7 +2527,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sudo $as_me 1.7.4p1, which was +It was created by sudo $as_me 1.7.4p2, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -18977,7 +18977,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sudo $as_me 1.7.4p1, which was +This file was extended by sudo $as_me 1.7.4p2, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19043,7 +19043,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sudo config.status 1.7.4p1 +sudo config.status 1.7.4p2 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" diff -urNa sudo-1.7.4p1/configure.in sudo-1.7.4p2/configure.in --- sudo-1.7.4p1/configure.in Fri Aug 6 10:17:26 2010 +++ sudo-1.7.4p2/configure.in Mon Aug 9 06:35:22 2010 @@ -3,7 +3,7 @@ dnl dnl Copyright (c) 1994-1996,1998-2010 Todd C. Miller dnl -AC_INIT([sudo], [1.7.4p1], [http://www.sudo.ws/bugs/], [sudo]) +AC_INIT([sudo], [1.7.4p2], [http://www.sudo.ws/bugs/], [sudo]) AC_CONFIG_HEADER(config.h pathnames.h) dnl dnl This won't work before AC_INIT diff -urNa sudo-1.7.4p1/exec.c sudo-1.7.4p2/exec.c --- sudo-1.7.4p1/exec.c Fri Jul 30 11:58:54 2010 +++ sudo-1.7.4p2/exec.c Mon Aug 9 06:37:11 2010 @@ -260,21 +260,22 @@ #else pid = wait(&status); #endif - if (pid == child) { - if (!log_io) { - if (WIFSTOPPED(status)) { - /* Child may not have privs to suspend us itself. */ - kill(getpid(), WSTOPSIG(status)); - } else { - /* Child has exited, we are done. */ - cstat->type = CMD_WSTATUS; - cstat->val = status; - return 0; - } + } while (pid == -1 && errno == EINTR); + if (pid == child) { + /* If not logging I/O and child has exited we are done. */ + if (!log_io) { + if (WIFSTOPPED(status)) { + /* Child may not have privs to suspend us itself. */ + kill(getpid(), WSTOPSIG(status)); + } else { + /* Child has exited, we are done. */ + cstat->type = CMD_WSTATUS; + cstat->val = status; + return 0; } - /* Else we get ECONNRESET on sv[0] if child dies. */ } - } while (pid != -1 || errno == EINTR); + /* Else we get ECONNRESET on sv[0] if child dies. */ + } } zero_bytes(fdsw, howmany(maxfd + 1, NFDBITS) * sizeof(fd_mask)); diff -urNa sudo-1.7.4p1/exec_pty.c sudo-1.7.4p2/exec_pty.c --- sudo-1.7.4p1/exec_pty.c Fri Aug 6 09:44:30 2010 +++ sudo-1.7.4p2/exec_pty.c Mon Aug 9 06:37:01 2010 @@ -653,7 +653,11 @@ /* read child status */ do { - pid = waitpid(child, &status, WUNTRACED|WNOHANG); +#ifdef sudo_waitpid + pid = sudo_waitpid(child, &status, WUNTRACED|WNOHANG); +#else + pid = wait(&status); +#endif } while (pid == -1 && errno == EINTR); if (pid == child) { if (cstat->type != CMD_ERRNO) { diff -urNa sudo-1.7.4p1/sudo.pp sudo-1.7.4p2/sudo.pp --- sudo-1.7.4p1/sudo.pp Fri Aug 6 10:36:01 2010 +++ sudo-1.7.4p2/sudo.pp Sat Aug 7 15:39:06 2010 @@ -13,18 +13,30 @@ still allow people to get their work done." vendor="Todd C. Miller" copyright="(c) 1993-1996,1998-2010 Todd C. Miller" - version="1.7.4" - pp_rpm_release="2" + + # Convert to 4 part version for AIX, including patch level + pp_aix_version=`echo $version|sed -e 's/\([0-9]*\.[0-9]*\.[0-9]*\)$/\1.0/' -e 's/[^0-9]*\([0-9]*\)$/.\1/'` + + # Strip of patchlevel for kit which only supports x.y.z versions + pp_kit_version="`echo $version|sed -e 's/\.//g' -e 's/p[0-9]*$//'`" + pp_kit_name="TCM" + + pp_sd_vendor_tag="TCM" + pp_solaris_name="TCM${name}" +%if [rpm,deb] + # Convert patch level into release and remove from version + pp_rpm_release="`echo $version|sed 's/^[0-9]*\.[0-9]*\.[0-9]*[^0-9]*//'`" + pp_rpm_release="`expr $pp_rpm_release + 1`" + pp_rpm_version="`echo $version|sed 's/p[0-9]*$//'`" pp_rpm_license="BSD" pp_rpm_url="http://www.sudo.ws/" pp_rpm_group="Applications/System" pp_rpm_packager="Todd.Miller@courtesan.com" - pp_deb_maintainer="Todd.Miller@courtesan.com" - pp_deb_release="2" - pp_sd_vendor_tag="TCM" - pp_kit_name="TCM" - pp_solaris_name="TCM${name}" -%if [!rpm,deb] + + pp_deb_maintainer="$pp_rpm_packager" + pp_deb_release="$pp_rpm_release" + pp_deb_version="$pp_rpm_version" +%else # For all but RPM and Debian we need to install sudoers with a different # name and make a copy of it if there is no existing file. mv ${pp_destdir}$sudoersdir/sudoers ${pp_destdir}$sudoersdir/sudoers.dist @@ -68,8 +80,8 @@ # For RedHat the doc dir is expected to include version and release case "$pp_rpm_distro" in centos*|rhel*) - mv ${pp_destdir}/${docdir} ${pp_destdir}/${docdir}-${version}-1 - docdir=${docdir}-${version}-1 + mv ${pp_destdir}/${docdir} ${pp_destdir}/${docdir}-${version}-${pp_rpm_release} + docdir=${docdir}-${version}-${pp_rpm_release} ;; esac