Merge branch 'upstream'
authorBdale Garbee <bdale@gag.com>
Thu, 15 May 2008 06:45:29 +0000 (00:45 -0600)
committerBdale Garbee <bdale@gag.com>
Thu, 15 May 2008 06:45:29 +0000 (00:45 -0600)
Conflicts:

CHANGES
Makefile.in
config.sub
configure
configure.in
env.c
ldap.c
sample.sudoers
sudo.c
sudo.cat
sudo.man.in
sudo.pod
sudoers.cat
sudoers.man.in
sudoers.pod
version.h
visudo.cat
visudo.man.in

1  2 
Makefile.in
configure
sample.sudoers
sudo.c
sudo.cat
sudo.man.in
sudoers.man.in
sudoers.pod
visudo.man.in

diff --combined Makefile.in
index 89f8b2aa60b406e73ef5ae963af952021a95365f,c47e1c4414b688aac6845d4f847c1aa865bd522c..b7b686d093e0986328cc441628b33fb80d824c88
@@@ -20,7 -20,7 +20,7 @@@
  #
  # @configure_input@
  #
- # $Sudo: Makefile.in,v 1.246.2.30 2008/03/23 19:43:51 millert Exp $
+ # $Sudo: Makefile.in,v 1.246.2.31 2008/05/08 19:48:23 millert Exp $
  #
  
  #### Start of system configuration section. ####
@@@ -133,7 -133,7 +133,7 @@@ TESTOBJS = interfaces.o testsudoers.o $
  
  LIBOBJS = @LIBOBJS@ @ALLOCA@
  
- VERSION = 1.6.9p15
+ VERSION = 1.6.9p16
  
  DISTFILES = $(SRCS) $(HDRS) BUGS CHANGES HISTORY INSTALL INSTALL.configure \
              LICENSE Makefile.in PORTING README README.LDAP \
@@@ -194,9 -194,9 +194,9 @@@ sudo_noexec.la: sudo_noexec.l
  @DEV@PARSESRCS = sudo.tab.h sudo.tab.c lex.yy.c def_data.c def_data.h
  
  # Uncomment the following if you intend to modify parse.yacc
 -@DEV@sudo.tab.c sudo.tab.h: parse.yacc
 -@DEV@ rm -f sudo.tab.h sudo.tab.c
 -@DEV@ $(YACC) -d -b sudo $(srcdir)/parse.yacc
 +sudo.tab.c sudo.tab.h: parse.yacc
 +      rm -f sudo.tab.h sudo.tab.c
 +      $(YACC) -d -b sudo $(srcdir)/parse.yacc
  
  # Uncomment the following if you intend to modify parse.lex
  @DEV@lex.yy.c: parse.lex
@@@ -327,7 -327,7 +327,7 @@@ install-sudoers
            $(INSTALL) -O $(sudoers_uid) -G $(sudoers_gid) -M $(sudoers_mode) \
                $(srcdir)/sudoers $(DESTDIR)$(sudoersdir)/sudoers
  
 -install-man:
 +install-man: sudo.$(mantype) visudo.$(mantype) sudoers.$(mantype)
        $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudo.$(mantype) $(DESTDIR)$(mandirsu)/sudo.$(mansectsu)
        @rm -f $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)
        ln $(DESTDIR)$(mandirsu)/sudo.$(mansectsu) $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)
@@@ -394,6 -394,8 +394,6 @@@ bindist
          fi ; \
          cp $(srcdir)/INSTALL.binary $$tdir/INSTALL ; \
          sh ./config.status --file=Makefile.binary && cp Makefile.binary $$tdir/Makefile ; \
 -        strip sudo ; \
 -        strip visudo ; \
          cd tmp.$$ARCH && tar Ocf ../sudo-$(VERSION)-$$ARCH.tar sudo-$(VERSION) && cd .. ; \
          gzip --best sudo-$(VERSION)-$$ARCH.tar ; \
          rm -rf tmp.$$ARCH ; \
diff --combined configure
index 405f391e1bc0bbe322982596abe8846852b757af,b786dde0bc869d45b537b1fa0a98cf1d786702f7..c80fc9bd3cf8f96d1df06a75584e3597f0b774b3
+++ b/configure
@@@ -1444,7 -1444,7 +1444,7 @@@ Fine tuning of the installation directo
    --bindir=DIR           user executables [EPREFIX/bin]
    --sbindir=DIR          system admin executables [EPREFIX/sbin]
    --libexecdir=DIR       program executables [EPREFIX/libexec]
 -  --sysconfdir=DIR       read-only single-machine data [etc]
 +  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
    --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
    --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
    --libdir=DIR           object code libraries [EPREFIX/lib]
@@@ -18310,7 -18310,7 +18310,7 @@@ cat >>conftest.$ac_ext <<_ACEO
  int
  main ()
  {
- DIR *d; (void)dirfd(d);
+ DIR d; (void)dirfd(&d);
    ;
    return 0;
  }
  echo "$as_me: WARNING: unable to find socket() trying -lsocket -lnsl" >&2;}
  { echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
  echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; }
- if test "${ac_cv_lib_socket_socket+set}" = set; then
+ if test "${ac_cv_lib_socket_socket_lnsl+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    ac_check_lib_save_LIBS=$LIBS
@@@ -18661,21 -18661,21 +18661,21 @@@ eval "echo \"\$as_me:$LINENO: $ac_try_e
         test ! -s conftest.err
         } && test -s conftest$ac_exeext &&
         $as_test_x conftest$ac_exeext; then
