fix postinst code issue when /var/lib/sudo already exists
authorBdale Garbee <bdale@gag.com>
Thu, 9 Sep 2010 19:54:43 +0000 (13:54 -0600)
committerBdale Garbee <bdale@gag.com>
Thu, 9 Sep 2010 19:54:43 +0000 (13:54 -0600)
debian/changelog
debian/sudo-ldap.postinst
debian/sudo.postinst

index 9c7c80a57c9890b37803c0842d451f2bcb09fefe..06a38d17bc9b0934ce66dd9eafaaa3c26f6abc89 100644 (file)
@@ -1,3 +1,10 @@
+sudo (1.7.4p4-3) unstable; urgency=low
+
+  * make postinst clause for handling /var/run -> /var/lib transition less
+    fragile, closes: #585514
+
+ -- Bdale Garbee <bdale@gag.com>  Thu, 09 Sep 2010 13:54:25 -0600
+
 sudo (1.7.4p4-2) unstable; urgency=low
 
   * add a NEWS item about change in $HOME handling that impacts programs
index 9a539d90285f60d636ef72d40c98fcfb210f721a..c70c938cd1137cb884be11de3c8713cdadd37e42 100644 (file)
@@ -33,9 +33,9 @@ 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');
+    system ('mkdir -p /var/lib/sudo');
+    system ('(cd /var/run/sudo ; tar cf - *) | (cd /var/lib/sudo ; tar xf -)');
+    system ('rm -rf /var/run/sudo');
 }
 
 # make sure sudoers has the correct permissions and owner/group
index 10dc14a8bc0cd8c8ace37b1dc662b7d15e911978..a6f64ceb20b8fdba0bb7669b1b7d113480489cc6 100644 (file)
@@ -33,9 +33,9 @@ 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');
+    system ('mkdir -p /var/lib/sudo');
+    system ('(cd /var/run/sudo ; tar cf - *) | (cd /var/lib/sudo ; tar xf -)');
+    system ('rm -rf /var/run/sudo');
 }
 
 # make sure sudoers has the correct permissions and owner/group