From 525c6a3d94e7eca5859ffa18771f3f4d4a435a24 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 19 Feb 2018 10:59:12 -0700 Subject: [PATCH] Use /run in preference to /var/run if it exists. Bug #822 --- INSTALL | 8 ++++---- configure | 4 ++-- configure.ac | 2 +- doc/sudoers.cat | 8 ++++---- doc/sudoers.man.in | 4 +++- doc/sudoers.mdoc.in | 4 +++- m4/sudo.m4 | 2 +- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/INSTALL b/INSTALL index 5b5826684..d15290a06 100644 --- a/INSTALL +++ b/INSTALL @@ -134,11 +134,11 @@ Directory and file names: do not survive a system reboot. This is typically where the time stamp directory is located. By default, configure will use the first existing directory in the following list: - /var/run, /var/db, /var/lib, /var/adm, /usr/adm + /run /var/run, /var/db, /var/lib, /var/adm, /usr/adm This directory should be cleared when the system reboots. - On systems that lack /var/run, the default rundir and vardir - may be the same. In this case, only the ts directory inside - the rundir needs to be cleared at boot time. + On systems that lack /run or /var/run, the default rundir and + vardir may be the same. In this case, only the ts directory + inside the rundir needs to be cleared at boot time. --with-vardir=DIR Set the directory to be used for sudo-specific files that diff --git a/configure b/configure index ba8da8f6c..598170d54 100755 --- a/configure +++ b/configure @@ -25259,7 +25259,7 @@ fi $as_echo_n "checking for sudo run dir location... " >&6; } rundir="$with_rundir" if test -z "$rundir"; then - for d in /var/run /var/db /var/lib /var/adm /usr/adm; do + for d in /run /var/run /var/db /var/lib /var/adm /usr/adm; do if test -d "$d"; then rundir="$d/sudo" break @@ -28659,7 +28659,7 @@ $as_echo "$as_me: You will need to customize examples/pam.conf and install it as esac fi case "$rundir" in - /var/run*) + /run/*|/var/run/*) clear_rundir=0 ;; *) diff --git a/configure.ac b/configure.ac index d0ca58711..dda5e86fa 100644 --- a/configure.ac +++ b/configure.ac @@ -4382,7 +4382,7 @@ dnl dnl Warn user if they may need to clear rundir manually. dnl case "$rundir" in - /var/run*) + /run/*|/var/run/*) clear_rundir=0 ;; *) diff --git a/doc/sudoers.cat b/doc/sudoers.cat index ef0bb5b87..e2c9282e3 100644 --- a/doc/sudoers.cat +++ b/doc/sudoers.cat @@ -2766,9 +2766,9 @@ SSEECCUURRIITTYY NNOOTTEESS ownership of files they create. While the time stamp directory _s_h_o_u_l_d be cleared at reboot time, not all - systems contain a _/_v_a_r_/_r_u_n directory. To avoid potential problems, - ssuuddooeerrss will ignore time stamp files that date from before the machine - booted on systems where the boot time is available. + systems contain a _/_r_u_n or _/_v_a_r_/_r_u_n directory. To avoid potential + problems, ssuuddooeerrss will ignore time stamp files that date from before the + machine booted on systems where the boot time is available. Some systems with graphical desktop environments allow unprivileged users to change the system clock. Since ssuuddooeerrss relies on the system clock for @@ -2897,4 +2897,4 @@ DDIISSCCLLAAIIMMEERR file distributed with ssuuddoo or https://www.sudo.ws/license.html for complete details. -Sudo 1.8.23 January 30, 2018 Sudo 1.8.23 +Sudo 1.8.23 February 19, 2018 Sudo 1.8.23 diff --git a/doc/sudoers.man.in b/doc/sudoers.man.in index be076b99c..66e86fd7d 100644 --- a/doc/sudoers.man.in +++ b/doc/sudoers.man.in @@ -21,7 +21,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.TH "SUDOERS" "5" "January 30, 2018" "Sudo @PACKAGE_VERSION@" "File Formats Manual" +.TH "SUDOERS" "5" "February 19, 2018" "Sudo @PACKAGE_VERSION@" "File Formats Manual" .nh .if n .ad l .SH "NAME" @@ -5484,6 +5484,8 @@ unprivileged users to change the ownership of files they create. While the time stamp directory \fIshould\fR be cleared at reboot time, not all systems contain a +\fI/run\fR +or \fI/var/run\fR directory. To avoid potential problems, diff --git a/doc/sudoers.mdoc.in b/doc/sudoers.mdoc.in index 72deb07d0..d319d9af3 100644 --- a/doc/sudoers.mdoc.in +++ b/doc/sudoers.mdoc.in @@ -19,7 +19,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.Dd January 30, 2018 +.Dd February 19, 2018 .Dt SUDOERS @mansectform@ .Os Sudo @PACKAGE_VERSION@ .Sh NAME @@ -5075,6 +5075,8 @@ unprivileged users to change the ownership of files they create. While the time stamp directory .Em should be cleared at reboot time, not all systems contain a +.Pa /run +or .Pa /var/run directory. To avoid potential problems, diff --git a/m4/sudo.m4 b/m4/sudo.m4 index 78edafb0b..6eda7d87a 100644 --- a/m4/sudo.m4 +++ b/m4/sudo.m4 @@ -108,7 +108,7 @@ dnl AC_DEFUN([SUDO_RUNDIR], [AC_MSG_CHECKING(for sudo run dir location) rundir="$with_rundir" if test -z "$rundir"; then - for d in /var/run /var/db /var/lib /var/adm /usr/adm; do + for d in /run /var/run /var/db /var/lib /var/adm /usr/adm; do if test -d "$d"; then rundir="$d/sudo" break -- 2.40.0