-   ac_cv_lib_socket_socket=yes
+   ac_cv_lib_socket_socket_lnsl=yes
  else
    echo "$as_me: failed program was:" >&5
  sed 's/^/| /' conftest.$ac_ext >&5
  
-       ac_cv_lib_socket_socket=no
+       ac_cv_lib_socket_socket_lnsl=no
  fi
  
  rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
        conftest$ac_exeext conftest.$ac_ext
  LIBS=$ac_check_lib_save_LIBS
  fi
- { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
- echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; }
- if test $ac_cv_lib_socket_socket = yes; then
+ { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket_lnsl" >&5
+ echo "${ECHO_T}$ac_cv_lib_socket_socket_lnsl" >&6; }
+ if test $ac_cv_lib_socket_socket_lnsl = yes; then
    NET_LIBS="${NET_LIBS} -lsocket -lnsl"; LIBS="${LIBS} -lsocket -lnsl"
  fi
  
  echo "$as_me: WARNING: unable to find inet_addr() trying -lsocket -lnsl" >&2;}
  { echo "$as_me:$LINENO: checking for inet_addr in -lsocket" >&5
  echo $ECHO_N "checking for inet_addr in -lsocket... $ECHO_C" >&6; }
- if test "${ac_cv_lib_socket_inet_addr+set}" = set; then
+ if test "${ac_cv_lib_socket_inet_addr_lnsl+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    ac_check_lib_save_LIBS=$LIBS
@@@ -19030,21 -19030,21 +19030,21 @@@ eval "echo \"\$as_me:$LINENO: $ac_try_e
         test ! -s conftest.err
         } && test -s conftest$ac_exeext &&
         $as_test_x conftest$ac_exeext; then
-   ac_cv_lib_socket_inet_addr=yes
+   ac_cv_lib_socket_inet_addr_lnsl=yes
  else
    echo "$as_me: failed program was:" >&5
  sed 's/^/| /' conftest.$ac_ext >&5
  
-       ac_cv_lib_socket_inet_addr=no
+       ac_cv_lib_socket_inet_addr_lnsl=no
  fi
  
  rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
        conftest$ac_exeext conftest.$ac_ext
  LIBS=$ac_check_lib_save_LIBS
  fi
- { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_inet_addr" >&5
- echo "${ECHO_T}$ac_cv_lib_socket_inet_addr" >&6; }
- if test $ac_cv_lib_socket_inet_addr = yes; then
+ { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_inet_addr_lnsl" >&5
+ echo "${ECHO_T}$ac_cv_lib_socket_inet_addr_lnsl" >&6; }
+ if test $ac_cv_lib_socket_inet_addr_lnsl = yes; then
    NET_LIBS="${NET_LIBS} -lsocket -lnsl"; LIBS="${LIBS} -lsocket -lnsl"
  fi
  
@@@ -20588,7 -20588,7 +20588,7 @@@ if test ${with_SecurID-'no'} != "no"; t
      #
      { echo "$as_me:$LINENO: checking for SD_Init in -laceclnt" >&5
  echo $ECHO_N "checking for SD_Init in -laceclnt... $ECHO_C" >&6; }
- if test "${ac_cv_lib_aceclnt_SD_Init+set}" = set; then
+ if test "${ac_cv_lib_aceclnt_SD_Init_______lpthread_______+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    ac_check_lib_save_LIBS=$LIBS
@@@ -20636,21 -20636,21 +20636,21 @@@ eval "echo \"\$as_me:$LINENO: $ac_try_e
         test ! -s conftest.err
         } && test -s conftest$ac_exeext &&
         $as_test_x conftest$ac_exeext; then
-   ac_cv_lib_aceclnt_SD_Init=yes
+   ac_cv_lib_aceclnt_SD_Init_______lpthread_______=yes
  else
    echo "$as_me: failed program was:" >&5
  sed 's/^/| /' conftest.$ac_ext >&5
  
-       ac_cv_lib_aceclnt_SD_Init=no
+       ac_cv_lib_aceclnt_SD_Init_______lpthread_______=no
  fi
  
  rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
        conftest$ac_exeext conftest.$ac_ext
  LIBS=$ac_check_lib_save_LIBS
  fi
- { echo "$as_me:$LINENO: result: $ac_cv_lib_aceclnt_SD_Init" >&5
- echo "${ECHO_T}$ac_cv_lib_aceclnt_SD_Init" >&6; }
- if test $ac_cv_lib_aceclnt_SD_Init = yes; then
+ { echo "$as_me:$LINENO: result: $ac_cv_lib_aceclnt_SD_Init_______lpthread_______" >&5
+ echo "${ECHO_T}$ac_cv_lib_aceclnt_SD_Init_______lpthread_______" >&6; }
+ if test $ac_cv_lib_aceclnt_SD_Init_______lpthread_______ = yes; then
  
            AUTH_OBJS="$AUTH_OBJS securid5.o";
            SUDO_LIBS="${SUDO_LIBS} -laceclnt -lpthread"
@@@ -21132,9 -21132,10 +21132,10 @@@ echo "${ECHO_T}no" >&6; 
  fi
  
  rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-                 { echo "$as_me:$LINENO: checking for main in -lkrb" >&5
+                 as_ac_Lib=`echo "ac_cv_lib_krb_main$K4LIBS" | $as_tr_sh`
+ { echo "$as_me:$LINENO: checking for main in -lkrb" >&5
  echo $ECHO_N "checking for main in -lkrb... $ECHO_C" >&6; }
- if test "${ac_cv_lib_krb_main+set}" = set; then
+ if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    ac_check_lib_save_LIBS=$LIBS
@@@ -21173,27 -21174,29 +21174,29 @@@ eval "echo \"\$as_me:$LINENO: $ac_try_e
         test ! -s conftest.err
         } && test -s conftest$ac_exeext &&
         $as_test_x conftest$ac_exeext; then
