This patch will upgrade Sudo version 1.8.9 patchlevel 2 to Sudo version 1.8.9 patchlevel 3. To apply: $ cd sudo-1.8.9p2 $ patch -p1 < sudo-1.8.9p3.patch diff -urNa sudo-1.8.9p2/ChangeLog sudo-1.8.9p3/ChangeLog --- sudo-1.8.9p2/ChangeLog Mon Jan 13 07:10:59 2014 +++ sudo-1.8.9p3/ChangeLog Mon Jan 13 11:14:26 2014 @@ -1,3 +1,13 @@ +2014-01-13 Todd C. Miller + + * src/ttyname.c: + Fix strtonum() usage when parsing /proc/self/stat on Linux. Bug #630 + [3448dffe9701] + + * NEWS, configure, configure.ac: + Update for sudo 1.8.9p3 + [22e5a6f69999] + 2014-01-09 Todd C. Miller * NEWS, configure, configure.ac: diff -urNa sudo-1.8.9p2/NEWS sudo-1.8.9p3/NEWS --- sudo-1.8.9p2/NEWS Sat Jan 11 06:39:12 2014 +++ sudo-1.8.9p3/NEWS Mon Jan 13 11:12:10 2014 @@ -1,3 +1,8 @@ +What's new in Sudo 1.8.9p3? + + * Fixed a bug introduced in sudo 1.8.9 that prevented the tty name + from being resolved properly on Linux systems. Bug #630. + What's new in Sudo 1.8.9p2? * Updated config.guess, config.sub and libtool to support the ppc64le diff -urNa sudo-1.8.9p2/configure sudo-1.8.9p3/configure --- sudo-1.8.9p2/configure Sat Jan 11 06:39:13 2014 +++ sudo-1.8.9p3/configure Mon Jan 13 11:12:11 2014 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sudo 1.8.9p2. +# Generated by GNU Autoconf 2.69 for sudo 1.8.9p3. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='sudo' PACKAGE_TARNAME='sudo' -PACKAGE_VERSION='1.8.9p2' -PACKAGE_STRING='sudo 1.8.9p2' +PACKAGE_VERSION='1.8.9p3' +PACKAGE_STRING='sudo 1.8.9p3' PACKAGE_BUGREPORT='http://www.sudo.ws/bugs/' PACKAGE_URL='' @@ -1498,7 +1498,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.8.9p2 to adapt to many kinds of systems. +\`configure' configures sudo 1.8.9p3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1563,7 +1563,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sudo 1.8.9p2:";; + short | recursive ) echo "Configuration of sudo 1.8.9p3:";; esac cat <<\_ACEOF @@ -1793,7 +1793,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sudo configure 1.8.9p2 +sudo configure 1.8.9p3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2502,7 +2502,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.8.9p2, which was +It was created by sudo $as_me 1.8.9p3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -22766,7 +22766,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.8.9p2, which was +This file was extended by sudo $as_me 1.8.9p3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22832,7 +22832,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.8.9p2 +sudo config.status 1.8.9p3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urNa sudo-1.8.9p2/configure.ac sudo-1.8.9p3/configure.ac --- sudo-1.8.9p2/configure.ac Sat Jan 11 06:39:13 2014 +++ sudo-1.8.9p3/configure.ac Mon Jan 13 11:12:11 2014 @@ -4,7 +4,7 @@ dnl Copyright (c) 1994-1996,1998-2014 Todd C. Miller dnl AC_PREREQ([2.59]) -AC_INIT([sudo], [1.8.9p2], [http://www.sudo.ws/bugs/], [sudo]) +AC_INIT([sudo], [1.8.9p3], [http://www.sudo.ws/bugs/], [sudo]) AC_CONFIG_HEADER([config.h pathnames.h]) AC_CONFIG_SRCDIR([src/sudo.c]) dnl diff -urNa sudo-1.8.9p2/src/ttyname.c sudo-1.8.9p3/src/ttyname.c --- sudo-1.8.9p2/src/ttyname.c Tue Jan 7 11:09:03 2014 +++ sudo-1.8.9p3/src/ttyname.c Mon Jan 13 11:12:15 2014 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 Todd C. Miller + * Copyright (c) 2012-2014 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -441,10 +441,12 @@ if (len != -1) { /* Field 7 is the tty dev (0 if no tty) */ char *cp = line; + char *ep = line; const char *errstr; - int field = 1; - while (*cp != '\0') { - if (*cp++ == ' ') { + int field = 0; + while (*++ep != '\0') { + if (*ep == ' ') { + *ep = '\0'; if (++field == 7) { dev_t tdev = strtonum(cp, INT_MIN, INT_MAX, &errstr); if (errstr) { @@ -455,6 +457,7 @@ tty = sudo_ttyname_dev(tdev); break; } + cp = ep + 1; } } }