[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#684355: unblock: autofs/5.0.6-3



retitle 684355 unblock: autofs/5.0.6-3
thanks

On 09.08.2012 09:39, Michael Tokarev wrote:
> Package: release.debian.org
> Severity: normal
> User: release.debian.org@packages.debian.org
> Usertags: unblock
> 
> Please unblock package autofs
> 
> There are a few relatively small changes fixing some bugs
> and making the package more accurate.  Also, per request
> from the previous maintainer, debian/control is changed
> to list new maintainer address - this is important change
> by its own.

I uploaded the package into unstable, adding a few more
changes on the way - manpage hyphen fix and usage of hardening
flags.  The new debdiff is attached.

Please consider unblocking the package.

Thank you for your time!

/mjt
diff -Nru autofs-5.0.6/debian/autofs.init autofs-5.0.6/debian/autofs.init
--- autofs-5.0.6/debian/autofs.init	2012-06-01 16:12:48.000000000 +0400
+++ autofs-5.0.6/debian/autofs.init	2012-06-07 23:41:38.000000000 +0400
@@ -1,7 +1,5 @@
 #! /bin/sh
 #
-# rc file for automount using a Sun-style "master map".
-#
 
 ### BEGIN INIT INFO
 # Provides: autofs
@@ -17,11 +15,10 @@
 
 # Location of the automount daemon and the init directory
 #
-DAEMON=/usr/sbin/automount
-prog=`basename $DAEMON`
-DEVICE="autofs"
-NAME="autofs"
-PIDFILE="/var/run/${NAME}.pid"
+PROG=automount
+DAEMON=/usr/sbin/$PROG
+NAME=autofs
+PIDFILE="/run/$NAME.pid"
 
 test -e $DAEMON || exit 0
 
@@ -37,103 +34,78 @@
 	. /etc/default/autofs
 fi
 
+start_stop_autofs() {
+	start-stop-daemon "$@" --pidfile $PIDFILE --exec $DAEMON -- \
+		$OPTIONS --pid-file $PIDFILE
+}
+
 start() {
-	log_action_begin_msg "Starting $prog" "$prog"
+	log_action_begin_msg "Starting $PROG"
 
-	# Make sure autofs4 module is loaded
-	if ! grep -q autofs /proc/filesystems
+	if ! grep -qw autofs /proc/filesystems
 	then
-		# Try load the autofs4 module fail if we can't
-		modprobe autofs4 >/dev/null 2>&1
-		if [ $? -eq 1 ]
+		if ! modprobe autofs4 >/dev/null 2>&1
 		then
 			log_action_end_msg 1 "failed to load autofs4 module"
 			return 1
 		fi
 	elif [ -f /proc/modules ] && grep -q "^autofs[^4]" /proc/modules
 	then
-		# wrong autofs filesystem module loaded
 		log_action_end_msg 1 "autofs kernel module is loaded, autofs4 required"
 		return 1
 	fi
 
-	start-stop-daemon --start --exec $DAEMON --oknodo -- $OPTIONS --pid-file $PIDFILE
-	RETVAL=$?
-	if [ $RETVAL -eq 0 ] ; then
-		log_end_msg 0
-	else
+	if ! start_stop_autofs --start --oknodo --quiet ; then
 		log_action_end_msg 1 "no valid automount entries defined."
+		return 1
 	fi
+	log_end_msg 0
 	return 0
 }
 
 stop() {
-	log_action_begin_msg $"Stopping $prog: "
-	count=0
-	while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
-		start-stop-daemon --stop --exec $DAEMON --oknodo
-		[ -z "`pidof $prog`" ] || sleep 3
-		count=`expr $count + 1`
-	done
-	if [ -z "`pidof $prog`" ] ; then
-		RETVAL=0
-		log_action_end_msg 0
-	else
-		RETVAL=1
+	log_action_begin_msg "Stopping $PROG"
+	if ! start_stop_autofs --stop --retry 5 --oknodo --quiet ; then
 		log_action_end_msg 1
+		return 1
 	fi
-	return $RETVAL
-}
-
-restart() {
-	stop
-	start
+	log_end_msg 0
+	return 0
 }
 
 reload() {
-	pid=`pidof $prog`
-	if [ -z $pid ]; then
-		log_action_msg $"$prog not running"
-		RETVAL=1
-	else
-		kill -HUP $pid 2> /dev/null
-		log_action_msg $"Reloading maps"
-		RETVAL=0
+	log_action_begin_msg "Reloading $PROG maps"
+	if ! start_stop_autofs --stop --signal=HUP --quiet
+	then
+		log_action_end_msg 1 "$PROG not running"
+		return 1
 	fi
-	return $RETVAL
+	log_action_end_msg 0
+	return 0
 }
 
-RETVAL=0
+forcestart() {
+	OPTIONS="$OPTIONS --force"
+	start
+}
 
 case "$1" in
-	start)
-		start
-		;;
-	forcestart)
-		OPTIONS="$OPTIONS --force"
-		start
-		;;
-	stop)
-		stop
+	start|forcestart|stop|reload)
+		$1
 		;;
 	restart|force-reload)