-   ac_cv_lib_krb_main=yes
+   eval "$as_ac_Lib=yes"
  else
    echo "$as_me: failed program was:" >&5
  sed 's/^/| /' conftest.$ac_ext >&5
  
-       ac_cv_lib_krb_main=no
+       eval "$as_ac_Lib=no"
  fi
  
  rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
        conftest$ac_exeext conftest.$ac_ext
  LIBS=$ac_check_lib_save_LIBS
  fi
- { echo "$as_me:$LINENO: result: $ac_cv_lib_krb_main" >&5
- echo "${ECHO_T}$ac_cv_lib_krb_main" >&6; }
- if test $ac_cv_lib_krb_main = yes; then
+ ac_res=`eval echo '${'$as_ac_Lib'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+ echo "${ECHO_T}$ac_res" >&6; }
+ if test `eval echo '${'$as_ac_Lib'}'` = yes; then
    K4LIBS="-lkrb $K4LIBS"
  else
  
-       { echo "$as_me:$LINENO: checking for main in -lkrb4" >&5
+       as_ac_Lib=`echo "ac_cv_lib_krb4_main$K4LIBS" | $as_tr_sh`
+ { echo "$as_me:$LINENO: checking for main in -lkrb4" >&5
  echo $ECHO_N "checking for main in -lkrb4... $ECHO_C" >&6; }
- if test "${ac_cv_lib_krb4_main+set}" = set; then
+ if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    ac_check_lib_save_LIBS=$LIBS
@@@ -21232,21 -21235,22 +21235,22 @@@ eval "echo \"\$as_me:$LINENO: $ac_try_e
         test ! -s conftest.err
         } && test -s conftest$ac_exeext &&
         $as_test_x conftest$ac_exeext; then
-   ac_cv_lib_krb4_main=yes
+   eval "$as_ac_Lib=yes"
  else
    echo "$as_me: failed program was:" >&5
  sed 's/^/| /' conftest.$ac_ext >&5
  
-       ac_cv_lib_krb4_main=no
+       eval "$as_ac_Lib=no"
  fi
  
  rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
        conftest$ac_exeext conftest.$ac_ext
  LIBS=$ac_check_lib_save_LIBS
  fi
- { echo "$as_me:$LINENO: result: $ac_cv_lib_krb4_main" >&5
- echo "${ECHO_T}$ac_cv_lib_krb4_main" >&6; }
- if test $ac_cv_lib_krb4_main = yes; then
+ ac_res=`eval echo '${'$as_ac_Lib'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+ echo "${ECHO_T}$ac_res" >&6; }
+ if test `eval echo '${'$as_ac_Lib'}'` = yes; then
    K4LIBS="-lkrb4 $K4LIBS"
  else
    K4LIBS="-lkrb $K4LIBS"
  done
  
  
-     SUDO_LIBS="${SUDO_LIBS}${LDAP_LIBS}"
+     SUDO_LIBS="${SUDO_LIBS} ${LDAP_LIBS}"
      LIBS="$_LIBS"
      LDFLAGS="$_LDFLAGS"
      # XXX - OpenLDAP has deprecated ldap_get_values()
diff --combined sample.sudoers
index 0cac2c1850d1a64d0d2d36e9ad65cc83d39cc554,06823019b23585cb609ea3e506d5845245e39446..29d88c97775b4f933388cc5e689a93fa9f67782a
@@@ -35,16 -35,16 +35,16 @@@ Host_Alias CDROM = orion, perseus, herc
  # Cmnd alias specification
  ##
  Cmnd_Alias    DUMPS = /usr/sbin/dump, /usr/sbin/rdump, /usr/sbin/restore, \
 -                      /usr/sbin/rrestore, /usr/bin/mt
 -Cmnd_Alias    KILL = /usr/bin/kill
 +                      /usr/sbin/rrestore, /bin/mt
 +Cmnd_Alias    KILL = /bin/kill
  Cmnd_Alias    PRINTING = /usr/sbin/lpc, /usr/bin/lprm
- Cmnd_Alias    SHUTDOWN = /sbin/shutdown
- Cmnd_Alias    HALT = /sbin/halt
- Cmnd_Alias    REBOOT = /sbin/reboot
- Cmnd_Alias    SHELLS = /sbin/sh, /bin/sh, /bin/csh, /usr/bin/ksh, \
-                        /usr/bin/tcsh, /usr/bin/rsh, \
-                        /usr/bin/zsh
- Cmnd_Alias    SU = /bin/su
+ Cmnd_Alias    SHUTDOWN = /usr/sbin/shutdown
+ Cmnd_Alias    HALT = /usr/sbin/halt
+ Cmnd_Alias    REBOOT = /usr/sbin/reboot
+ Cmnd_Alias    SHELLS = /sbin/sh, /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, \
+                        /usr/local/bin/tcsh, /usr/bin/rsh, \
+                        /usr/local/bin/zsh
+ Cmnd_Alias    SU = /usr/bin/su
  Cmnd_Alias    VIPW = /usr/sbin/vipw, /usr/bin/passwd, /usr/bin/chsh, \
                       /usr/bin/chfn
  
