From: Todd C. Miller Date: Wed, 14 Jul 2010 19:00:52 +0000 (-0400) Subject: Move time stamp files from /var/run/sudo to /var/{db,lib,adm}/sudo. X-Git-Tag: SUDO_1_7_4~85 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb4fac7328d4703c669a96393413ccc911f6f70f;p=sudo Move time stamp files from /var/run/sudo to /var/{db,lib,adm}/sudo. --HG-- branch : 1.7 --- diff --git a/UPGRADE b/UPGRADE index 86e646f35..3e049d226 100644 --- a/UPGRADE +++ b/UPGRADE @@ -1,9 +1,18 @@ Notes on upgrading from an older release ======================================== +o Upgrading from a version prior to 1.7.4: + + Starting with sudo 1.7.4, the time stamp files have moved from + /var/run/sudo to either /var/db/sudo, /var/lib/sudo or /var/adm/sudo. + The directories are checked for existence in that order. This + prevents users from receiving the sudo lecture every time the + system reboots. Time stamp files older than the boot time are + ignored on systems where it is possible to determine this. + o Upgrading from a version prior to 1.7.0: - Starting with sudo 1.7.0 comments in the sudoers file must not + Starting with sudo 1.7.0, comments in the sudoers file must not have a digit or minus sign immediately after the comment character ('#'). Otherwise, the comment may be interpreted as a user or group ID. @@ -73,8 +82,8 @@ o Upgrading from a version prior to 1.6.9: o Upgrading from a version prior to 1.6.8: Prior to sudo 1.6.8, if /var/run did not exist, sudo would put - the timestamp files in /tmp/.odus. As of sudo 1.6.8, the - timestamp files will be placed in /var/adm/sudo or /usr/adm/sudo + the time stamp files in /tmp/.odus. As of sudo 1.6.8, the + time stamp files will be placed in /var/adm/sudo or /usr/adm/sudo if there is no /var/run directory. This directory will be created if it does not already exist. @@ -117,10 +126,10 @@ o Upgrading from a version prior to 1.6: millert ALL=(daemon) NOPASSWD:/usr/bin/whoami, \ (root) PASSWD:/bin/ls, /sbin/dump - Additionally, sudo now uses a per-user timestamp directory - instead of a timestamp file. This allows tty timestamps to - simply be files within the user's timestamp dir. For the - default, non-tty case, the timestamp on the directory itself + Additionally, sudo now uses a per-user time stamp directory + instead of a time stamp file. This allows tty time stamps to + simply be files within the user's time stamp dir. For the + default, non-tty case, the time stamp on the directory itself is used. Also, the temporary file used by visudo is now /etc/sudoers.tmp diff --git a/aclocal.m4 b/aclocal.m4 index 1bf8a0a02..9e6eca8c0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -101,27 +101,20 @@ fi ])dnl dnl -dnl Where the timestamp files go, use /var/run/sudo if /var/run exists, -dnl else /{var,usr}/adm/sudo +dnl Where the timestamp files go. dnl AC_DEFUN(SUDO_TIMEDIR, [AC_MSG_CHECKING(for timestamp file location) -if test -n "$with_timedir"; then - AC_MSG_RESULT($with_timedir) - SUDO_DEFINE_UNQUOTED(_PATH_SUDO_TIMEDIR, "$with_timedir") - timedir="$with_timedir" -elif test -d "/var/run"; then - AC_MSG_RESULT(/var/run/sudo) - SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/var/run/sudo") - timedir="/var/run/sudo" -elif test -d "/var/adm"; then - AC_MSG_RESULT(/var/adm/sudo) - SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/var/adm/sudo") - timedir="/var/adm/sudo" -else - AC_MSG_RESULT(/usr/adm/sudo) - SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/usr/adm/sudo") - timedir="/usr/adm/sudo" +timedir="$with_timedir" +if test -z "$timedir"; then + for d in /var/db /var/lib /var/adm /usr/adm; do + if test -d "$d"; then + timedir="$d/sudo" + break; + fi + done fi +AC_MSG_RESULT([$timedir]) +SUDO_DEFINE_UNQUOTED(_PATH_SUDO_TIMEDIR, "$timedir") ])dnl dnl diff --git a/configure b/configure index 872124f2b..086998a48 100755 --- a/configure +++ b/configure @@ -2775,7 +2775,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;} # # Begin initial values for man page substitution # -timedir=/var/run/sudo +timedir=/var/adm/sudo timeout=5 password_timeout=5 sudo_umask=0022 @@ -13154,8 +13154,6 @@ done CHECKSHADOW="false" test -z "$with_pam" && AUTH_EXCL_DEF="PAM" : ${with_logincap='yes'} - # Apple sudo timedir location - : ${with_timedir='/var/db/sudo'} ;; *-*-nextstep*) # lockf() on is broken on the NeXT -- use flock instead @@ -17970,39 +17968,21 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timestamp file location" >&5 $as_echo_n "checking for timestamp file location... " >&6; } -if test -n "$with_timedir"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_timedir" >&5 -$as_echo "$with_timedir" >&6; } - cat >>confdefs.h <&5 -$as_echo "/var/run/sudo" >&6; } - cat >>confdefs.h <<\EOF -#define _PATH_SUDO_TIMEDIR "/var/run/sudo" -EOF - - timedir="/var/run/sudo" -elif test -d "/var/adm"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: /var/adm/sudo" >&5 -$as_echo "/var/adm/sudo" >&6; } - cat >>confdefs.h <<\EOF -#define _PATH_SUDO_TIMEDIR "/var/adm/sudo" -EOF - - timedir="/var/adm/sudo" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: /usr/adm/sudo" >&5 -$as_echo "/usr/adm/sudo" >&6; } - cat >>confdefs.h <<\EOF -#define _PATH_SUDO_TIMEDIR "/usr/adm/sudo" +timedir="$with_timedir" +if test -z "$timedir"; then + for d in /var/db /var/lib /var/adm /usr/adm; do + if test -d "$d"; then + timedir="$d/sudo" + break; + fi + done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $timedir" >&5 +$as_echo "$timedir" >&6; } +cat >>confdefs.h <&5 diff --git a/configure.in b/configure.in index 2307d4856..3ea79a817 100644 --- a/configure.in +++ b/configure.in @@ -92,7 +92,7 @@ AC_SUBST([editor]) # # Begin initial values for man page substitution # -timedir=/var/run/sudo +timedir=/var/adm/sudo timeout=5 password_timeout=5 sudo_umask=0022 @@ -1763,8 +1763,6 @@ case "$host" in CHECKSHADOW="false" test -z "$with_pam" && AUTH_EXCL_DEF="PAM" : ${with_logincap='yes'} - # Apple sudo timedir location - : ${with_timedir='/var/db/sudo'} ;; *-*-nextstep*) # lockf() on is broken on the NeXT -- use flock instead diff --git a/sudo.cat b/sudo.cat index 5b0d4fb76..951b18278 100644 --- a/sudo.cat +++ b/sudo.cat @@ -61,7 +61,7 @@ DDEESSCCRRIIPPTTIIOONN -1.7.4 July 12, 2010 1 +1.7.4 July 14, 2010 1 @@ -127,7 +127,7 @@ OOPPTTIIOONNSS -1.7.4 July 12, 2010 2 +1.7.4 July 14, 2010 2 @@ -193,7 +193,7 @@ SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) -1.7.4 July 12, 2010 3 +1.7.4 July 14, 2010 3 @@ -259,7 +259,7 @@ SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) -1.7.4 July 12, 2010 4 +1.7.4 July 14, 2010 4 @@ -325,7 +325,7 @@ SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) -1.7.4 July 12, 2010 5 +1.7.4 July 14, 2010 5 @@ -391,7 +391,7 @@ SSEECCUURRIITTYY NNOOTTEESS -1.7.4 July 12, 2010 6 +1.7.4 July 14, 2010 6 @@ -426,7 +426,7 @@ SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) program that ssuuddoo executes. ssuuddoo will check the ownership of its time stamp directory - (_/_v_a_r_/_r_u_n_/_s_u_d_o by default) and ignore the directory's contents if it is + (_/_v_a_r_/_a_d_m_/_s_u_d_o by default) and ignore the directory's contents if it is not owned by root or if it is writable by a user other than root. On systems that allow non-root users to give away files via _c_h_o_w_n(2), if the time stamp directory is located in a directory writable by anyone @@ -438,7 +438,7 @@ SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) by root and inaccessible by any other user, the user placing files there would be unable to get them back out. To get around this issue you can use a directory that is not world-writable for the time stamps - (_/_v_a_r_/_a_d_m_/_s_u_d_o for instance) or create _/_v_a_r_/_r_u_n_/_s_u_d_o with the + (_/_v_a_r_/_a_d_m_/_s_u_d_o for instance) or create _/_v_a_r_/_a_d_m_/_s_u_d_o with the appropriate owner (root) and permissions (0700) in the system startup files. @@ -457,7 +457,7 @@ SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) -1.7.4 July 12, 2010 7 +1.7.4 July 14, 2010 7 @@ -523,7 +523,7 @@ EENNVVIIRROONNMMEENNTT -1.7.4 July 12, 2010 8 +1.7.4 July 14, 2010 8 @@ -543,7 +543,7 @@ SUDO(1m) MAINTENANCE COMMANDS SUDO(1m) FFIILLEESS _/_e_t_c_/_s_u_d_o_e_r_s List of who can run what - _/_v_a_r_/_r_u_n_/_s_u_d_o Directory containing time stamps + _/_v_a_r_/_a_d_m_/_s_u_d_o Directory containing time stamps _/_e_t_c_/_e_n_v_i_r_o_n_m_e_n_t Initial environment for --ii mode on Linux and AIX @@ -589,7 +589,7 @@ SSEEEE AALLSSOO -1.7.4 July 12, 2010 9 +1.7.4 July 14, 2010 9 @@ -655,6 +655,6 @@ DDIISSCCLLAAIIMMEERR -1.7.4 July 12, 2010 10 +1.7.4 July 14, 2010 10 diff --git a/sudo.man.in b/sudo.man.in index 9f873c4ee..e58aa1d60 100644 --- a/sudo.man.in +++ b/sudo.man.in @@ -149,7 +149,7 @@ .\" ======================================================================== .\" .IX Title "SUDO @mansectsu@" -.TH SUDO @mansectsu@ "July 12, 2010" "1.7.4" "MAINTENANCE COMMANDS" +.TH SUDO @mansectsu@ "July 14, 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 diff --git a/sudoers.cat b/sudoers.cat index 037afadeb..211a66daa 100644 --- a/sudoers.cat +++ b/sudoers.cat @@ -1108,7 +1108,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) interpreted. Defaults to "C". timestampdir The directory in which ssuuddoo stores its timestamp files. - The default is _/_v_a_r_/_r_u_n_/_s_u_d_o. + The default is _/_v_a_r_/_a_d_m_/_s_u_d_o. timestampowner The owner of the timestamp directory and the timestamps stored therein. The default is root.