From a6aa7f24d10d68ee2ca443679ca02ef97d899404 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Fri, 11 Jun 2010 11:09:15 -0600 Subject: [PATCH] handle move of state directory better in upgrades --- debian/README.Debian | 5 ----- debian/changelog | 9 +++++++++ debian/sudo-ldap.postinst | 8 ++++++++ debian/sudo.postinst | 8 ++++++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/debian/README.Debian b/debian/README.Debian index a07d3d4..a81d9e3 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -47,8 +47,3 @@ about, here's a succinct and humorous take on it... http://www.xkcd.com/c149.html - - - - - - - -If you choose to run with the RAMRUN option set in /etc/default/rcS, you may -grow weary of being lectured after each reboot. If so, adding 'lecture never' -to sudoers may make you happier. See the sudoers(5) man page for more info. diff --git a/debian/changelog b/debian/changelog index 9e1ccca..6442531 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +sudo (1.7.2p7-2) UNRELEASED; urgency=low + + * handle transition of /var/run/sudo to /var/lib/sudo better, to avoid + re-lecturing existing users, and to clean up after ourselves on upgrade, + and remove the RAMRUN section from README.Debian since the new state dir + should fix the original problem, closes: #585514 + + -- Bdale Garbee Thu, 10 Jun 2010 15:42:14 -0600 + sudo (1.7.2p7-1) unstable; urgency=high * new upstream release with security fix for secure path (CVE-2010-1646), diff --git a/debian/sudo-ldap.postinst b/debian/sudo-ldap.postinst index 59d46a0..9a539d9 100644 --- a/debian/sudo-ldap.postinst +++ b/debian/sudo-ldap.postinst @@ -30,6 +30,14 @@ if ( ! -f "/etc/sudoers") { } +# handle state directory transition from /var/run/sudo to /var/lib/sudo, +# moving any existing content over to avoid re-lecturing existing users +if ( -d "/var/run/sudo") { + system ('mkdir -p /var/lib/sudo'); + system ('mv /var/run/sudo/* /var/lib/sudo/'); + system ('rmdir /var/run/sudo'); +} + # make sure sudoers has the correct permissions and owner/group system ('chown root:root /etc/sudoers'); system ('chmod 440 /etc/sudoers'); diff --git a/debian/sudo.postinst b/debian/sudo.postinst index 2f4e54a..10dc14a 100644 --- a/debian/sudo.postinst +++ b/debian/sudo.postinst @@ -30,6 +30,14 @@ if ( ! -f "/etc/sudoers") { } +# handle state directory transition from /var/run/sudo to /var/lib/sudo, +# moving any existing content over to avoid re-lecturing existing users +if ( -d "/var/run/sudo") { + system ('mkdir -p /var/lib/sudo'); + system ('mv /var/run/sudo/* /var/lib/sudo/'); + system ('rmdir /var/run/sudo'); +} + # make sure sudoers has the correct permissions and owner/group system ('chown root:root /etc/sudoers'); system ('chmod 440 /etc/sudoers'); -- 2.30.2