@@@ -82,7 -82,7 +82,7 @@@ operator      ALL = DUMPS, KILL, SHUTDOWN, H
                sudoedit /etc/printcap, /usr/oper/bin/
  
  # joe may su only to operator
 -joe           ALL = /usr/bin/su operator
 +joe           ALL = /bin/su operator
  
  # pete may change passwords for anyone but root on the hp snakes
  pete          HPPA = /usr/bin/passwd [A-z]*, !/usr/bin/passwd root
@@@ -96,13 -96,13 +96,13 @@@ jim                +biglab = AL
  
  # users in the secretaries netgroup need to help manage the printers
  # as well as add and remove users
 -+secretaries  ALL = PRINTING, /usr/bin/adduser, /usr/bin/rmuser
 ++secretaries  ALL = PRINTING, /usr/sbin/adduser, /usr/bin/rmuser
  
  # fred can run commands as oracle or sybase without a password
  fred          ALL = (DB) NOPASSWD: ALL
  
  # on the alphas, john may su to anyone but root and flags are not allowed
 -john          ALPHA = /usr/bin/su [!-]*, !/usr/bin/su *root*
 +john          ALPHA = /bin/su [!-]*, !/bin/su *root*
  
  # jen can run anything on all machines except the ones
  # in the "SERVERS" Host_Alias
diff --combined sudo.c
index 372727a33ceb13927c7e98371ba7effbd394aa9c,aec3acf6bc6f2d74b48fe96d8f29077fae528bc3..f051d5ae9455ad766c4a7093f82ae67855074765
--- 1/sudo.c
--- 2/sudo.c
+++ b/sudo.c
  #include "version.h"
  
  #ifndef lint
- __unused __unused static const char rcsid[] = "$Sudo: sudo.c,v 1.369.2.38 2008/03/05 19:34:49 millert Exp $";
+ __unused __unused static const char rcsid[] = "$Sudo: sudo.c,v 1.369.2.39 2008/04/10 17:56:05 millert Exp $";
  #endif /* lint */
  
  /*
@@@ -280,7 -280,7 +280,7 @@@ main(argc, argv, envp
  
        /* Local sudoers file overrides LDAP if we have a match. */
        v = sudoers_lookup(pwflag);
-       if (ISSET(v, VALIDATE_OK))
+       if (validated == VALIDATE_ERROR || ISSET(v, VALIDATE_OK))
            validated = v;
      }
  #else