-		restart
+		stop
+		start
 		;;
 	forcerestart)
-		OPTIONS="$OPTIONS --force"
-		restart
-		;;
-	reload)
-		reload
+		stop
+		forcestart
 		;;
 	status)
-		status_of_proc -p $PIDFILE "$DAEMON" "$prog"
+		status_of_proc -p $PIDFILE $DAEMON $PROG
 		;;
 	*)
-		echo $"Usage: $0 {start|forcestart|stop|restart|forcerestart|reload|force-reload|status}"
-		exit 1;
+		echo "Usage: $0 {start|forcestart|stop|restart|forcerestart|reload|force-reload|status}"
+		exit 1
 		;;
 esac
-
-exit $?
-
diff -Nru autofs-5.0.6/debian/autofs.postinst autofs-5.0.6/debian/autofs.postinst
--- autofs-5.0.6/debian/autofs.postinst	2012-06-01 15:17:59.000000000 +0400
+++ autofs-5.0.6/debian/autofs.postinst	2012-07-25 21:31:32.000000000 +0400
@@ -3,14 +3,10 @@
 
 if [ "$1" = "configure" ]; then
   # transfer ownership from old autofs5 package
-  # since there's no official ucfr --query, we can't know if we
-  # already transferred ownership.  So we may only always use --foce
-  #autofs5_ver=`dpkg-query -f '${Version}' -W autofs5 2>/dev/null`
-  #if dpkg --compare-versions "$autofs5_ver" "<=" 5.0.6-2~
-  #then
-    force="--force"
-  #else force=
-  #fi
+  case "$(ucfq -w /etc/default/autofs)" in
+    *:autofs5:*) force=--force ;;
+    *) force= ;;
+  esac
   for map in master net misc smb; do
     ucfr $force autofs /etc/auto.$map
     ucf /usr/share/autofs/conffiles/auto.$map /etc/auto.$map
diff -Nru autofs-5.0.6/debian/autofs.postrm autofs-5.0.6/debian/autofs.postrm
--- autofs-5.0.6/debian/autofs.postrm	2012-06-01 15:17:59.000000000 +0400
+++ autofs-5.0.6/debian/autofs.postrm	2012-06-07 23:41:38.000000000 +0400
@@ -3,9 +3,9 @@
 
 if [ "$1" = "purge" ]; then
   for CONFF in /etc/auto.master /etc/auto.net /etc/auto.misc /etc/auto.smb /etc/default/autofs; do
-    ucfr -p autofs $CONFF
-    ucf --purge $CONFF
     rm -f $CONFF $CONFF.ucf-dist $CONFF.ucf-old $CONFF.ucf-new
+    if which ucf  >/dev/null; then ucf  --purge $CONFF; fi
+    if which ucfr >/dev/null; then ucfr --purge autofs $CONFF; fi
   done
 fi
 
