From: Todd C. Miller Date: Tue, 20 Jul 2010 17:12:28 +0000 (-0400) Subject: The tty_tickets option is now on by default. X-Git-Tag: SUDO_1_7_4~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73bfe4e86e037ea55e1d876332885073cb5cb465;p=sudo The tty_tickets option is now on by default. --HG-- branch : 1.7 --- diff --git a/INSTALL b/INSTALL index 0e13da081..5cb6666c2 100644 --- a/INSTALL +++ b/INSTALL @@ -485,13 +485,10 @@ The following options are also configurable at runtime: Number of minutes before the sudo password prompt times out. The default is 5, set this to 0 for no password timeout. - --with-tty-tickets - This makes sudo use a different ticket file for each user/tty combo. - Ie: instead of the ticket path being "username" it is "username/tty". - This is useful for "shared" accounts like "operator". Note that this - means that there will be more files in the timestamp dir. This is not - a problem if your system has a cron job to remove of files from /tmp - (or wherever you specified the timestamp dir to be). + --without-tty-tickets + By default, sudo uses a different ticket file for each user/tty combo. + With this option disabled, a single ticket will be used for all + of a user's login sessions. --with-insults Define this if you want to be insulted for typing an incorrect password diff --git a/UPGRADE b/UPGRADE index cde28f2a8..8f98d2f70 100644 --- a/UPGRADE +++ b/UPGRADE @@ -10,6 +10,12 @@ o Upgrading from a version prior to 1.7.4: system reboots. Time stamp files older than the boot time are ignored on systems where it is possible to determine this. + Additionally, the tty_tickets sudoers option is now enabled by + default. To restore the old behavior (single time stamp per user), + add a line like: + Defaults !tty_tickets + to sudoers or use the --without-tty-tickets configure option. + The HOME and MAIL environment variables are now reset based on the target user's password database entry when the env_reset sudoers option is enabled (which is the case in the default configuration). Users diff --git a/config.h.in b/config.h.in index 39bd71fd9..ebce631d9 100644 --- a/config.h.in +++ b/config.h.in @@ -655,6 +655,9 @@ /* Define to 1 if root should not be allowed to use sudo. */ #undef NO_ROOT_SUDO +/* Define to 1 if you want a single ticket file instead of per-tty files. */ +#undef NO_TTY_TICKETS + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT @@ -748,9 +751,6 @@ /* Define to 1 if you use GNU stow packaging. */ #undef USE_STOW -/* Define to 1 if you want a different ticket file for each tty. */ -#undef USE_TTY_TICKETS - /* Define to 1 if using a non-Unix group lookup implementation. */ #undef USING_NONUNIX_GROUPS diff --git a/configure b/configure index 0707115ce..410289203 100755 --- a/configure +++ b/configure @@ -2797,7 +2797,7 @@ runas_default=root env_editor=off editor=vi passwd_tries=3 -tty_tickets=off +tty_tickets=on insults=off root_sudo=on path_info=on @@ -4794,14 +4794,14 @@ if test "${with_tty_tickets+set}" = set; then : esac fi -if test "$tty_tickets" = "on"; then - $as_echo "#define USE_TTY_TICKETS 1" >>confdefs.h +if test "$tty_tickets" = "off"; then + $as_echo "#define NO_TTY_TICKETS 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include insults" >&5 diff --git a/configure.in b/configure.in index 9c7c149d9..9070fecb1 100644 --- a/configure.in +++ b/configure.in @@ -115,7 +115,7 @@ runas_default=root env_editor=off editor=vi passwd_tries=3 -tty_tickets=off +tty_tickets=on insults=off root_sudo=on path_info=on @@ -910,11 +910,11 @@ AC_ARG_WITH(tty-tickets, [AS_HELP_STRING([--with-tty-tickets], [use a different *) AC_MSG_ERROR(["--with-tty-tickets does not take an argument."]) ;; esac]) -if test "$tty_tickets" = "on"; then - AC_DEFINE(USE_TTY_TICKETS) - AC_MSG_RESULT(yes) -else +if test "$tty_tickets" = "off"; then + AC_DEFINE(NO_TTY_TICKETS) AC_MSG_RESULT(no) +else + AC_MSG_RESULT(yes) fi AC_MSG_CHECKING(whether to include insults) @@ -2862,6 +2862,7 @@ AH_TEMPLATE(NO_LECTURE, [Define to 1 if you don't want users to get the lecture AH_TEMPLATE(NO_PAM_SESSION, [Define to 1 if you don't want to use sudo's PAM session support]) AH_TEMPLATE(NO_ROOT_MAILER, [Define to avoid runing the mailer as root.]) AH_TEMPLATE(NO_ROOT_SUDO, [Define to 1 if root should not be allowed to use sudo.]) +AH_TEMPLATE(NO_TTY_TICKETS, [Define to 1 if you want a single ticket file instead of per-tty files.]) AH_TEMPLATE(PC_INSULTS, [Define to 1 to replace politically incorrect insults with less offensive ones.]) AH_TEMPLATE(SECURE_PATH, [Define to 1 to override the user's path with a built-in one.]) AH_TEMPLATE(SEND_MAIL_WHEN_NOT_OK, [Define to 1 to send mail when the user is not allowed to run a command.]) @@ -2872,7 +2873,6 @@ AH_TEMPLATE(SHELL_SETS_HOME, [Define to 1 if you want sudo to set $HOME in shell AH_TEMPLATE(STUB_LOAD_INTERFACES, [Define to 1 if the code in interfaces.c does not compile for you.]) AH_TEMPLATE(USE_INSULTS, [Define to 1 if you want to insult the user for entering an incorrect password.]) AH_TEMPLATE(USE_STOW, [Define to 1 if you use GNU stow packaging.]) -AH_TEMPLATE(USE_TTY_TICKETS, [Define to 1 if you want a different ticket file for each tty.]) AH_TEMPLATE(WITHOUT_PASSWD, [Define to avoid using the passwd/shadow file for authentication.]) AH_TEMPLATE(sig_atomic_t, [Define to `int' if does not define.]) AH_TEMPLATE(__signed, [Define to `signed' or nothing if compiler does not support a signed type qualifier.]) diff --git a/defaults.c b/defaults.c index 1bc99c7bd..10757eefc 100644 --- a/defaults.c +++ b/defaults.c @@ -400,7 +400,7 @@ init_defaults() #ifdef SEND_MAIL_WHEN_NOT_OK def_mail_no_perms = TRUE; #endif -#ifdef USE_TTY_TICKETS +#ifndef NO_TTY_TICKETS def_tty_tickets = TRUE; #endif #ifndef NO_LECTURE diff --git a/sudoers.cat b/sudoers.cat index abe5a674d..a9a519024 100644 --- a/sudoers.cat +++ b/sudoers.cat @@ -61,7 +61,7 @@ DDEESSCCRRIIPPTTIIOONN -1.7.4 July 19, 2010 1 +1.7.4 July 20, 2010 1 @@ -127,7 +127,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 2 +1.7.4 July 20, 2010 2 @@ -193,7 +193,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 3 +1.7.4 July 20, 2010 3 @@ -259,7 +259,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 4 +1.7.4 July 20, 2010 4 @@ -325,7 +325,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 5 +1.7.4 July 20, 2010 5 @@ -391,7 +391,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 6 +1.7.4 July 20, 2010 6 @@ -457,7 +457,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 7 +1.7.4 July 20, 2010 7 @@ -523,7 +523,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 8 +1.7.4 July 20, 2010 8 @@ -589,7 +589,7 @@ SSUUDDOOEERRSS OOPPTTIIOONNSS -1.7.4 July 19, 2010 9 +1.7.4 July 20, 2010 9 @@ -655,7 +655,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 10 +1.7.4 July 20, 2010 10 @@ -721,7 +721,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 11 +1.7.4 July 20, 2010 11 @@ -787,7 +787,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 12 +1.7.4 July 20, 2010 12 @@ -853,7 +853,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 13 +1.7.4 July 20, 2010 13 @@ -919,7 +919,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 14 +1.7.4 July 20, 2010 14 @@ -940,11 +940,10 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) available logs. 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 - user is logged in on in that directory. This flag is - _o_f_f by default. + With this flag enabled, ssuuddoo will use a file named for + the tty the user is logged in on in the user's time + stamp directory. If disabled, the time stamp of the + directory is used instead. This flag is _o_n by default. umask_override If set, ssuuddoo will set the umask as specified by _s_u_d_o_e_r_s without modification. This makes it possible to @@ -985,7 +984,8 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 15 + +1.7.4 July 20, 2010 15 @@ -1051,7 +1051,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 16 +1.7.4 July 20, 2010 16 @@ -1117,7 +1117,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 17 +1.7.4 July 20, 2010 17 @@ -1183,7 +1183,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 18 +1.7.4 July 20, 2010 18 @@ -1249,7 +1249,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 19 +1.7.4 July 20, 2010 19 @@ -1315,7 +1315,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 20 +1.7.4 July 20, 2010 20 @@ -1381,7 +1381,7 @@ EEXXAAMMPPLLEESS -1.7.4 July 19, 2010 21 +1.7.4 July 20, 2010 21 @@ -1447,7 +1447,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 22 +1.7.4 July 20, 2010 22 @@ -1513,7 +1513,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -1.7.4 July 19, 2010 23 +1.7.4 July 20, 2010 23 @@ -1579,7 +1579,7 @@ SSEECCUURRIITTYY NNOOTTEESS -1.7.4 July 19, 2010 24 +1.7.4 July 20, 2010 24 @@ -1645,7 +1645,7 @@ PPRREEVVEENNTTIINNGG SSHHEELLLL EESSCCAAPPEESS -1.7.4 July 19, 2010 25 +1.7.4 July 20, 2010 25 @@ -1711,6 +1711,6 @@ DDIISSCCLLAAIIMMEERR -1.7.4 July 19, 2010 26 +1.7.4 July 20, 2010 26 diff --git a/sudoers.man.in b/sudoers.man.in index 93724ad53..a2c162723 100644 --- a/sudoers.man.in +++ b/sudoers.man.in @@ -148,7 +148,7 @@ .\" ======================================================================== .\" .IX Title "SUDOERS @mansectform@" -.TH SUDOERS @mansectform@ "July 19, 2010" "1.7.4" "MAINTENANCE COMMANDS" +.TH SUDOERS @mansectform@ "July 20, 2010" "1.7.4" "MAINTENANCE COMMANDS" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -1006,11 +1006,11 @@ Output logs may be viewed with the \fIsudoreplay\fR\|(@mansectsu@) utility, whic can also be used to list or search the available logs. .IP "tty_tickets" 16 .IX Item "tty_tickets" -If set, users must authenticate on a per-tty basis. Normally, -\&\fBsudo\fR uses a directory in the ticket dir with the same name as -the user running it. With this flag enabled, \fBsudo\fR will use a -file named for the tty the user is logged in on in that directory. -This flag is \fI@tty_tickets@\fR by default. +If set, users must authenticate on a per-tty basis. With this flag +enabled, \fBsudo\fR will use a file named for the tty the user is +logged in on in the user's time stamp directory. If disabled, the +time stamp of the directory is used instead. This flag is +\&\fI@tty_tickets@\fR by default. .IP "umask_override" 16 .IX Item "umask_override" If set, \fBsudo\fR will set the umask as specified by \fIsudoers\fR without diff --git a/sudoers.pod b/sudoers.pod index a8c63a0e5..1a5ab483b 100644 --- a/sudoers.pod +++ b/sudoers.pod @@ -900,11 +900,11 @@ can also be used to list or search the available logs. =item tty_tickets -If set, users must authenticate on a per-tty basis. Normally, -B uses a directory in the ticket dir with the same name as -the user running it. With this flag enabled, B will use a -file named for the tty the user is logged in on in that directory. -This flag is I<@tty_tickets@> by default. +If set, users must authenticate on a per-tty basis. With this flag +enabled, B will use a file named for the tty the user is +logged in on in the user's time stamp directory. If disabled, the +time stamp of the directory is used instead. This flag is +I<@tty_tickets@> by default. =item umask_override