This patch will upgrade Sudo version 1.7.2 patchlevel 1 to Sudo version 1.7.2 patchlevel 2. To apply: $ cd sudo-1.7.2p1 $ patch -p1 < sudo-1.7.2p2.patch diff -urNa sudo-1.7.2p1/ChangeLog sudo-1.7.2p2/ChangeLog --- sudo-1.7.2p1/ChangeLog Tue Jul 28 14:59:05 2009 +++ sudo-1.7.2p2/ChangeLog Tue Nov 24 20:52:46 2009 @@ -1,3 +1,75 @@ +2009-11-23 10:56 millert + + * match.c: cmnd_matches() already deals with negation so + _cmndlist_matches() does not need to do so itself. Fixes a bug + with negated entries in a Cmnd_List. + +2009-11-22 11:12 millert + + * sudo.c: Don't exit() from open_sudoers, just return NULL for all + errors. + +2009-11-22 09:54 millert + + * toke.c, toke.l: Add missing extern def for parse_error + +2009-11-20 19:11 millert + + * toke.c, toke.l: Avoid a parse error when #includedir doesn't find + any files. Closes bug #375 + +2009-11-20 19:03 millert + + * Makefile.in: Include sudo.man.pl and sudoers.man.pl in the + distribution tarball. + +2009-11-04 09:42 millert + + * configure, configure.in: Fix a few typos in the descriptions; + from Jeff Makey Only do the check for + krb5_get_init_creds_opt_free() taking two arguments if we find + krb5_get_init_creds_opt_alloc(). Otherwise we will get a false + positive when using our own krb5_get_init_creds_opt_free which + takes only a single argument. + +2009-11-03 09:58 millert + + * configure, configure.in: Remove a spurious comma in the kerb5 + bits. + +2009-11-03 09:51 millert + + * auth/kerb5.c: Call krb5_get_init_creds_opt_init() in our emulated + krb5_get_init_creds_opt_alloc() for MIT kerberos. + +2009-09-30 09:50 millert + + * sudo_edit.c: Always update the stashed mtime of the temp file + instead of using what we have for the original because the time + resolution of the filesystem the temporary is on may not match + that of the filesystem that holds the original. Should fix bz + #371 found by Philippe Levan. + +2009-09-24 21:11 millert + + * configure, configure.in, sudoers.man.pl, sudoers.pod: Substitute + in default value for secure_path + +2009-09-24 20:31 millert + + * sudo.pod: Mention that the password must be followed by a newline + with the -S option. + +2009-08-07 10:21 millert + + * auth/pam.c: Set PAM_RUSER and PAM_RHOST early so they can be used + during authentication. Based on a patch from Jamie Beverly. + +2009-08-07 09:25 millert + + * match.c: Close dir before returning if strlcpy() reports + overflow. From Martynas Venckus. + 2009-07-18 09:55 millert * toke.c, toke.l: Fix expansion of %h in #include names. Fixes diff -urNa sudo-1.7.2p1/Makefile.in sudo-1.7.2p2/Makefile.in --- sudo-1.7.2p1/Makefile.in Mon Jun 15 17:18:53 2009 +++ sudo-1.7.2p2/Makefile.in Tue Nov 24 20:42:00 2009 @@ -153,7 +153,7 @@ sudo.man.in sudo.pod sudo.psf sudo_usage.h.in sudoers sudoers.cat \ sudoers.man.in sudoers.pod sudoers.ldap.cat sudoers.ldap.man.in \ sudoers.ldap.pod sudoers2ldif visudo.cat visudo.man.in visudo.pod \ - auth/API + auth/API sudo.man.pl sudoers.man.pl BINFILES= ChangeLog HISTORY LICENSE README TROUBLESHOOTING \ UPGRADE install-sh mkinstalldirs sample.syslog.conf sample.sudoers \ diff -urNa sudo-1.7.2p1/auth/kerb5.c sudo-1.7.2p2/auth/kerb5.c --- sudo-1.7.2p1/auth/kerb5.c Sun Nov 9 09:13:13 2008 +++ sudo-1.7.2p2/auth/kerb5.c Mon Nov 23 19:59:27 2009 @@ -54,7 +54,7 @@ #include "sudo_auth.h" #ifndef lint -__unused static const char rcsid[] = "$Sudo: kerb5.c,v 1.36 2008/11/09 14:13:13 millert Exp $"; +__unused static const char rcsid[] = "$Sudo: kerb5.c,v 1.37 2009/11/03 14:51:20 millert Exp $"; #endif /* lint */ #ifdef HAVE_HEIMDAL @@ -81,6 +81,7 @@ krb5_get_init_creds_opt **opts; { *opts = emalloc(sizeof(krb5_get_init_creds_opt)); + krb5_get_init_creds_opt_init(*opts); return 0; } diff -urNa sudo-1.7.2p1/auth/pam.c sudo-1.7.2p2/auth/pam.c --- sudo-1.7.2p1/auth/pam.c Mon May 25 08:02:42 2009 +++ sudo-1.7.2p2/auth/pam.c Mon Nov 23 19:59:27 2009 @@ -73,7 +73,7 @@ #endif #ifndef lint -__unused static const char rcsid[] = "$Sudo: pam.c,v 1.68 2009/05/25 12:02:42 millert Exp $"; +__unused static const char rcsid[] = "$Sudo: pam.c,v 1.69 2009/08/07 14:21:51 millert Exp $"; #endif /* lint */ static int sudo_conv __P((int, PAM_CONST struct pam_message **, @@ -105,7 +105,15 @@ log_error(USE_ERRNO|NO_EXIT|NO_MAIL, "unable to initialize PAM"); return(AUTH_FATAL); } + /* + * Set PAM_RUSER to the invoking user (the "from" user). + * We set PAM_RHOST to avoid a bug in Solaris 7 and below. + */ + (void) pam_set_item(pamh, PAM_RUSER, user_name); + (void) pam_set_item(pamh, PAM_RHOST, user_host); + + /* * Some versions of pam_lastlog have a bug that * will cause a crash if PAM_TTY is not set so if * there is no tty, set PAM_TTY to the empty string. @@ -203,13 +211,10 @@ pam_init(pw, NULL, NULL); /* - * Set PAM_USER to the user we are changing *to* and - * set PAM_RUSER to the user we are coming *from*. - * We set PAM_RHOST to avoid a bug in Solaris 7 and below. + * Update PAM_USER to reference the user we are running the command + * as, as opposed to the user we authenticated as. */ (void) pam_set_item(pamh, PAM_USER, pw->pw_name); - (void) pam_set_item(pamh, PAM_RUSER, user_name); - (void) pam_set_item(pamh, PAM_RHOST, user_host); /* * Set credentials (may include resource limits, device ownership, etc). diff -urNa sudo-1.7.2p1/configure sudo-1.7.2p2/configure --- sudo-1.7.2p1/configure Mon Jul 20 09:34:39 2009 +++ sudo-1.7.2p2/configure Tue Nov 24 20:57:27 2009 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for sudo 1.7.2p1. +# Generated by GNU Autoconf 2.61 for sudo 1.7.2p2. # # Report bugs to . # @@ -724,8 +724,8 @@ # Identity of this package. PACKAGE_NAME='sudo' PACKAGE_TARNAME='sudo' -PACKAGE_VERSION='1.7.2p1' -PACKAGE_STRING='sudo 1.7.2p1' +PACKAGE_VERSION='1.7.2p2' +PACKAGE_STRING='sudo 1.7.2p2' PACKAGE_BUGREPORT='http://www.sudo.ws/bugs/' # Factoring default headers for most tests. @@ -869,6 +869,7 @@ ldap_secret nsswitch_conf netsvc_conf +secure_path EGREPPROG CC ac_ct_CC @@ -1416,7 +1417,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.2p1 to adapt to many kinds of systems. +\`configure' configures sudo 1.7.2p2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1481,7 +1482,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sudo 1.7.2p1:";; + short | recursive ) echo "Configuration of sudo 1.7.2p2:";; esac cat <<\_ACEOF @@ -1683,7 +1684,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sudo configure 1.7.2p1 +sudo configure 1.7.2p2 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1697,7 +1698,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.2p1, which was +It was created by sudo $as_me 1.7.2p2, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2122,6 +2123,7 @@ + timeout=5 password_timeout=5 sudo_umask=0022 @@ -2147,6 +2149,7 @@ insults=off root_sudo=on path_info=on +secure_path="not set" INSTALL_NOEXEC= devdir='$(srcdir)' PROGS="sudo visudo" @@ -3695,12 +3698,14 @@ # Check whether --with-secure-path was given. if test "${with_secure_path+set}" = set; then withval=$with_secure_path; case $with_secure_path in - yes) cat >>confdefs.h <<_ACEOF -#define SECURE_PATH "/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc" + yes) with_secure_path="/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc" + cat >>confdefs.h <<_ACEOF +#define SECURE_PATH "$with_secure_path" _ACEOF - { echo "$as_me:$LINENO: result: :/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc" >&5 -echo "${ECHO_T}:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc" >&6; } + { echo "$as_me:$LINENO: result: $with_secure_path" >&5 +echo "${ECHO_T}$with_secure_path" >&6; } + secure_path="set to $with_secure_path" ;; no) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } @@ -3711,6 +3716,7 @@ { echo "$as_me:$LINENO: result: $with_secure_path" >&5 echo "${ECHO_T}$with_secure_path" >&6; } + secure_path="set to F<$with_secure_path>" ;; esac else @@ -6262,7 +6268,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6265 "configure"' > conftest.$ac_ext + echo '#line 6271 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8126,11 +8132,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8129: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8135: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8133: \$? = $ac_status" >&5 + echo "$as_me:8139: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8416,11 +8422,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8419: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8425: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8423: \$? = $ac_status" >&5 + echo "$as_me:8429: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8520,11 +8526,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8523: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8529: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8527: \$? = $ac_status" >&5 + echo "$as_me:8533: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10880,7 +10886,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 echo "${ECHO_T}$ac_cv_lib_krb5support_main" >&6; } if test $ac_cv_lib_krb5support_main = yes; then - SUDO_LIBS="${SUDO_LIBS} -lkrb5support," + SUDO_LIBS="${SUDO_LIBS} -lkrb5support" fi @@ -21535,8 +21541,7 @@ LIBS="${LIBS} ${SUDO_LIBS}" - -for ac_func in krb5_verify_user krb5_init_secure_context krb5_get_init_creds_opt_alloc +for ac_func in krb5_verify_user krb5_init_secure_context do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -21629,13 +21634,104 @@ fi done - { echo "$as_me:$LINENO: checking whether krb5_get_init_creds_opt_free takes a two argument2" >&5 -echo $ECHO_N "checking whether krb5_get_init_creds_opt_free takes a two argument2... $ECHO_C" >&6; } + +for ac_func in krb5_get_init_creds_opt_alloc +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + + { echo "$as_me:$LINENO: checking whether krb5_get_init_creds_opt_free takes a context" >&5 +echo $ECHO_N "checking whether krb5_get_init_creds_opt_free takes a context... $ECHO_C" >&6; } if test "${sudo_cv_krb5_get_init_creds_opt_free_two_args+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -21645,11 +21741,7 @@ int main () { - - krb5_context context = NULL; - krb5_get_init_creds_opt *opts = NULL; - krb5_get_init_creds_opt_free(context, opts); - +krb5_get_init_creds_opt_free(NULL, NULL); ; return 0; } @@ -21686,6 +21778,10 @@ fi { echo "$as_me:$LINENO: result: $sudo_cv_krb5_get_init_creds_opt_free_two_args" >&5 echo "${ECHO_T}$sudo_cv_krb5_get_init_creds_opt_free_two_args" >&6; } + +fi +done + if test X"$sudo_cv_krb5_get_init_creds_opt_free_two_args" = X"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS 1 @@ -24462,7 +24558,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.2p1, which was +This file was extended by sudo $as_me 1.7.2p2, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -24511,7 +24607,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -sudo config.status 1.7.2p1 +sudo config.status 1.7.2p2 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -24833,6 +24929,7 @@ ldap_secret!$ldap_secret$ac_delim nsswitch_conf!$nsswitch_conf$ac_delim netsvc_conf!$netsvc_conf$ac_delim +secure_path!$secure_path$ac_delim EGREPPROG!$EGREPPROG$ac_delim CC!$CC$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim @@ -24868,7 +24965,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 41; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 42; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff -urNa sudo-1.7.2p1/configure.in sudo-1.7.2p2/configure.in --- sudo-1.7.2p1/configure.in Mon Jul 20 09:34:37 2009 +++ sudo-1.7.2p2/configure.in Tue Nov 24 20:55:34 2009 @@ -4,7 +4,7 @@ dnl dnl Copyright (c) 1994-1996,1998-2009 Todd C. Miller dnl -AC_INIT([sudo], [1.7.2p1], [http://www.sudo.ws/bugs/], [sudo]) +AC_INIT([sudo], [1.7.2p2], [http://www.sudo.ws/bugs/], [sudo]) AC_CONFIG_HEADER(config.h pathnames.h) dnl dnl This won't work before AC_INIT @@ -85,6 +85,7 @@ AC_SUBST(ldap_secret) AC_SUBST(nsswitch_conf) AC_SUBST(netsvc_conf) +AC_SUBST(secure_path) dnl dnl Initial values for above dnl @@ -113,6 +114,7 @@ insults=off root_sudo=on path_info=on +secure_path="not set" INSTALL_NOEXEC= devdir='$(srcdir)' dnl @@ -988,13 +990,16 @@ AC_MSG_CHECKING(whether to override the user's path) AC_ARG_WITH(secure-path, [AS_HELP_STRING([--with-secure-path], [override the user's path with a built-in one])], [case $with_secure_path in - yes) AC_DEFINE_UNQUOTED(SECURE_PATH, "/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc") - AC_MSG_RESULT([:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc]) + yes) with_secure_path="/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc" + AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path") + AC_MSG_RESULT([$with_secure_path]) + secure_path="set to $with_secure_path" ;; no) AC_MSG_RESULT(no) ;; *) AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path") AC_MSG_RESULT([$with_secure_path]) + secure_path="set to F<$with_secure_path>" ;; esac], AC_MSG_RESULT(no)) @@ -2234,25 +2239,23 @@ ], [ AC_MSG_RESULT(no) SUDO_LIBS="${SUDO_LIBS} -lkrb5 -lk5crypto -lcom_err" - AC_CHECK_LIB(krb5support, main, [SUDO_LIBS="${SUDO_LIBS} -lkrb5support,"]) + AC_CHECK_LIB(krb5support, main, [SUDO_LIBS="${SUDO_LIBS} -lkrb5support"]) ]) AUTH_OBJS="$AUTH_OBJS kerb5.o" _LIBS="$LIBS" LIBS="${LIBS} ${SUDO_LIBS}" - AC_CHECK_FUNCS(krb5_verify_user krb5_init_secure_context krb5_get_init_creds_opt_alloc) - AC_CACHE_CHECK(whether krb5_get_init_creds_opt_free takes a two argument2, - sudo_cv_krb5_get_init_creds_opt_free_two_args, [ - AC_TRY_COMPILE([#include ], - [ - krb5_context context = NULL; - krb5_get_init_creds_opt *opts = NULL; - krb5_get_init_creds_opt_free(context, opts); - ], - [sudo_cv_krb5_get_init_creds_opt_free_two_args=yes], - [sudo_cv_krb5_get_init_creds_opt_free_two_args=no] - ) - ] - ) + AC_CHECK_FUNCS(krb5_verify_user krb5_init_secure_context) + AC_CHECK_FUNCS(krb5_get_init_creds_opt_alloc, [ + AC_CACHE_CHECK([whether krb5_get_init_creds_opt_free takes a context], + sudo_cv_krb5_get_init_creds_opt_free_two_args, [ + AC_TRY_COMPILE([#include ], + [krb5_get_init_creds_opt_free(NULL, NULL);], + [sudo_cv_krb5_get_init_creds_opt_free_two_args=yes], + [sudo_cv_krb5_get_init_creds_opt_free_two_args=no] + ) + ] + ) + ]) if test X"$sudo_cv_krb5_get_init_creds_opt_free_two_args" = X"yes"; then AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS) fi @@ -2663,7 +2666,7 @@ AH_TEMPLATE(HAVE_KERB4, [Define to 1 if you use Kerberos IV.]) AH_TEMPLATE(HAVE_KERB5, [Define to 1 if you use Kerberos V.]) AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC, [Define to 1 if you have the `krb5_get_init_creds_opt_alloc' function.]) -AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS, [Define to 1 if your `krb5_get_init_creds_opt_alloc' function takes two arguments.]) +AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS, [Define to 1 if your `krb5_get_init_creds_opt_free' function takes two arguments.]) AH_TEMPLATE(HAVE_KRB5_INIT_SECURE_CONTEXT, [Define to 1 if you have the `krb5_init_secure_context' function.]) AH_TEMPLATE(HAVE_KRB5_VERIFY_USER, [Define to 1 if you have the `krb5_verify_user' function.]) AH_TEMPLATE(HAVE_LBER_H, [Define to 1 if your LDAP needs . (OpenLDAP does not)]) diff -urNa sudo-1.7.2p1/match.c sudo-1.7.2p2/match.c --- sudo-1.7.2p1/match.c Tue May 26 20:49:07 2009 +++ sudo-1.7.2p2/match.c Mon Nov 23 19:59:27 2009 @@ -94,7 +94,7 @@ #endif /* USING_NONUNIX_GROUPS */ #ifndef lint -__unused static const char rcsid[] = "$Sudo: match.c,v 1.46 2009/05/27 00:49:07 millert Exp $"; +__unused static const char rcsid[] = "$Sudo: match.c,v 1.48 2009/11/23 15:56:14 millert Exp $"; #endif /* lint */ static struct member_list empty; @@ -318,14 +318,12 @@ struct member_list *list; { struct member *m; - int rval, matched = UNSPEC; + int matched = UNSPEC; tq_foreach_rev(list, m) { - rval = cmnd_matches(m); - if (rval != UNSPEC) { - matched = m->negated ? !rval : rval; + matched = cmnd_matches(m); + if (matched != UNSPEC) break; - } } return(matched); } @@ -580,8 +578,10 @@ if (dirp == NULL) return(FALSE); - if (strlcpy(buf, sudoers_dir, sizeof(buf)) >= sizeof(buf)) + if (strlcpy(buf, sudoers_dir, sizeof(buf)) >= sizeof(buf)) { + closedir(dirp); return(FALSE); + } while ((dent = readdir(dirp)) != NULL) { /* ignore paths > PATH_MAX (XXX - log) */ buf[dlen] = '\0'; diff -urNa sudo-1.7.2p1/sudo.c sudo-1.7.2p2/sudo.c --- sudo-1.7.2p1/sudo.c Tue May 26 20:49:07 2009 +++ sudo-1.7.2p2/sudo.c Mon Nov 23 19:59:27 2009 @@ -648,7 +648,8 @@ } } - if ((p = ttyname(STDIN_FILENO)) || (p = ttyname(STDOUT_FILENO))) { + if ((p = ttyname(STDIN_FILENO)) || (p = ttyname(STDOUT_FILENO)) || + (p = ttyname(STDERR_FILENO))) { user_tty = user_ttypath = estrdup(p); if (strncmp(user_tty, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) user_tty += sizeof(_PATH_DEV) - 1; @@ -1139,17 +1140,21 @@ log_error(NO_EXIT, "%s is owned by gid %lu, should be %lu", sudoers, (unsigned long) statbuf.st_gid, (unsigned long) SUDOERS_GID); else if ((fp = fopen(sudoers, "r")) == NULL) - log_error(USE_ERRNO, "can't open %s", sudoers); + log_error(USE_ERRNO|NO_EXIT, "can't open %s", sudoers); else { /* * Make sure we can actually read sudoers so we can present the * user with a reasonable error message (unlike the lexer). */ - if (statbuf.st_size != 0) { - if (fgetc(fp) == EOF) - log_error(USE_ERRNO, "can't read %s", sudoers); - rewind(fp); + if (statbuf.st_size != 0 && fgetc(fp) == EOF) { + log_error(USE_ERRNO|NO_EXIT, "can't read %s", sudoers); + fclose(fp); + fp = NULL; } + } + + if (fp != NULL) { + rewind(fp); (void) fcntl(fileno(fp), F_SETFD, 1); } diff -urNa sudo-1.7.2p1/sudo.cat sudo-1.7.2p2/sudo.cat --- sudo-1.7.2p1/sudo.cat Tue Jul 28 15:01:37 2009 +++ sudo-1.7.2p2/sudo.cat Tue Nov 24 21:09:15 2009 @@ -61,7 +61,7 @@ -1.7.2p1 June 15, 2009 1 +1.7.2p2 November 24, 2009 1 @@ -127,7 +127,7 @@ -1.7.2p1 June 15, 2009 2 +1.7.2p2 November 24, 2009 2 @@ -193,7 +193,7 @@ -1.7.2p1 June 15, 2009 3 +1.7.2p2 November 24, 2009 3 @@ -259,7 +259,7 @@ -1.7.2p1 June 15, 2009 4 +1.7.2p2 November 24, 2009 4 @@ -291,7 +291,8 @@ the _p_a_s_s_p_r_o_m_p_t___o_v_e_r_r_i_d_e flag is disabled in _s_u_d_o_e_r_s. -S The --SS (_s_t_d_i_n) option causes ssuuddoo to read the password from - the standard input instead of the terminal device. + the standard input instead of the terminal device. The + password must be followed by a newline character. -s [command] The --ss (_s_h_e_l_l) option runs the shell specified by the _S_H_E_L_L @@ -321,11 +322,10 @@ -v If given the --vv (_v_a_l_i_d_a_t_e) option, ssuuddoo will update the user's timestamp, prompting for the user's password if - necessary. This extends the ssuuddoo timeout for another 5 -1.7.2p1 June 15, 2009 5 +1.7.2p2 November 24, 2009 5 @@ -334,6 +334,7 @@ SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) + necessary. This extends the ssuuddoo timeout for another 5 minutes (or whatever the timeout is set to in _s_u_d_o_e_r_s) but does not run a command. @@ -387,11 +388,10 @@ environment variables that ssuuddoo allows or denies is contained in the output of sudo -V when run as root. - Note that the dynamic linker on most operating systems will remove -1.7.2p1 June 15, 2009 6 +1.7.2p2 November 24, 2009 6 @@ -400,6 +400,7 @@ SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) + Note that the dynamic linker on most operating systems will remove variables that can control dynamic linking from the environment of setuid executables, including ssuuddoo. Depending on the operating system this may include _RLD*, DYLD_*, LD_*, LDR_*, LIBPATH, SHLIB_PATH, and @@ -453,11 +454,10 @@ HOME In --ss or --HH mode (or if sudo was configured with the --enable-shell-sets-home option), set to homedir of the - target user -1.7.2p1 June 15, 2009 7 +1.7.2p2 November 24, 2009 7 @@ -466,6 +466,8 @@ SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) + target user + PATH Set to a sane value if the _s_e_c_u_r_e___p_a_t_h sudoers option is set. @@ -518,20 +520,20 @@ To edit the _i_n_d_e_x_._h_t_m_l file as user www: - $ sudo -u www vi ~www/htdocs/index.html +1.7.2p2 November 24, 2009 8 -1.7.2p1 June 15, 2009 8 - SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) + $ sudo -u www vi ~www/htdocs/index.html + To view system logs only accessible to root and users in the adm group: $ sudo -g adm view /var/log/syslog @@ -584,20 +586,20 @@ Running shell scripts via ssuuddoo can expose the same kernel bugs that make setuid shell scripts unsafe on some operating systems (if your OS - has a /dev/fd/ directory, setuid shell scripts are generally safe). +1.7.2p2 November 24, 2009 9 -1.7.2p1 June 15, 2009 9 - SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) + has a /dev/fd/ directory, setuid shell scripts are generally safe). + BBUUGGSS If you feel you have found a bug in ssuuddoo, please submit a bug report at http://www.sudo.ws/sudo/bugs/ @@ -653,8 +655,6 @@ - - -1.7.2p1 June 15, 2009 10 +1.7.2p2 November 24, 2009 10 diff -urNa sudo-1.7.2p1/sudo.man.in sudo-1.7.2p2/sudo.man.in --- sudo-1.7.2p1/sudo.man.in Mon Jul 20 09:35:00 2009 +++ sudo-1.7.2p2/sudo.man.in Tue Nov 24 21:09:14 2009 @@ -18,19 +18,11 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.\" $Sudo: sudo.man.in,v 1.56 2009/06/29 13:36:42 millert Exp $ -.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05) +.\" $Sudo: sudo.pod,v 1.125 2009/09/25 00:31:35 millert Exp $ +.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" Standard preamble: .\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp @@ -74,7 +66,7 @@ .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ @@ -153,7 +145,7 @@ .\" ======================================================================== .\" .IX Title "SUDO @mansectsu@" -.TH SUDO @mansectsu@ "June 15, 2009" "1.7.2p1" "MAINTENANCE COMMANDS" +.TH SUDO @mansectsu@ "November 24, 2009" "1.7.2p2" "MAINTENANCE COMMANDS" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -442,7 +434,8 @@ .IP "\-S" 12 .IX Item "-S" The \fB\-S\fR (\fIstdin\fR) option causes \fBsudo\fR to read the password from -the standard input instead of the terminal device. +the standard input instead of the terminal device. The password must +be followed by a newline character. .IP "\-s [command]" 12 .IX Item "-s [command]" The \fB\-s\fR (\fIshell\fR) option runs the shell specified by the \fI\s-1SHELL\s0\fR diff -urNa sudo-1.7.2p1/sudo.man.pl sudo-1.7.2p2/sudo.man.pl --- sudo-1.7.2p1/sudo.man.pl Wed Dec 31 19:00:00 1969 +++ sudo-1.7.2p2/sudo.man.pl Tue Nov 24 20:47:12 2009 @@ -0,0 +1,23 @@ +#!/usr/bin/perl -p + +BEGIN { + %tags = ( 'a', '@BAMAN@', 'c', '@LCMAN@', 'r', '@SEMAN@', 't', '@SEMAN@'); + $t = undef; +} +if (/^\.IP(.*-([acrt]))?/) { + $t = $1 ? $tags{$2} : undef; +} elsif (/-a.*auth_type/) { + $_ = $tags{'a'} . $_; +} elsif (/(-c.*class.*\||login_cap)/) { + $_ = $tags{'c'} . $_; +} elsif (/-r.*role.*-t.*type/) { + $_ = $tags{'r'} . $_; +} + +# Fix up broken pod2man formatting of F<@foo@/bar> +s/\\fI\\f(\(C)?I\@([^\@]*)\\fI\@/\\fI\@$2\@/g; + +# comment out Compile-time-specific lines in DESCRIPTION +if ($t) { + $_ = $t . $_; +} diff -urNa sudo-1.7.2p1/sudo.pod sudo-1.7.2p2/sudo.pod --- sudo-1.7.2p1/sudo.pod Mon Jun 15 17:19:47 2009 +++ sudo-1.7.2p2/sudo.pod Tue Nov 24 20:48:18 2009 @@ -18,7 +18,7 @@ Agency (DARPA) and Air Force Research Laboratory, Air Force Materiel Command, USAF, under agreement number F39502-99-1-0512. -$Sudo: sudo.pod,v 1.124 2009/06/15 21:19:47 millert Exp $ +$Sudo: sudo.pod,v 1.125 2009/09/25 00:31:35 millert Exp $ =pod =head1 NAME @@ -337,7 +337,8 @@ =item -S The B<-S> (I) option causes B to read the password from -the standard input instead of the terminal device. +the standard input instead of the terminal device. The password must +be followed by a newline character. =item -s [command] diff -urNa sudo-1.7.2p1/sudo_edit.c sudo-1.7.2p2/sudo_edit.c --- sudo-1.7.2p1/sudo_edit.c Sun Nov 9 09:13:12 2008 +++ sudo-1.7.2p2/sudo_edit.c Mon Nov 23 19:59:27 2009 @@ -56,7 +56,7 @@ #include "sudo.h" #ifndef lint -__unused static const char rcsid[] = "$Sudo: sudo_edit.c,v 1.37 2008/11/09 14:13:12 millert Exp $"; +__unused static const char rcsid[] = "$Sudo: sudo_edit.c,v 1.39 2009/09/30 13:50:58 millert Exp $"; #endif /* lint */ extern sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp; @@ -171,21 +171,23 @@ } close(ofd); } -#ifdef HAVE_FSTAT /* - * If we are unable to set the mtime on the temp file to the value - * of the original file just make the stashed mtime match the temp - * file's mtime. It is better than nothing and we only use the info + * We always update the stashed mtime because the time + * resolution of the filesystem the temporary file is on may + * not match that of the filesystem where the file to be edited + * resides. It is OK if touch() fails since we only use the info * to determine whether or not a file has been modified. */ - if (touch(tfd, NULL, &tf[i].omtim) == -1) { - if (fstat(tfd, &sb) == 0) { - tf[i].omtim.tv_sec = mtim_getsec(sb); - tf[i].omtim.tv_nsec = mtim_getnsec(sb); - } - /* XXX - else error? */ - } + (void) touch(tfd, NULL, &tf[i].omtim); +#ifdef HAVE_FSTAT + error = fstat(tfd, &sb); +#else + error = stat(tf[i].tfile, &sb); #endif + if (!error) { + tf[i].omtim.tv_sec = mtim_getsec(sb); + tf[i].omtim.tv_nsec = mtim_getnsec(sb); + } close(tfd); } if (argc == 1) @@ -233,7 +235,7 @@ (void) sigaction(SIGINT, &saved_sa_int, NULL); (void) sigaction(SIGQUIT, &saved_sa_quit, NULL); set_perms(PERM_FULL_USER); - closefrom(def_closefrom + 1); + closefrom(def_closefrom); execvp(nargv[0], nargv); warning("unable to execute %s", nargv[0]); _exit(127); diff -urNa sudo-1.7.2p1/sudoers.cat sudo-1.7.2p2/sudoers.cat --- sudo-1.7.2p1/sudoers.cat Tue Jul 28 15:01:43 2009 +++ sudo-1.7.2p2/sudoers.cat Tue Nov 24 21:09:16 2009 @@ -20,8 +20,7 @@ Form (EBNF). Don't despair if you don't know what EBNF is; it is fairly simple, and the definitions below are annotated. - QQuuiicckk gguuiiddee ttoo EEBBNNFF - + QQuuiicckk gguuiiddee ttoo EEBBNNFF EBNF is a concise and exact way of describing the grammar of a language. Each EBNF definition is made up of _p_r_o_d_u_c_t_i_o_n _r_u_l_e_s. E.g., @@ -45,8 +44,7 @@ will use single quotes ('') to designate what is a verbatim character string (as opposed to a symbol name). - AAlliiaasseess - + AAlliiaasseess There are four kinds of aliases: User_Alias, Runas_Alias, Host_Alias and Cmnd_Alias. @@ -59,20 +57,20 @@ Runas_Alias ::= NAME '=' Runas_List + Host_Alias ::= NAME '=' Host_List -1.7.2p1 June 30, 2009 1 +1.7.2p2 November 24, 2009 1 + SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - Host_Alias ::= NAME '=' Host_List - Cmnd_Alias ::= NAME '=' Cmnd_List NAME ::= [A-Z]([A-Z][0-9]_)* @@ -124,10 +122,12 @@ Note that quotes around group names are optional. Unquoted strings must use a backslash (\) to escape spaces and the '@' symbol. + Runas_List ::= Runas_Member | + Runas_Member ',' Runas_List -1.7.2p1 June 30, 2009 2 +1.7.2p2 November 24, 2009 2 @@ -136,8 +136,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - Runas_List ::= Runas_Member | - Runas_Member ',' Runas_List Runas_Member ::= '!'* username | '!'* '#'uid | @@ -190,10 +188,12 @@ other aliases. A commandname is a fully qualified filename which may include shell-style wildcards (see the Wildcards section below). A simple filename allows the user to run the command with any arguments + he/she wishes. However, you may also specify command line arguments + (including wildcards). Alternately, you can specify "" to indicate -1.7.2p1 June 30, 2009 3 +1.7.2p2 November 24, 2009 3 @@ -202,8 +202,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - he/she wishes. However, you may also specify command line arguments - (including wildcards). Alternately, you can specify "" to indicate that the command may only be run wwiitthhoouutt command line arguments. A directory is a fully qualified pathname ending in a '/'. When you specify a directory in a Cmnd_List, the user will be able to run any @@ -217,8 +215,7 @@ to permit a user to run ssuuddoo with the --ee option (or as ssuuddooeeddiitt). It may take command line arguments just as a normal command does. - DDeeffaauullttss - + DDeeffaauullttss Certain configuration options may be changed from their default values at runtime via one or more Default_Entry lines. These may affect all users on any host, all users on a specific host, a specific user, a @@ -256,24 +253,22 @@ not exist in a list. Defaults entries are parsed in the following order: generic, host and + user Defaults first, then runas Defaults and finally command defaults. + See "SUDOERS OPTIONS" for a list of supported Defaults parameters. -1.7.2p1 June 30, 2009 4 +1.7.2p2 November 24, 2009 4 + SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - user Defaults first, then runas Defaults and finally command defaults. - - See "SUDOERS OPTIONS" for a list of supported Defaults parameters. - - UUsseerr SSppeecciiffiiccaattiioonn - + UUsseerr SSppeecciiffiiccaattiioonn User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \ (':' Host_List '=' Cmnd_Spec_List)* @@ -294,8 +289,7 @@ The basic structure of a user specification is `who = where (as_whom) what'. Let's break that down into its constituent parts: - RRuunnaass__SSppeecc - + RRuunnaass__SSppeecc A Runas_Spec determines the user and/or the group that a command may be run as. A fully-specified Runas_Spec consists of two Runas_Lists (as defined above) separated by a colon (':') and enclosed in a set of @@ -323,22 +317,23 @@ It is also possible to override a Runas_Spec later on in an entry. If we modify the entry like so: + dgb boulder = (operator) /bin/ls, (root) /bin/kill, /usr/bin/lprm + Then user ddggbb is now allowed to run _/_b_i_n_/_l_s as ooppeerraattoorr, but _/_b_i_n_/_k_i_l_l + and _/_u_s_r_/_b_i_n_/_l_p_r_m as rroooott. -1.7.2p1 June 30, 2009 5 +1.7.2p2 November 24, 2009 5 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - dgb boulder = (operator) /bin/ls, (root) /bin/kill, /usr/bin/lprm - Then user ddggbb is now allowed to run _/_b_i_n_/_l_s as ooppeerraattoorr, but _/_b_i_n_/_k_i_l_l - and _/_u_s_r_/_b_i_n_/_l_p_r_m as rroooott. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) + We can extend this to allow ddggbb to run /bin/ls with either the user or group set to ooppeerraattoorr: @@ -352,8 +347,7 @@ tcm boulder = (:dialer) /usr/bin/tip, /usr/bin/cu, \ /usr/local/bin/minicom - TTaagg__SSppeecc - + TTaagg__SSppeecc A command may have zero or more tags associated with it. There are eight possible tag values, NOPASSWD, PASSWD, NOEXEC, EXEC, SETENV and NOSETENV. Once a tag is set on a Cmnd, subsequent Cmnds in the @@ -389,22 +383,23 @@ _N_O_E_X_E_C _a_n_d _E_X_E_C + If ssuuddoo has been compiled with _n_o_e_x_e_c support and the underlying + operating system supports it, the NOEXEC tag can be used to prevent a + dynamically-linked executable from running further commands itself. + In the following example, user aaaarroonn may run _/_u_s_r_/_b_i_n_/_m_o_r_e and -1.7.2p1 June 30, 2009 6 +1.7.2p2 November 24, 2009 6 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - If ssuuddoo has been compiled with _n_o_e_x_e_c support and the underlying - operating system supports it, the NOEXEC tag can be used to prevent a - dynamically-linked executable from running further commands itself. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - In the following example, user aaaarroonn may run _/_u_s_r_/_b_i_n_/_m_o_r_e and + _/_u_s_r_/_b_i_n_/_v_i but shell escapes will be disabled. aaron shanty = NOEXEC: /usr/bin/more, /usr/bin/vi @@ -422,8 +417,7 @@ If the command matched is AALLLL, the SETENV tag is implied for that command; this default may be overridden by use of the UNSETENV tag. - WWiillddccaarrddss - + WWiillddccaarrddss ssuuddoo allows shell-style _w_i_l_d_c_a_r_d_s (aka meta or glob characters) to be used in hostnames, pathnames and command line arguments in the _s_u_d_o_e_r_s file. Wildcard matching is done via the PPOOSSIIXX _g_l_o_b(3) and _f_n_m_a_t_c_h(3) @@ -454,30 +448,28 @@ /usr/bin/* + match _/_u_s_r_/_b_i_n_/_w_h_o but not _/_u_s_r_/_b_i_n_/_X_1_1_/_x_t_e_r_m. + EExxcceeppttiioonnss ttoo wwiillddccaarrdd rruulleess + The following exceptions apply to the above rules: + "" If the empty string "" is the only command line argument in the -1.7.2p1 June 30, 2009 7 +1.7.2p2 November 24, 2009 7 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - match _/_u_s_r_/_b_i_n_/_w_h_o but not _/_u_s_r_/_b_i_n_/_X_1_1_/_x_t_e_r_m. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - EExxcceeppttiioonnss ttoo wwiillddccaarrdd rruulleess - The following exceptions apply to the above rules: - - "" If the empty string "" is the only command line argument in the _s_u_d_o_e_r_s entry it means that command is not allowed to be run with aannyy arguments. - IInncclluuddiinngg ootthheerr ffiilleess ffrroomm wwiitthhiinn ssuuddooeerrss - + IInncclluuddiinngg ootthheerr ffiilleess ffrroomm wwiitthhiinn ssuuddooeerrss It is possible to include other _s_u_d_o_e_r_s files from within the _s_u_d_o_e_r_s file currently being parsed using the #include and #includedir directives. @@ -520,27 +512,26 @@ in the file names can be used to avoid such problems. Note that unlike files included via #include, vviissuuddoo will not edit the + files in a #includedir directory unless one of them contains a syntax + error. It is still possible to run vviissuuddoo with the -f flag to edit the + files directly. + OOtthheerr ssppeecciiaall cchhaarraacctteerrss aanndd rreesseerrvveedd wwoorrddss + The pound sign ('#') is used to indicate a comment (unless it is part + of a #include directive or unless it occurs in the context of a user + name and is followed by one or more digits, in which case it is treated -1.7.2p1 June 30, 2009 8 +1.7.2p2 November 24, 2009 8 + SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - files in a #includedir directory unless one of them contains a syntax - error. It is still possible to run vviissuuddoo with the -f flag to edit the - files directly. - - OOtthheerr ssppeecciiaall cchhaarraacctteerrss aanndd rreesseerrvveedd wwoorrddss - - The pound sign ('#') is used to indicate a comment (unless it is part - of a #include directive or unless it occurs in the context of a user - name and is followed by one or more digits, in which case it is treated as a uid). Both the comment character and any text after it, up to the end of the line, are ignored. @@ -587,25 +578,26 @@ the PASSWD and NOPASSWD tags. This flag is _o_n by default. + closefrom_override + If set, the user may use ssuuddoo's --CC option which + overrides the default starting point at which ssuuddoo + begins closing open file descriptors. This flag is _o_f_f + by default. + env_editor If set, vviissuuddoo will use the value of the EDITOR or + VISUAL environment variables before falling back on the -1.7.2p1 June 30, 2009 9 +1.7.2p2 November 24, 2009 9 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - closefrom_override - If set, the user may use ssuuddoo's --CC option which - overrides the default starting point at which ssuuddoo - begins closing open file descriptors. This flag is _o_f_f - by default. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - env_editor If set, vviissuuddoo will use the value of the EDITOR or - VISUAL environment variables before falling back on the + default editor list. Note that this may create a security hole as it allows the user to run any arbitrary command as root without logging. A safer @@ -652,25 +644,25 @@ operators who would attempt to add roles to _/_e_t_c_/_s_u_d_o_e_r_s. When this option is present, _/_e_t_c_/_s_u_d_o_e_r_s does not even need to exist. Since this + option tells ssuuddoo how to behave when no specific LDAP + entries have been matched, this sudoOption is only + meaningful for the cn=defaults section. This flag is + _o_f_f by default. + insults If set, ssuuddoo will insult users when they enter an + incorrect password. This flag is _o_f_f by default. -1.7.2p1 June 30, 2009 10 +1.7.2p2 November 24, 2009 10 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - option tells ssuuddoo how to behave when no specific LDAP - entries have been matched, this sudoOption is only - meaningful for the cn=defaults section. This flag is - _o_f_f by default. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - insults If set, ssuuddoo will insult users when they enter an - incorrect password. This flag is _o_f_f by default. log_host If set, the hostname will be logged in the (non-syslog) ssuuddoo log file. This flag is _o_f_f by default. @@ -718,26 +710,26 @@ sites may wish to disable this as it could be used to gather information on the location of executables that the normal user does not have access to. The + disadvantage is that if the executable is simply not in + the user's PATH, ssuuddoo will tell the user that they are + not allowed to run it, which can be confusing. This + flag is _o_n by default. + passprompt_override + The password prompt specified by _p_a_s_s_p_r_o_m_p_t will + normally only be used if the passwod prompt provided by -1.7.2p1 June 30, 2009 11 +1.7.2p2 November 24, 2009 11 + SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - disadvantage is that if the executable is simply not in - the user's PATH, ssuuddoo will tell the user that they are - not allowed to run it, which can be confusing. This - flag is _o_n by default. - - passprompt_override - The password prompt specified by _p_a_s_s_p_r_o_m_p_t will - normally only be used if the passwod prompt provided by systems such as PAM matches the string "Password:". If _p_a_s_s_p_r_o_m_p_t___o_v_e_r_r_i_d_e is set, _p_a_s_s_p_r_o_m_p_t will always be used. This flag is _o_f_f by default. @@ -784,26 +776,26 @@ flag is _o_f_f by default. set_home If set and ssuuddoo is invoked with the --ss option the HOME + environment variable will be set to the home directory + of the target user (which is root unless the --uu option + is used). This effectively makes the --ss option imply + --HH. This flag is _o_f_f by default. + set_logname Normally, ssuuddoo will set the LOGNAME, USER and USERNAME + environment variables to the name of the target user + (usually root unless the --uu option is given). However, -1.7.2p1 June 30, 2009 12 +1.7.2p2 November 24, 2009 12 + SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - environment variable will be set to the home directory - of the target user (which is root unless the --uu option - is used). This effectively makes the --ss option imply - --HH. This flag is _o_f_f by default. - - set_logname Normally, ssuuddoo will set the LOGNAME, USER and USERNAME - environment variables to the name of the target user - (usually root unless the --uu option is given). However, since some programs (including the RCS revision control system) use LOGNAME to determine the real identity of the user, it may be desirable to change this behavior. @@ -850,26 +842,26 @@ with either the _s_e_t_r_e_u_i_d_(_) or _s_e_t_r_e_s_u_i_d_(_) function. This flag is _o_f_f by default. + targetpw If set, ssuuddoo will prompt for the password of the user + specified by the --uu option (defaults to root) instead + of the password of the invoking user. Note that this + precludes the use of a uid not listed in the passwd + database as an argument to the --uu option. This flag is + _o_f_f by default. + tty_tickets If set, users must authenticate on a per-tty basis. -1.7.2p1 June 30, 2009 13 +1.7.2p2 November 24, 2009 13 + SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - targetpw If set, ssuuddoo will prompt for the password of the user - specified by the --uu option (defaults to root) instead - of the password of the invoking user. Note that this - precludes the use of a uid not listed in the passwd - database as an argument to the --uu option. This flag is - _o_f_f by default. - - tty_tickets If set, users must authenticate on a per-tty basis. Normally, ssuuddoo uses a directory in the ticket dir with the same name as the user running it. With this flag enabled, ssuuddoo will use a file named for the tty the @@ -916,26 +908,26 @@ value is used to decide when to wrap lines for nicer log files. This has no effect on the syslog log file, only the file log. The default is 80 (use 0 or negate + the option to disable word wrap). + passwd_timeout Number of minutes before the ssuuddoo password prompt times + out. The default is 5; set this to 0 for no password + timeout. + timestamp_timeout + Number of minutes that can elapse before ssuuddoo will ask -1.7.2p1 June 30, 2009 14 +1.7.2p2 November 24, 2009 14 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - the option to disable word wrap). +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - passwd_timeout Number of minutes before the ssuuddoo password prompt times - out. The default is 5; set this to 0 for no password - timeout. - timestamp_timeout - Number of minutes that can elapse before ssuuddoo will ask for a passwd again. The default is 5. Set this to 0 to always prompt for a password. If set to a value less than 0 the user's timestamp will never expire. @@ -982,26 +974,26 @@ escapes are supported: %H expanded to the local hostname including the domain + name (on if the machine's hostname is fully + qualified or the _f_q_d_n option is set) + %h expanded to the local hostname without the domain + name + %p expanded to the user whose password is being asked + for (respects the _r_o_o_t_p_w, _t_a_r_g_e_t_p_w and _r_u_n_a_s_p_w -1.7.2p1 June 30, 2009 15 +1.7.2p2 November 24, 2009 15 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - name (on if the machine's hostname is fully - qualified or the _f_q_d_n option is set) +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - %h expanded to the local hostname without the domain - name - %p expanded to the user whose password is being asked - for (respects the _r_o_o_t_p_w, _t_a_r_g_e_t_p_w and _r_u_n_a_s_p_w flags in _s_u_d_o_e_r_s) %U expanded to the login name of the user the command @@ -1048,25 +1040,26 @@ variable. env_file The _e_n_v___f_i_l_e options specifies the fully qualified path to + a file containing variables to be set in the environment of + the program being run. Entries in this file should either + be of the form VARIABLE=value or export VARIABLE=value. + The value may optionally be surrounded by single or double + quotes. Variables in this file are subject to other ssuuddoo + environment settings such as _e_n_v___k_e_e_p and _e_n_v___c_h_e_c_k. -1.7.2p1 June 30, 2009 16 +1.7.2p2 November 24, 2009 16 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - a file containing variables to be set in the environment of - the program being run. Entries in this file should either - be of the form VARIABLE=value or export VARIABLE=value. - The value may optionally be surrounded by single or double - quotes. Variables in this file are subject to other ssuuddoo - environment settings such as _e_n_v___k_e_e_p and _e_n_v___c_h_e_c_k. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) + exempt_group Users in this group are exempt from password and PATH requirements. This is not set by default. @@ -1114,24 +1107,24 @@ logfile Path to the ssuuddoo log file (not the syslog log file). Setting a path turns on logging to a file; negating this + option turns it off. By default, ssuuddoo logs via syslog. + mailerflags Flags to use when invoking mailer. Defaults to --tt. + mailerpath Path to mail program used to send warning mail. Defaults + to the path to sendmail found at configure time. -1.7.2p1 June 30, 2009 17 +1.7.2p2 November 24, 2009 17 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - option turns it off. By default, ssuuddoo logs via syslog. - mailerflags Flags to use when invoking mailer. Defaults to --tt. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - mailerpath Path to mail program used to send warning mail. Defaults - to the path to sendmail found at configure time. mailfrom Address to use for the "from" address when sending warning and error mail. The address should be enclosed in double @@ -1148,7 +1141,7 @@ is if you want to have the "root path" be separate from the "user path." Users in the group specified by the _e_x_e_m_p_t___g_r_o_u_p option are not affected by _s_e_c_u_r_e___p_a_t_h. This - is not set by default. + option is not set by default. syslog Syslog facility if syslog is being used for logging (negate to disable syslog logging). Defaults to local2. @@ -1180,10 +1173,17 @@ env_check Environment variables to be removed from the user's environment if the variable's value contains % or / characters. This can be used to guard against printf- + style format vulnerabilities in poorly-written + programs. The argument may be a double-quoted, space- + separated list or a single value without double-quotes. + The list can be replaced, added to, deleted from, or + disabled by using the =, +=, -=, and ! operators + respectively. Regardless of whether the env_reset + option is enabled or disabled, variables specified by -1.7.2p1 June 30, 2009 18 +1.7.2p2 November 24, 2009 18 @@ -1192,13 +1192,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - style format vulnerabilities in poorly-written - programs. The argument may be a double-quoted, space- - separated list or a single value without double-quotes. - The list can be replaced, added to, deleted from, or - disabled by using the =, +=, -=, and ! operators - respectively. Regardless of whether the env_reset - option is enabled or disabled, variables specified by env_check will be preserved in the environment if they pass the aforementioned check. The default list of environment variables to check is displayed when ssuuddoo @@ -1245,11 +1238,18 @@ Below are example _s_u_d_o_e_r_s entries. Admittedly, some of these are a bit contrived. First, we define our _a_l_i_a_s_e_s: + # User alias specification + User_Alias FULLTIMERS = millert, mikef, dowdy + User_Alias PARTTIMERS = bostley, jwfox, crawl + User_Alias WEBMASTERS = will, wendy, wim + # Runas alias specification + Runas_Alias OP = root, operator + Runas_Alias DB = oracle, sybase -1.7.2p1 June 30, 2009 19 +1.7.2p2 November 24, 2009 19 @@ -1258,14 +1258,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - # User alias specification - User_Alias FULLTIMERS = millert, mikef, dowdy - User_Alias PARTTIMERS = bostley, jwfox, crawl - User_Alias WEBMASTERS = will, wendy, wim - - # Runas alias specification - Runas_Alias OP = root, operator - Runas_Alias DB = oracle, sybase Runas_Alias ADMINGRP = adm, oper # Host alias specification @@ -1312,25 +1304,25 @@ Defaults!PAGERS noexec The _U_s_e_r _s_p_e_c_i_f_i_c_a_t_i_o_n is the part that actually determines who may run + what. + root ALL = (ALL) ALL + %wheel ALL = (ALL) ALL + We let rroooott and any user in group wwhheeeell run any command on any host as + any user. -1.7.2p1 June 30, 2009 20 +1.7.2p2 November 24, 2009 20 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - what. - root ALL = (ALL) ALL - %wheel ALL = (ALL) ALL +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - We let rroooott and any user in group wwhheeeell run any command on any host as - any user. FULLTIMERS ALL = NOPASSWD: ALL @@ -1379,24 +1371,25 @@ the _H_P_P_A machines. Note that this assumes _p_a_s_s_w_d(1) does not take multiple usernames on the command line. + bob SPARC = (OP) ALL : SGI = (OP) ALL + The user bboobb may run anything on the _S_P_A_R_C and _S_G_I machines as any user + listed in the _O_P Runas_Alias (rroooott and ooppeerraattoorr). -1.7.2p1 June 30, 2009 21 + jim +biglab = ALL +1.7.2p2 November 24, 2009 21 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - bob SPARC = (OP) ALL : SGI = (OP) ALL - The user bboobb may run anything on the _S_P_A_R_C and _S_G_I machines as any user - listed in the _O_P Runas_Alias (rroooott and ooppeerraattoorr). - jim +biglab = ALL +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) + The user jjiimm may run any command on machines in the _b_i_g_l_a_b netgroup. ssuuddoo knows that "biglab" is a netgroup due to the '+' prefix. @@ -1443,27 +1436,26 @@ and wim), may run any command as user www (which owns the web pages) or simply _s_u(1) to www. + ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\ + /sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM + Any user may mount or unmount a CD-ROM on the machines in the CDROM + Host_Alias (orion, perseus, hercules) without entering a password. + This is a bit tedious for users to type, so it is a prime candidate for + encapsulating in a shell script. -1.7.2p1 June 30, 2009 22 +1.7.2p2 November 24, 2009 22 + SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\ - /sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM - - Any user may mount or unmount a CD-ROM on the machines in the CDROM - Host_Alias (orion, perseus, hercules) without entering a password. - This is a bit tedious for users to type, so it is a prime candidate for - encapsulating in a shell script. - SSEECCUURRIITTYY NNOOTTEESS It is generally not effective to "subtract" commands from ALL using the '!' operator. A user can trivially circumvent this by copying the @@ -1510,26 +1502,26 @@ sudo -V | grep "dummy exec" + If the resulting output contains a line that begins with: + File containing dummy exec functions: + then ssuuddoo may be able to replace the exec family of functions + in the standard library with its own that simply return an + error. Unfortunately, there is no foolproof way to know + whether or not _n_o_e_x_e_c will work at compile-time. _n_o_e_x_e_c -1.7.2p1 June 30, 2009 23 +1.7.2p2 November 24, 2009 23 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - If the resulting output contains a line that begins with: +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - File containing dummy exec functions: - then ssuuddoo may be able to replace the exec family of functions - in the standard library with its own that simply return an - error. Unfortunately, there is no foolproof way to know - whether or not _n_o_e_x_e_c will work at compile-time. _n_o_e_x_e_c should work on SunOS, Solaris, *BSD, Linux, IRIX, Tru64 UNIX, MacOS X, and HP-UX 11.x. It is known nnoott to work on AIX and UnixWare. _n_o_e_x_e_c is expected to work on most operating @@ -1576,26 +1568,26 @@ SSUUPPPPOORRTT Limited free support is available via the sudo-users mailing list, see + http://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or search + the archives. +DDIISSCCLLAAIIMMEERR + ssuuddoo is provided ``AS IS'' and any express or implied warranties, + including, but not limited to, the implied warranties of + merchantability and fitness for a particular purpose are disclaimed. + See the LICENSE file distributed with ssuuddoo or -1.7.2p1 June 30, 2009 24 +1.7.2p2 November 24, 2009 24 + SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - http://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or search - the archives. - -DDIISSCCLLAAIIMMEERR - ssuuddoo is provided ``AS IS'' and any express or implied warranties, - including, but not limited to, the implied warranties of - merchantability and fitness for a particular purpose are disclaimed. - See the LICENSE file distributed with ssuuddoo or http://www.sudo.ws/sudo/license.html for complete details. @@ -1645,6 +1637,14 @@ -1.7.2p1 June 30, 2009 25 + + + + + + + + +1.7.2p2 November 24, 2009 25 diff -urNa sudo-1.7.2p1/sudoers.man.in sudo-1.7.2p2/sudoers.man.in --- sudo-1.7.2p1/sudoers.man.in Mon Jul 20 09:35:06 2009 +++ sudo-1.7.2p2/sudoers.man.in Tue Nov 24 21:09:16 2009 @@ -18,19 +18,11 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.\" $Sudo: sudoers.man.in,v 1.80 2009/06/30 12:41:09 millert Exp $ -.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05) +.\" $Sudo: sudoers.pod,v 1.173 2009/06/30 12:41:09 millert Exp $ +.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" Standard preamble: .\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp @@ -74,7 +66,7 @@ .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ @@ -153,7 +145,7 @@ .\" ======================================================================== .\" .IX Title "SUDOERS @mansectform@" -.TH SUDOERS @mansectform@ "June 30, 2009" "1.7.2p1" "MAINTENANCE COMMANDS" +.TH SUDOERS @mansectform@ "November 24, 2009" "1.7.2p2" "MAINTENANCE COMMANDS" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -173,7 +165,7 @@ The \fIsudoers\fR grammar will be described below in Extended Backus-Naur Form (\s-1EBNF\s0). Don't despair if you don't know what \s-1EBNF\s0 is; it is fairly simple, and the definitions below are annotated. -.Sh "Quick guide to \s-1EBNF\s0" +.SS "Quick guide to \s-1EBNF\s0" .IX Subsection "Quick guide to EBNF" \&\s-1EBNF\s0 is a concise and exact way of describing the grammar of a language. Each \s-1EBNF\s0 definition is made up of \fIproduction rules\fR. E.g., @@ -206,7 +198,7 @@ Parentheses may be used to group symbols together. For clarity, we will use single quotes ('') to designate what is a verbatim character string (as opposed to a symbol name). -.Sh "Aliases" +.SS "Aliases" .IX Subsection "Aliases" There are four kinds of aliases: \f(CW\*(C`User_Alias\*(C'\fR, \f(CW\*(C`Runas_Alias\*(C'\fR, \&\f(CW\*(C`Host_Alias\*(C'\fR and \f(CW\*(C`Cmnd_Alias\*(C'\fR. @@ -358,7 +350,7 @@ is used to permit a user to run \fBsudo\fR with the \fB\-e\fR option (or as \fBsudoedit\fR). It may take command line arguments just as a normal command does. -.Sh "Defaults" +.SS "Defaults" .IX Subsection "Defaults" Certain configuration options may be changed from their default values at runtime via one or more \f(CW\*(C`Default_Entry\*(C'\fR lines. These @@ -403,7 +395,7 @@ defaults. .PP See \*(L"\s-1SUDOERS\s0 \s-1OPTIONS\s0\*(R" for a list of supported Defaults parameters. -.Sh "User Specification" +.SS "User Specification" .IX Subsection "User Specification" .Vb 2 \& User_Spec ::= User_List Host_List \*(Aq=\*(Aq Cmnd_Spec_List \e @@ -426,7 +418,7 @@ .PP The basic structure of a user specification is `who = where (as_whom) what'. Let's break that down into its constituent parts: -.Sh "Runas_Spec" +.SS "Runas_Spec" .IX Subsection "Runas_Spec" A \f(CW\*(C`Runas_Spec\*(C'\fR determines the user and/or the group that a command may be run as. A fully-specified \f(CW\*(C`Runas_Spec\*(C'\fR consists of two @@ -484,7 +476,7 @@ \& tcm boulder = (:dialer) /usr/bin/tip, /usr/bin/cu, \e \& /usr/local/bin/minicom .Ve -.Sh "Tag_Spec" +.SS "Tag_Spec" .IX Subsection "Tag_Spec" A command may have zero or more tags associated with it. There are eight possible tag values, \f(CW\*(C`NOPASSWD\*(C'\fR, \f(CW\*(C`PASSWD\*(C'\fR, \f(CW\*(C`NOEXEC\*(C'\fR, \f(CW\*(C`EXEC\*(C'\fR, @@ -555,7 +547,7 @@ variables in this manner. If the command matched is \fB\s-1ALL\s0\fR, the \&\f(CW\*(C`SETENV\*(C'\fR tag is implied for that command; this default may be overridden by use of the \f(CW\*(C`UNSETENV\*(C'\fR tag. -.Sh "Wildcards" +.SS "Wildcards" .IX Subsection "Wildcards" \&\fBsudo\fR allows shell-style \fIwildcards\fR (aka meta or glob characters) to be used in hostnames, pathnames and command line arguments in @@ -605,7 +597,7 @@ .Ve .PP match \fI/usr/bin/who\fR but not \fI/usr/bin/X11/xterm\fR. -.Sh "Exceptions to wildcard rules" +.SS "Exceptions to wildcard rules" .IX Subsection "Exceptions to wildcard rules" The following exceptions apply to the above rules: .ie n .IP """""" 8 @@ -614,7 +606,7 @@ If the empty string \f(CW""\fR is the only command line argument in the \&\fIsudoers\fR entry it means that command is not allowed to be run with \fBany\fR arguments. -.Sh "Including other files from within sudoers" +.SS "Including other files from within sudoers" .IX Subsection "Including other files from within sudoers" It is possible to include other \fIsudoers\fR files from within the \&\fIsudoers\fR file currently being parsed using the \f(CW\*(C`#include\*(C'\fR and @@ -666,7 +658,7 @@ edit the files in a \f(CW\*(C`#includedir\*(C'\fR directory unless one of them contains a syntax error. It is still possible to run \fBvisudo\fR with the \f(CW\*(C`\-f\*(C'\fR flag to edit the files directly. -.Sh "Other special characters and reserved words" +.SS "Other special characters and reserved words" .IX Subsection "Other special characters and reserved words" The pound sign ('#') is used to indicate a comment (unless it is part of a #include directive or unless it occurs in the context of @@ -1216,7 +1208,7 @@ want to use this. Another use is if you want to have the \*(L"root path\*(R" be separate from the \*(L"user path.\*(R" Users in the group specified by the \&\fIexempt_group\fR option are not affected by \fIsecure_path\fR. -This is not set by default. +This option is @secure_path@ by default. .IP "syslog" 12 .IX Item "syslog" Syslog facility if syslog is being used for logging (negate to diff -urNa sudo-1.7.2p1/sudoers.man.pl sudo-1.7.2p2/sudoers.man.pl --- sudo-1.7.2p1/sudoers.man.pl Wed Dec 31 19:00:00 1969 +++ sudo-1.7.2p2/sudoers.man.pl Tue Nov 24 20:47:12 2009 @@ -0,0 +1,25 @@ +#!/usr/bin/perl -p + +BEGIN { + $t = undef; +} + +if (/^\./) { + if (/^\.I[PX].*use_loginclass/) { + $t = '@LCMAN@'; + } elsif (/^\.I[PX].*(role|type)/) { + $t = '@SEMAN@'; + } else { + $t = undef; + } +} + +# Fix up broken pod2man formatting of F<@foo@/bar> +s/\\fI\\f(\(C)?I\@([^\@]*)\\fI\@/\\fI\@$2\@/g; +s/\\f\(\CW\@([^\@]*)\\fR\@/\@$1\@/g; +#\f(CW@secure_path\fR@ + +# Comment out Compile-time-specific lines in DESCRIPTION +if ($t) { + $_ = $t . $_; +} diff -urNa sudo-1.7.2p1/sudoers.pod sudo-1.7.2p2/sudoers.pod --- sudo-1.7.2p1/sudoers.pod Tue Jun 30 08:41:09 2009 +++ sudo-1.7.2p2/sudoers.pod Tue Nov 24 20:47:36 2009 @@ -1166,7 +1166,7 @@ want to use this. Another use is if you want to have the "root path" be separate from the "user path." Users in the group specified by the I option are not affected by I. -This is not set by default. +This option is @secure_path@ by default. =item syslog diff -urNa sudo-1.7.2p1/toke.l sudo-1.7.2p2/toke.l --- sudo-1.7.2p1/toke.l Mon Jul 20 09:33:58 2009 +++ sudo-1.7.2p2/toke.l Mon Nov 23 19:59:27 2009 @@ -72,10 +72,11 @@ #include #ifndef lint -__unused static const char rcsid[] = "$Sudo: toke.l,v 1.38 2009/07/18 13:55:37 millert Exp $"; +__unused static const char rcsid[] = "$Sudo: toke.l,v 1.40 2009/11/22 14:54:04 millert Exp $"; #endif /* lint */ extern YYSTYPE yylval; +extern int parse_error; int sudolineno = 1; char *sudoers; static int sawspace = 0; @@ -253,8 +254,11 @@ LEXTRACE("INCLUDEDIR\n"); - /* Push current buffer and switch to include file */ - if (!push_includedir(path)) + /* + * Push current buffer and switch to include file. + * We simply ignore empty directories. + */ + if (!push_includedir(path) && parse_error) yyterminate(); } @@ -748,7 +752,7 @@ if (!(dir = opendir(dirpath))) { yyerror(dirpath); - return(FALSE); + return(NULL); } while ((dent = readdir(dir))) { /* Ignore files that end in '~' or have a '.' in them. */ @@ -873,12 +877,12 @@ } if (isdir) { if (!(path = switch_dir(&istack[idepth], path))) { - yyerror(path); + /* switch_dir() called yyerror() for us */ return(FALSE); } if ((fp = open_sudoers(path, FALSE, &keepopen)) == NULL) { yyerror(path); - return(FALSE); /* XXX - just to go next one? */ + return(FALSE); /* XXX - just to go next one */ } } else { if ((fp = open_sudoers(path, TRUE, &keepopen)) == NULL) { @@ -918,7 +922,7 @@ istack[idepth - 1].more = pl->next; if ((fp = open_sudoers(pl->path, FALSE, &keepopen)) == NULL) { yyerror(pl->path); - return(FALSE); /* XXX - just to go next one? */ + return(FALSE); /* XXX - just to go next one */ } efree(sudoers); sudoers = pl->path;