diff -Nru autofs-5.0.6/debian/changelog autofs-5.0.6/debian/changelog
--- autofs-5.0.6/debian/changelog	2012-06-02 14:47:03.000000000 +0400
+++ autofs-5.0.6/debian/changelog	2012-08-25 16:14:34.000000000 +0400
@@ -1,3 +1,29 @@
+autofs (5.0.6-3) unstable; urgency=low
+
+  [Michael Tokarev]
+  * almost completely rewrote the startup script, make it cleaner,
+    consistent and actually returning proper exit codes.  Removed
+    $"" constructs too, dash apparently does not understand these.
+    (Closes: #677520)
+  * transfer ownership of ucf-conffiles forcibly only if they're
+    owned by autofs5, not by any other package.
+  * run ucf --purge in postrm only if it is installed, and in the
+    right order too (Closes: #685468)
+  * added filagdir.patch - fix a typo in configure.in which prevents
+    from specifying runtime directory (Closes: #678384)
+  * use /var/run not /run for runtime files (we don't really need
+    it to be available on upgrade, before initscripts et all has
+    been replaced) (Closes: #682675)
+
+  [Dmitry Smirnov]
+  * setting current team leader as Maintainer
+  * pass CPPFLAGS to fix "hardening-no-fortify-functions"
+  * new fix-ldflags.patch to avoid dropping LDFLAGS in order to
+    fix "hardening-no-relro"
+  * updated manpages-hyphen.patch
+
+ -- Michael Tokarev <mjt@tls.msk.ru>  Sat, 25 Aug 2012 16:13:02 +0400
+
 autofs (5.0.6-2) unstable; urgency=low
 
   [Dmitry Smirnov]
diff -Nru autofs-5.0.6/debian/control autofs-5.0.6/debian/control
--- autofs-5.0.6/debian/control	2012-06-01 17:28:04.000000000 +0400
+++ autofs-5.0.6/debian/control	2012-06-07 23:39:09.000000000 +0400
@@ -1,9 +1,9 @@
 Source: autofs
 Section: utils
 Priority: extra
-Maintainer: Dmitry Smirnov <onlyjob@member.fsf.org>
+Maintainer: Michael Tokarev <mjt@tls.msk.ru>
 Uploaders: Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de>,
- Michael Tokarev <mjt@tls.msk.ru>, William Dauchy <wdauchy@gmail.com>
+ Dmitry Smirnov <onlyjob@member.fsf.org>, William Dauchy <wdauchy@gmail.com>
 Standards-Version: 3.9.3
 Build-Depends: debhelper (>= 9), autoconf, lsb-base,
  bison, flex, libhesiod-dev, libkrb5-dev, libldap-dev, libsasl2-dev, libssl-dev, libxml2-dev
diff -Nru autofs-5.0.6/debian/patches/filagdir.patch autofs-5.0.6/debian/patches/filagdir.patch
--- autofs-5.0.6/debian/patches/filagdir.patch	1970-01-01 03:00:00.000000000 +0300
+++ autofs-5.0.6/debian/patches/filagdir.patch	2012-07-25 21:45:53.000000000 +0400
@@ -0,0 +1,16 @@
+Subject: fix --with-flagdir in configure.in
+From: John Hedges <john@drystone.co.uk>
+Forwarded: yes
+Bug-Debian: http://bugs.debian.org/678384
+
+--- a/configure.in
++++ b/configure.in
+@@ -114,7 +114,7 @@
+ 	then
+ 		:
+ 	else
+-		filagdir="${withval}"
++		flagdir="${withval}"
+ 	fi
+ )
+ AC_MSG_CHECKING([for autofs flag file directory])
diff -Nru autofs-5.0.6/debian/patches/fix-ldflags.patch autofs-5.0.6/debian/patches/fix-ldflags.patch
--- autofs-5.0.6/debian/patches/fix-ldflags.patch	1970-01-01 03:00:00.000000000 +0300
+++ autofs-5.0.6/debian/patches/fix-ldflags.patch	2012-08-23 11:40:24.000000000 +0400
@@ -0,0 +1,36 @@
+Last-Update: 2012-08-23
+Author: Dmitry Smirnov <onlyjob@member.fsf.org>
+Forwarded: no
+Description: avoid dropping LDFLAGS to fix "hardening-no-relro"
+
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -24,16 +24,16 @@
+ 
+ ifdef DEBUG
+ CFLAGS    ?= -g -Wall -DDEBUG
+-LDFLAGS   = -g
++LDFLAGS   += -g
+ STRIP     = :
+ else
+ ifdef DONTSTRIP
+ CFLAGS    ?= -O2 -g
+-LDFLAGS   = -g
++LDFLAGS   += -g
+ STRIP     = :
+ else
+ CFLAGS    ?= -O2 -Wall
+-LDFLAGS   = -s
++LDFLAGS   += -s
+ STRIP     = strip --strip-debug
+ endif
+ endif
+@@ -42,7 +42,7 @@
+ CXX       = g++
+ CXXFLAGS  = $(CFLAGS)
+ LD        = ld
+-SOLDFLAGS = -shared
++SOLDFLAGS = $(LDFLAGS) -shared
+ 
+ CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64
+ LDFLAGS += -lpthread
diff -Nru autofs-5.0.6/debian/patches/manpages-hyphen.patch autofs-5.0.6/debian/patches/manpages-hyphen.patch
--- autofs-5.0.6/debian/patches/manpages-hyphen.patch	2012-06-01 15:17:59.000000000 +0400
+++ autofs-5.0.6/debian/patches/manpages-hyphen.patch	2012-08-23 11:40:24.000000000 +0400
@@ -1,9 +1,8 @@
-Last-Update: 2012-04-24
+Last-Update: 2012-08-23
 Author: Dmitry Smirnov <onlyjob@member.fsf.org>
 Forwarded: no
 Description: minor lintianisation patch for W:'hyphen-used-as-minus-sign'
 
-
 --- a/man/autofs.5
 +++ b/man/autofs.5
 @@ -72,13 +72,13 @@
@@ -68,3 +67,14 @@
  .BR automount (8).
  .SS Executable Maps
  A map can be marked as executable. A
+--- a/man/auto.master.5.in
++++ b/man/auto.master.5.in
+@@ -218,7 +218,7 @@
+ .B LOGGING
+ set default log level "none", "verbose" or "debug" (program default "none").
+ .SH BUILTIN MAP -hosts
+-If "-hosts" is given as the map then accessing a key under the mount point
++If "\-hosts" is given as the map then accessing a key under the mount point
+ which corresponds to a hostname will allow access to the exports of that
+ host.
+ .P
diff -Nru autofs-5.0.6/debian/patches/series autofs-5.0.6/debian/patches/series
--- autofs-5.0.6/debian/patches/series	2012-06-01 23:24:13.000000000 +0400
+++ autofs-5.0.6/debian/patches/series	2012-08-23 11:40:24.000000000 +0400
@@ -2,6 +2,9 @@
 #
 autofs-5.0.6-upstream-git.patch
 #
+# bugfixes forwarded to upstream
+filagdir.patch
+#
 # Debian patches
 #
 11default_automaster_location.patch
@@ -14,3 +17,4 @@
 do-not-check-for-modprobe-procfs-or-load-module.patch
 save-hesiod-libs-correctly.patch
 link-daemon-with-lpthread.patch
+fix-ldflags.patch
diff -Nru autofs-5.0.6/debian/rules autofs-5.0.6/debian/rules
--- autofs-5.0.6/debian/rules	2012-06-01 22:59:00.000000000 +0400
+++ autofs-5.0.6/debian/rules	2012-08-23 11:40:24.000000000 +0400
@@ -20,14 +20,14 @@
 	MOUNT=/bin/mount UMOUNT=/bin/umount \
 	MOUNT_NFS=/sbin/mount.nfs \
 	E2FSCK=/sbin/fsck.ext2 E3FSCK=/sbin/fsck.ext3 E4FSCK=/sbin/fsck.ext4 \
-	initdir=/etc/init.d piddir=/run \
+	initdir=/etc/init.d piddir=/var/run \
 	dh_auto_configure -- \
 		--enable-forced-shutdown \
 		--enable-ignore-busy \
 		--mandir=/usr/share/man \
 		--with-confdir=/etc/default \
 		--with-mapdir=/etc \
-		--with-fifodir=/run --with-flagdir=/run \
+		--with-fifodir=/var/run --with-flagdir=/var/run \
 		--with-hesiod \
 		--with-openldap \
 		--with-sasl
@@ -37,6 +37,10 @@
 	sed -i 's/.*HAVE_SLOPPY_MOUNT.*/#define HAVE_SLOPPY_MOUNT 1/' \
 		include/config.h
 
+override_dh_auto_build:
+	CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
+	dh_auto_build
+
 override_dh_install:
 	dh_install
 	# remove hesiod and ldap modules, they're in separate packages

Reply to: