[26749] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r25727 - trunk/debathena/config/reactivate/debian

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Thu Aug 16 13:25:14 2012

Date: Thu, 16 Aug 2012 13:25:12 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201208161725.q7GHPCJu022531@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: jdreed
Date: 2012-08-16 13:25:12 -0400 (Thu, 16 Aug 2012)
New Revision: 25727

Added:
   trunk/debathena/config/reactivate/debian/debathena-reactivate.postrm
Removed:
   trunk/debathena/config/reactivate/debian/su-error
   trunk/debathena/config/reactivate/debian/sudo-error
Modified:
   trunk/debathena/config/reactivate/debian/changelog
   trunk/debathena/config/reactivate/debian/debathena-reactivate.install
   trunk/debathena/config/reactivate/debian/debathena-reactivate.postinst
   trunk/debathena/config/reactivate/debian/debathena-reactivate.preinst
   trunk/debathena/config/reactivate/debian/snapshot-run
   trunk/debathena/config/reactivate/debian/sudo-warning
   trunk/debathena/config/reactivate/debian/transform_su.debathena
Log:
In reactivate:
  * Cleanup from r24057, where we had to special-case quickstations via
    su-error and sudo-error, and cleanup those conffiles in a Debian-esque
    way
  * Add a trailing NUL to the end of sudo-warning to workaround a bug
    in sudo 1.8.3p1 (fixed upstream, but not in Precise)


Modified: trunk/debathena/config/reactivate/debian/changelog
===================================================================
--- trunk/debathena/config/reactivate/debian/changelog	2012-08-16 15:09:18 UTC (rev 25726)
+++ trunk/debathena/config/reactivate/debian/changelog	2012-08-16 17:25:12 UTC (rev 25727)
@@ -1,3 +1,13 @@
+debathena-reactivate (2.0.40) unstable; urgency=low
+
+  * Cleanup from r24057, where we had to special-case quickstations via
+    su-error and sudo-error, and cleanup those conffiles in a Debian-esque
+    way
+  * Add a trailing NUL to the end of sudo-warning to workaround a bug
+    in sudo 1.8.3p1 (fixed upstream, but not in Precise)
+
+ -- Jonathan Reed <jdreed@mit.edu>  Thu, 16 Aug 2012 13:23:17 -0400
+
 debathena-reactivate (2.0.39) unstable; urgency=low
 
   * Yes, the pam_env hack is still needed.

Modified: trunk/debathena/config/reactivate/debian/debathena-reactivate.install
===================================================================
--- trunk/debathena/config/reactivate/debian/debathena-reactivate.install	2012-08-16 15:09:18 UTC (rev 25726)
+++ trunk/debathena/config/reactivate/debian/debathena-reactivate.install	2012-08-16 17:25:12 UTC (rev 25727)
@@ -6,8 +6,6 @@
 debian/01debathena-reactivate-cleanup usr/share/debathena-lightdm-config/session-cleanup.d
 debian/updatedb.findutils.cron.local etc
 debian/policy-rc.d usr/sbin
-debian/sudo-error etc/athena
-debian/su-error etc/athena
 debian/sudo-warning etc/athena
 debian/su-warning etc/athena
 debian/login etc/schroot/chroot.d

Modified: trunk/debathena/config/reactivate/debian/debathena-reactivate.postinst
===================================================================
--- trunk/debathena/config/reactivate/debian/debathena-reactivate.postinst	2012-08-16 15:09:18 UTC (rev 25726)
+++ trunk/debathena/config/reactivate/debian/debathena-reactivate.postinst	2012-08-16 17:25:12 UTC (rev 25727)
@@ -68,6 +68,26 @@
 
 . /usr/lib/debathena-cupsys-config/restart-cups.sh
 
+if dpkg-maintscript-helper supports rm_conffile 2> /dev/null; then
+    dpkg-maintscript-helper rm_conffile /etc/athena/sudo-error 2.0.39 -- "$@"
+    dpkg-maintscript-helper rm_conffile /etc/athena/su-error 2.0.39 -- "$@"
+else
+    # From http://wiki.debian.org/DpkgConffileHandling
+    rm_conffile() {
+        local PKGNAME="$1" # Unused
+        local CONFFILE="$2"
+        if [ -f "$CONFFILE".dpkg-del ]; then
+            rm -f "$CONFFILE".dpkg-del
+        fi
+    }
+    case "$1" in
+        configure)
+	    if dpkg --compare-versions "$2" le-nl 2.0.39; then
+		rm_conffile debathena-reactivate "/etc/athena/sudo-error"
+		rm_conffile debathena-reactivate "/etc/athena/su-error"
+	    fi
+    esac
+fi
 
 case "$1" in
     configure)
@@ -78,8 +98,8 @@
         done
         cat >>/etc/sudoers <<EOF
 ### BEGIN debathena-reactivate
-Defaults lecture_file=/etc/athena/sudo-error, lecture=always
 Defaults:%admin lecture_file=/etc/athena/sudo-warning, lecture=once
+Defaults:%sudo lecture_file=/etc/athena/sudo-warning, lecture=once
 ### END debathena-reactivate
 EOF
 