@@@ -526,18 -526,22 +526,17 @@@ init_vars(sudo_mode, envp
       * "host" is the (possibly fully-qualified) hostname and
       * "shost" is the unqualified form of the hostname.
       */
 +    sudo_user.host_fqdn_queried = FALSE;
      nohostname = gethostname(thost, sizeof(thost));
      if (nohostname)
        user_host = user_shost = "localhost";
      else {
        user_host = estrdup(thost);
-       if ((p = strchr(user_host, '.'))) {
-           *p = '\0';
-           user_shost = estrdup(user_host);
-           *p = '.';
+       if (def_fqdn) {
+           /* Defer call to set_fqdn() until log_error() is safe. */
+           user_shost = user_host;
        } else {
 -          if ((p = strchr(user_host, '.'))) {
 -              *p = '\0';
 -              user_shost = estrdup(user_host);
 -              *p = '.';
 -          } else {
 -              user_shost = user_host;
 -          }
 +          user_shost = user_host;
        }
      }
  
      if (nohostname)
        log_error(USE_ERRNO|MSG_ONLY, "can't get hostname");
  
-     /* We don't query FQDN yet, it might get disabled later. Querying is done
-      * when host matching is executed and def_fqdn still true */
      set_runaspw(*user_runas);         /* may call log_error() */
      if (*user_runas[0] == '#' && runas_pw->pw_name && runas_pw->pw_name[0])
        *user_runas = estrdup(runas_pw->pw_name);
@@@ -1216,9 -1217,8 +1212,37 @@@ set_fqdn(
      } else {
        user_shost = user_host;
      }
 +    sudo_user.host_fqdn_queried = TRUE;
 +}
 +
++/*
++ * Get passwd entry for the user we are going to run commands as.
++ * By default, this is "root".  Updates runas_pw as a side effect.
++ */
++int
++set_runaspw(user)
++    char *user;
++{
++    if (runas_pw != NULL) {
++      if (user_runas != &def_runas_default)
++          return(TRUE);               /* don't override -u option */
++      efree(runas_pw);
++    }
++    if (*user == '#') {
++      runas_pw = sudo_getpwuid(atoi(user + 1));
++      if (runas_pw == NULL) {
++          runas_pw = emalloc(sizeof(struct passwd));
++          (void) memset((VOID *)runas_pw, 0, sizeof(struct passwd));
++          runas_pw->pw_uid = atoi(user + 1);
++      }
++    } else {
++      runas_pw = sudo_getpwnam(user);
++      if (runas_pw == NULL)
++          log_error(NO_MAIL|MSG_ONLY, "no passwd entry for %s!", user);
++    }
++    return(TRUE);
+ }
  /*
   * Get passwd entry for the user we are going to run commands as.
   * By default, this is "root".  Updates runas_pw as a side effect.
diff --combined sudo.cat
index c86ab458bef048a4979e81b0067f2bd741e6956e,c75e94b6e26a7a218d3be71304d4fb52ab0344c1..1bb8ece41eb622d3caf1ac091f32476a2ab26f96
+++ b/sudo.cat
@@@ -61,7 -61,7 +61,11 @@@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\b
  
  
  
++<<<<<<< HEAD:sudo.cat
 +1.6.9p15                  March 23, 2008                        1
++=======
+ 1.6.9p16                   May  8, 2008                         1
++>>>>>>> 17fe41bae8a65fb88683c9795414556ed9b636e9:sudo.cat
  
  
  
@@@ -127,7 -127,7 +131,11 @@@ O\bOP\bPT\bTI\bIO\bON\bNS\b
  
  
  
++<<<<<<< HEAD:sudo.cat
 +1.6.9p15                  March 23, 2008                        2
++=======
+ 1.6.9p16                   May  8, 2008                         2
++>>>>>>> 17fe41bae8a65fb88683c9795414556ed9b636e9:sudo.cat
  
  
  
@@@ -193,7 -193,7 +201,11 @@@ SUDO(1m)               MAINTENANCE COMM
  
  
  
++<<<<<<< HEAD:sudo.cat
 +1.6.9p15                  March 23, 2008                        3
++=======
+ 1.6.9p16                   May  8, 2008                         3
++>>>>>>> 17fe41bae8a65fb88683c9795414556ed9b636e9:sudo.cat
  
  
  
@@@ -259,7 -259,7 +271,11 @@@ SUDO(1m)               MAINTENANCE COMM
  
  
  
++<<<<<<< HEAD:sudo.cat
 +1.6.9p15                  March 23, 2008                        4
++=======
+ 1.6.9p16                   May  8, 2008                         4
++>>>>>>> 17fe41bae8a65fb88683c9795414556ed9b636e9:sudo.cat
  
  
  
@@@ -325,7 -325,7 +341,11 @@@ S\bSE\bEC\bCU\bUR\bRI\bIT\bTY\bY N\bNO\bOT\bTE\bES\b
  
  
  
++<<<<<<< HEAD:sudo.cat
 +1.6.9p15                  March 23, 2008                        5
++=======
+ 1.6.9p16                   May  8, 2008                         5
++>>>>>>> 17fe41bae8a65fb88683c9795414556ed9b636e9:sudo.cat
  
  
  
@@@ -391,7 -391,7 +411,11 @@@ SUDO(1m)               MAINTENANCE COMM
  
  
  
++<<<<<<< HEAD:sudo.cat
 +1.6.9p15                  March 23, 2008                        6
++=======
+ 1.6.9p16                   May  8, 2008                         6
++>>>>>>> 17fe41bae8a65fb88683c9795414556ed9b636e9:sudo.cat
  
  
  
@@@ -457,7 -457,7 +481,11 @@@ F\bFI\bIL\bLE\bES\b
  
  
  
++<<<<<<< HEAD:sudo.cat
 +1.6.9p15                  March 23, 2008                        7
++=======
+ 1.6.9p16                   May  8, 2008                         7
++>>>>>>> 17fe41bae8a65fb88683c9795414556ed9b636e9:sudo.cat
  
  
  
@@@ -523,7 -523,7 +551,11 @@@ C\bCA\bAV\bVE\bEA\bAT\bTS\b
  
  
  
++<<<<<<< HEAD:sudo.cat
 +1.6.9p15                  March 23, 2008                        8
++=======
+ 1.6.9p16                   May  8, 2008                         8
++>>>>>>> 17fe41bae8a65fb88683c9795414556ed9b636e9:sudo.cat
  
  
  
@@@ -589,6 -589,6 +621,10 @@@ D\bDI\bIS\bSC\bCL\bLA\bAI\bIM\bME\bER\b
  
  
  
++<<<<<<< HEAD:sudo.cat
 +1.6.9p15                  March 23, 2008                        9
++=======
+ 1.6.9p16                   May  8, 2008                         9
++>>>>>>> 17fe41bae8a65fb88683c9795414556ed9b636e9:sudo.cat
  
  
diff --combined sudo.man.in
index f6c44278dc50958a0acad589f2f9f3b2037ba1d8,81933d94115abc0e86f4b770b8507156bca21450..c607c77932fa0af9c254e768bd6129f26a7e4aa9
@@@ -18,7 -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.man.in,v 1.29.2.25 2008/03/23 19:43:51 millert Exp $
+ .\" $Sudo: sudo.man.in,v 1.29.2.26 2008/05/08 19:48:23 millert Exp $
  .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
  .\"
  .\" Standard preamble:
  ..
  .\" Set up some character translations and predefined strings.  \*(-- will
  .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
- .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
- .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
- .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
- .\" nothing in troff, for use with C<>.
- .tr \(*W-
+ .\" double quote, and \*(R" will give a right double quote.  | will give a
+ .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
+ .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
+ .\" expand to `' in nroff, nothing in troff, for use with C<>.
+ .tr \(*W-|\(bv\*(Tr
  .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  .ie n \{\
  .    ds -- \(*W-
  .\" ========================================================================
  .\"
  .IX Title "SUDO @mansectsu@"
- .TH SUDO @mansectsu@ "March 23, 2008" "1.6.9p15" "MAINTENANCE COMMANDS"
+ .TH SUDO @mansectsu@ "May  8, 2008" "1.6.9p16" "MAINTENANCE COMMANDS"
  .SH "NAME"
  sudo, sudoedit \- execute a command as another user
  .SH "SYNOPSIS"
@@@ -469,8 -469,8 +469,8 @@@ and, as such, it is not possible for \f
  To prevent command spoofing, \fBsudo\fR checks \*(L".\*(R" and "" (both denoting
  current directory) last when searching for a command in the user's
  \&\s-1PATH\s0 (if one or both are in the \s-1PATH\s0).  Note, however, that the
 -actual \f(CW\*(C`PATH\*(C'\fR environment variable is \fInot\fR modified and is passed
 -unchanged to the program that \fBsudo\fR executes.
 +\&\f(CW\*(C`PATH\*(C'\fR environment variable is further modified in Debian because of
 +the use of the \fI\s-1SECURE_PATH\s0\fR build option.
  .PP
  \&\fBsudo\fR will check the ownership of its timestamp directory
  (\fI@timedir@\fR by default) and ignore the directory's contents if
@@@ -579,19 -579,19 +579,19 @@@ To list the home directory of user yazz
  file system holding ~yazza is not exported as root:
  .PP
  .Vb 1
 -\& $ sudo -u yazza ls ~yazza
 +\& $ sudo \-u yazza ls ~yazza
  .Ve
  .PP
  To edit the \fIindex.html\fR file as user www:
  .PP
  .Vb 1
 -\& $ sudo -u www vi ~www/htdocs/index.html
 +\& $ sudo \-u www vi ~www/htdocs/index.html
  .Ve
  .PP
  To shutdown a machine:
  .PP
  .Vb 1
 -\& $ sudo shutdown -r +15 "quick reboot"
 +\& $ sudo shutdown \-r +15 "quick reboot"
  .Ve
  .PP
  To make a usage listing of the directories in the /home
@@@ -599,17 -599,13 +599,17 @@@ partition.  Note that this runs the com
  to make the \f(CW\*(C`cd\*(C'\fR and file redirection work.
  .PP
  .Vb 1
 -\& $ sudo sh -c "cd /home ; du -s * | sort -rn > USAGE"
 +\& $ sudo sh \-c "cd /home ; du \-s * | sort \-rn > USAGE"
  .Ve
  .SH "SEE ALSO"
  .IX Header "SEE ALSO"
  \&\fIgrep\fR\|(1), \fIsu\fR\|(1), \fIstat\fR\|(2),
  @LCMAN@\&\fIlogin_cap\fR\|(3),
  \&\fIpasswd\fR\|(@mansectform@), \fIsudoers\fR\|(5), \fIvisudo\fR\|(@mansectsu@)
 +.PP
 +The file /usr/share/doc/sudo/OPTIONS describes the options used for building
 +the Debian version of sudo, some of which change default behaviors documented
 +elsewhere in this document.
  .SH "AUTHORS"
  .IX Header "AUTHORS"
  Many people have worked on \fBsudo\fR over the years; this
diff --combined sudoers.man.in
index 0093c0f418781e53f3cc3e841ad0de80e9b1b19e,1bb168ab21c4c905f5b67dfd090a26cb5f942a06..023bd461a751441661942b122b5857c5934aab65
@@@ -18,7 -18,7 +18,7 @@@
  .\" 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.45.2.27 2008/03/23 19:43:51 millert Exp $
+ .\" $Sudo: sudoers.man.in,v 1.45.2.28 2008/05/08 19:48:23 millert Exp $
  .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
  .\"
  .\" Standard preamble:
  .\" ========================================================================
  .\"
  .IX Title "SUDOERS @mansectform@"
- .TH SUDOERS @mansectform@ "March 23, 2008" "1.6.9p15" "MAINTENANCE COMMANDS"
+ .TH SUDOERS @mansectform@ "May  8, 2008" "1.6.9p16" "MAINTENANCE COMMANDS"
  .SH "NAME"
  sudoers \- list of which users may execute what
  .SH "DESCRIPTION"
@@@ -917,12 -917,6 +917,12 @@@ be run as (defaults to root
  .el .IP "\f(CW%u\fR" 4
  .IX Item "%u"
  expanded to the invoking user's login name
 +.ie n .IP "%p" 4
 +.el .IP "\f(CW%p\fR" 4
 +.IX Item "%p"
 +expanded to the user whose password is asked for (respects the presence of the
 +rootpw, targetpw or runaspw options in the configuration)
 +
  .ie n .IP "\*(C`%%\*(C'" 4
  .el .IP "\f(CW\*(C`%%\*(C'\fR" 4
  .IX Item "%%"
@@@ -1027,36 -1021,32 +1027,83 @@@ The default value is \fIany\fR
  .IP "logfile" 12
  .IX Item "logfile"
  Path to the \fBsudo\fR log file (not the syslog log file).  Setting a path
 +turns on logging to a file; negating this option turns it off.
 +By default, \fBsudo\fR logs via syslog.
 +.IP "mailerflags" 12
 +.IX Item "mailerflags"
 +Flags to use when invoking mailer. Defaults to \fB\-t\fR.
 +.IP "mailerpath" 12
 +.IX Item "mailerpath"
 +Path to mail program used to send warning mail.
 +Defaults to the path to sendmail found at configure time.
 +.IP "mailto" 12
 +.IX Item "mailto"
 +Address to send warning and error mail to.  The address should
 +be enclosed in double quotes (\f(CW\*(C`"\*(C'\fR) to protect against \fBsudo\fR
 +interpreting the \f(CW\*(C`@\*(C'\fR sign.  Defaults to \f(CW\*(C`@mailto@\*(C'\fR.
 +.IP "exempt_group" 12
 +.IX Item "exempt_group"
 +Users in this group are exempt from password and \s-1PATH\s0 requirements.
 +On Debian systems, this is set to the group 'sudo' by default. 
 +.IP "syslog" 12
 +.IX Item "syslog"
 +Syslog facility if syslog is being used for logging (negate to
 +disable syslog logging).  Defaults to \f(CW\*(C`@logfac@\*(C'\fR.
 +.IP "verifypw" 12
 +.IX Item "verifypw"
 +This option controls when a password will be required when a user runs
 +\&\fBsudo\fR with the \fB\-v\fR flag.  It has the following possible values:
 +.RS 12
 +.IP "all" 8
 +.IX Item "all"
 +All the user's \fIsudoers\fR entries for the current host must have
++the \f(CW\*(C`NOPASSWD\*(C'\fR flag set to avoid entering a password.
++.IP "always" 8
++.IX Item "always"
++The user must always enter a password to use the \fB\-l\fR flag.
++.IP "any" 8
++.IX Item "any"
++At least one of the user's \fIsudoers\fR entries for the current host
++must have the \f(CW\*(C`NOPASSWD\*(C'\fR flag set to avoid entering a password.
++.IP "never" 8
++.IX Item "never"
++The user need never enter a password to use the \fB\-l\fR flag.
++.RE
++.RS 12
++.Sp
++If no value is specified, a value of \fIany\fR is implied.
++Negating the option results in a value of \fInever\fR being used.
++The default value is \fIany\fR.
++.RE
++.IP "logfile" 12
++.IX Item "logfile"
++Path to the \fBsudo\fR log file (not the syslog log file).  Setting a path
+ turns on logging to a file; negating this option turns it off.
+ By default, \fBsudo\fR logs via syslog.
+ .IP "mailerflags" 12
+ .IX Item "mailerflags"
+ Flags to use when invoking mailer. Defaults to \fB\-t\fR.
+ .IP "mailerpath" 12
+ .IX Item "mailerpath"
+ Path to mail program used to send warning mail.
+ Defaults to the path to sendmail found at configure time.
+ .IP "mailto" 12
+ .IX Item "mailto"
+ Address to send warning and error mail to.  The address should
+ be enclosed in double quotes (\f(CW\*(C`"\*(C'\fR) to protect against \fBsudo\fR
+ interpreting the \f(CW\*(C`@\*(C'\fR sign.  Defaults to \f(CW\*(C`@mailto@\*(C'\fR.
+ .IP "syslog" 12
+ .IX Item "syslog"
+ Syslog facility if syslog is being used for logging (negate to
+ disable syslog logging).  Defaults to \f(CW\*(C`@logfac@\*(C'\fR.
+ .IP "verifypw" 12
+ .IX Item "verifypw"
+ This option controls when a password will be required when a user runs
+ \&\fBsudo\fR with the \fB\-v\fR flag.  It has the following possible values:
+ .RS 12
+ .IP "all" 8
+ .IX Item "all"
+ All the user's \fIsudoers\fR entries for the current host must have
  the \f(CW\*(C`NOPASSWD\*(C'\fR flag set to avoid entering a password.
  .IP "always" 8
  .IX Item "always"
diff --combined sudoers.pod
index e132b21e4d37261b7296d281c23b875b08b70bf2,f65db6b51de6e8c318041b52a00468812f00feeb..5f25ce3f29b60bcfb6c7a21ef82171a9ea2d27bb
@@@ -93,7 -93,7 +93,7 @@@ C<Host_Alias> and C<Cmnd_Alias>
  
   Cmnd_Alias ::= NAME '=' Cmnd_List
  
 - NAME ::= [A-Z]([A-Z][0-9]_)*
 + NAME ::= [A-Z]([a-z][A-Z][0-9]_)*
  
  Each I<alias> definition is of the form
  
@@@ -437,12 -437,12 +437,36 @@@ B<Flags>
  
  =over 16
  
--=item always_set_home
++=item mail_badpass
  
--If set, B<sudo> will set the C<HOME> environment variable to the home
--directory of the target user (which is root unless the B<-u> option is used).
--This effectively means that the B<-H> flag is always implied.
--This flag is I<off> by default.
++Send mail to the I<mailto> user if the user running B<sudo> does not
++enter the correct password.  This flag is I<off> by default.
++
++=item mail_no_host
++
++If set, mail will be sent to the I<mailto> user if the invoking
++user exists in the I<sudoers> file, but is not allowed to run
++commands on the current host.  This flag is I<@mail_no_host@> by default.
++
++=item mail_no_perms
++
++If set, mail will be sent to the I<mailto> user if the invoking
++user is allowed to use B<sudo> but the command they are trying is not
++listed in their I<sudoers> file entry or is explicitly denied.
++This flag is I<@mail_no_perms@> by default.
++
++=item mail_no_user
++
++If set, mail will be sent to the I<mailto> user if the invoking
++user is not in the I<sudoers> file.  This flag is I<@mail_no_user@>
++by default.
++
++=item noexec
++
++If set, all commands run via B<sudo> will behave as if the C<NOEXEC>
++tag has been set, unless overridden by a C<EXEC> tag.  See the
++description of I<NOEXEC and EXEC> below as well as the L<PREVENTING SHELL
++ESCAPES> section at the end of this manual.  This flag is I<off> by default.
  
  =item authenticate
  
@@@ -479,11 -479,8 +503,8 @@@ Set this flag if you want to put fully 
  I<sudoers> file.  I.e., instead of myhost you would use myhost.mydomain.edu.
  You may still use the short form if you wish (and even mix the two).
  Beware that turning on I<fqdn> requires B<sudo> to make DNS lookups
- which may make affect B<sudo> performance if DNS stops working (for example
- if the machine is not plugged into the network).  The default behavior for
- Debian has been modified to minimize the potential of a problem, but there
- may still be some cases in which lack of working DNS might make sudo work
- very slowly.  Also note that
+ which may make B<sudo> unusable if DNS stops working (for example
+ if the machine is not plugged into the network).  Also note that
  you must use the host's official name as DNS knows it.  That is,
  you may not use a host alias (C<CNAME> entry) due to performance
  issues and the fact that there is no way to get all aliases from
@@@ -989,8 -986,8 +1010,8 @@@ B<Lists that can be used in a boolean c
  
  =item env_check
  
Like I<env_keep>, but listed environment variables are taken from the user's environment if
- the variable's value does B<not> contain C<%> or C</> characters.  This can
Environment variables to be removed from the user's environment if
+ the variable's value contains C<%> or C</> 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
@@@ -1004,10 -1001,7 +1025,10 @@@ the I<-V> option
  
  =item env_delete
  
 -Environment variables to be removed from the user's environment.
 +
 +Not effective due to security issues: only variables listed in 
 +I<env_keep> or I<env_check> can be passed through B<sudo>!
 +
  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 C<=>, C<+=>, C<-=>, and
@@@ -1019,8 -1013,8 +1040,8 @@@ as B<sudo>)
  
  =item env_keep
  
 -Environment variables to be preserved in the user's environment
 -when the I<env_reset> option is in effect.  This allows fine-grained
 +Environment variables to be preserved in the user's environment.
 +This allows fine-grained
  control over the environment B<sudo>-spawned processes will receive.
  The argument may be a double-quoted, space-separated list or a
  single value without double-quotes.  The list can be replaced, added
@@@ -1063,17 -1057,11 +1084,20 @@@ important.  In general, you should stru
  the C<Host_Alias>, C<User_Alias>, and C<Cmnd_Alias> specifications
  come first, followed by any C<Default_Entry> lines, and finally the
  C<Runas_Alias> and user specifications.  The basic rule of thumb
- is that you cannot reference an Alias that has not already been defined.
+ is you cannot reference an Alias that has not already been defined.
+ Below are example I<sudoers> entries.  Admittedly, some of
+ these are a bit contrived.  First, we define our I<aliases>:
  
 +Below are example I<sudoers> entries.  Admittedly, some of
 +these are a bit contrived.  First, we allow a few environment
 +variables to pass and then define our I<aliases>:
 +
 + # Run X applications through sudo; HOME is used to find .Xauthority file
 + # Note that some programs may use HOME for other purposes too and
 + # this may lead to privilege escalation!
 + Defaults env_keep = "DISPLAY HOME"
 + 
   # User alias specification
   User_Alias   FULLTIMERS = millert, mikef, dowdy
   User_Alias   PARTTIMERS = bostley, jwfox, crawl
diff --combined visudo.man.in
index 06877715a0440b6717c62e901e63c5c989608222,5275ffeec9d3c7235e5c8d5e6b0017fce866bb73..1655714f48f38e3af4381c9471be212b34964ea3
@@@ -17,7 -17,7 +17,7 @@@
  .\" Agency (DARPA) and Air Force Research Laboratory, Air Force
  .\" Materiel Command, USAF, under agreement number F39502-99-1-0512.
  .\" 
- .\" $Sudo: visudo.man.in,v 1.20.2.20 2008/03/23 19:43:51 millert Exp $
+ .\" $Sudo: visudo.man.in,v 1.20.2.21 2008/05/08 19:48:24 millert Exp $
  .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
  .\"
  .\" Standard preamble:
  .\" ========================================================================
  .\"
  .IX Title "VISUDO @mansectsu@"
- .TH VISUDO @mansectsu@ "March 23, 2008" "1.6.9p15" "MAINTENANCE COMMANDS"
+ .TH VISUDO @mansectsu@ "May  8, 2008" "1.6.9p16" "MAINTENANCE COMMANDS"
  .SH "NAME"
  visudo \- edit the sudoers file
  .SH "SYNOPSIS"
@@@ -165,19 -165,15 +165,19 @@@ edited you will receive a message to tr
  .PP
  There is a hard-coded list of editors that \fBvisudo\fR will use set
  at compile-time that may be overridden via the \fIeditor\fR \fIsudoers\fR
 -\&\f(CW\*(C`Default\*(C'\fR variable.  This list defaults to the path to \fIvi\fR\|(1) on
 -your system, as determined by the \fIconfigure\fR script.  Normally,
 -\&\fBvisudo\fR does not honor the \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR environment
 +\&\f(CW\*(C`Default\*(C'\fR variable.  
 +On Debian systems, this list defaults to /usr/bin/editor, which is meant to
 +be a system-wide default editor chosen through the alternatives system.
 +Normally, \&\fBvisudo\fR does not honor the \f(CW\*(C`VISUAL\*(C'\fR or 
 +\f(CW\*(C`EDITOR\*(C'\fR environment
  variables unless they contain an editor in the aforementioned editors
  list.  However, if \fBvisudo\fR is configured with the \fI\-\-with\-enveditor\fR
  flag or the \fIenv_editor\fR \f(CW\*(C`Default\*(C'\fR variable is set in \fIsudoers\fR,
  \&\fBvisudo\fR will use any the editor defines by \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR.
  Note that this can be a security hole since it allows the user to
  execute any program they wish simply by setting \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR.
 +Despite this potential risk, sudo on Debian is compiled with the
 +\fI\-\-with\-enveditor\fR flag.
  .PP
  \&\fBvisudo\fR parses the \fIsudoers\fR file after the edit and will
  not save the changes if there is a syntax error.  Upon finding