Added: trunk/debathena/config/reactivate/debian/debathena-reactivate.postrm
===================================================================
--- trunk/debathena/config/reactivate/debian/debathena-reactivate.postrm	                        (rev 0)
+++ trunk/debathena/config/reactivate/debian/debathena-reactivate.postrm	2012-08-16 17:25:12 UTC (rev 25727)
@@ -0,0 +1,60 @@
+#!/bin/sh
+# postrm script for debathena-reactivate
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+if dpkg-maintscript-helper supports rm_conffile 2> /dev/null; then
+    dpkg-maintscript-helper rm_conffile /etc/athena/sudo-error 2.0.39 -- "$@"
+    dpkg-maintscript-helper rm_conffile /etc/athena/su-error 2.0.39 -- "$@"
+else
+    # From http://wiki.debian.org/DpkgConffileHandling
+    rm_conffile() {
+        local PKGNAME="$1" # Unused
+        local CONFFILE="$2"
+        
+        if [ -f "$CONFFILE".dpkg-del ]; then
+            mv -f "$CONFFILE".dpkg-del "$CONFFILE"
+        fi
+    }
+    # See policy 6.6, item 3 and 5
+    case "$1" in
+        abort-install|abort-upgrade)
+            if dpkg --compare-versions "$2" le-nl 2.0.39; then
+		rm_conffile debathena-reactivate "/etc/athena/sudo-error"
+		rm_conffile debathena-reactivate "/etc/athena/su-error"
+            fi
+    esac
+fi
+
+
+case "$1" in
+    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0

Modified: trunk/debathena/config/reactivate/debian/debathena-reactivate.preinst
===================================================================
--- trunk/debathena/config/reactivate/debian/debathena-reactivate.preinst	2012-08-16 15:09:18 UTC (rev 25726)
+++ trunk/debathena/config/reactivate/debian/debathena-reactivate.preinst	2012-08-16 17:25:12 UTC (rev 25727)
@@ -62,6 +62,37 @@
     fi
 }
 	
+if dpkg-maintscript-helper supports rm_conffile 2> /dev/null; then
+    dpkg-maintscript-helper rm_conffile /etc/athena/sudo-error 2.0.39 -- "$@"
+    dpkg-maintscript-helper rm_conffile /etc/athena/su-error 2.0.39 -- "$@"
+else
+    # From http://wiki.debian.org/DpkgConffileHandling
+    rm_conffile() {
+	local PKGNAME="$1"
+	local CONFFILE="$2"
+	
+	[ -e "$CONFFILE" ] || return 0
+	
+	local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
+	local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
+            sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
+	if [ "$md5sum" != "$old_md5sum" ]; then
+            echo "Obsolete conffile $CONFFILE has been modified by you."
+            echo "Saving as $CONFFILE.dpkg-bak ..."
+            mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
+	else
+            echo "Removing obsolete conffile $CONFFILE ..."
+            mv -f "$CONFFILE" "$CONFFILE".dpkg-del
+	fi
+    }
+    case "$1" in
+	install|upgrade)
+	    if dpkg --compare-versions "$2" le-nl 2.0.39; then
+		rm_conffile debathena-reactivate "/etc/athena/sudo-error"
+		rm_conffile debathena-reactivate "/etc/athena/su-error"
+	    fi
+    esac
+fi
 
 case "$1" in
     install|upgrade)

Modified: trunk/debathena/config/reactivate/debian/snapshot-run
===================================================================
--- trunk/debathena/config/reactivate/debian/snapshot-run	2012-08-16 15:09:18 UTC (rev 25726)
+++ trunk/debathena/config/reactivate/debian/snapshot-run	2012-08-16 17:25:12 UTC (rev 25727)
@@ -44,8 +44,6 @@
     schr env NSS_NONLOCAL_IGNORE=ignore getent group "$group" >/dev/null 2>&1 && schr adduser "$USER" "$group"
 done
 
-schr sed -i "/su-error/d" "/etc/pam.d/su.debathena"
-
 schr touch /ClusterLogin
 
 for daemon in $daemons; do
@@ -63,9 +61,8 @@
 
 # Run the session
 #
-# We wrap the target command in sudo because it runs initgroups(3)
-# /after/ being chrooted, which puts users back in the groups we
-# added them to
+# We wrap the target command in a session-wrapper so that it can run
+# initgroups(3), which puts users back in the groups we added them to
 
 # Workaround for stupidity, see #928 for details
 # Remove this once we're running pam-afs-session 2.4

Modified: trunk/debathena/config/reactivate/debian/sudo-warning
===================================================================
--- trunk/debathena/config/reactivate/debian/sudo-warning	2012-08-16 15:09:18 UTC (rev 25726)
+++ trunk/debathena/config/reactivate/debian/sudo-warning	2012-08-16 17:25:12 UTC (rev 25727)
@@ -7,3 +7,4 @@
 report a bug via the "sendbug" command.
 Enter your Athena password below.
 
+
\ No newline at end of file

Modified: trunk/debathena/config/reactivate/debian/transform_su.debathena
===================================================================
--- trunk/debathena/config/reactivate/debian/transform_su.debathena	2012-08-16 15:09:18 UTC (rev 25726)
+++ trunk/debathena/config/reactivate/debian/transform_su.debathena	2012-08-16 17:25:12 UTC (rev 25727)
@@ -1,4 +1,3 @@
 #!/usr/bin/perl -0p
-s|^\@include common-auth$|auth [default=die] pam_echo.so file=/etc/athena/su-error
-auth optional pam_echo.so file=/etc/athena/su-warning
+s|^\@include common-auth$|auth optional pam_echo.so file=/etc/athena/su-warning
 $&|m or die;


home help back first fref pref prev next nref lref last post