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

Bug#684355: unblock: autofs/5.0.6-3



On 26.09.2012 23:49, Michael Tokarev wrote:
[]
> Debdiff between wheezy and sid version will be sent in a separate
> email, since it is large.  The same but without upstream changes
> (which are easily visible in the git tree referenced above) and
> the removal of half-5.0.7 upstream diff from debian/patches is
> below.  The diffstat for this short version:
> 
>  16 files changed, 489 insertions(+), 86 deletions(-)

And ofcource I forgot to add the debdiff.  Attached now.

/mjt
diff -Nru autofs-5.0.6/debian/autofs.init autofs-5.0.7/debian/autofs.init
--- autofs-5.0.6/debian/autofs.init	2012-06-01 16:12:48.000000000 +0400
+++ autofs-5.0.7/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.7/debian/autofs.postinst
--- autofs-5.0.6/debian/autofs.postinst	2012-06-01 15:17:59.000000000 +0400
+++ autofs-5.0.7/debian/autofs.postinst	2012-09-03 08:52:07.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
@@ -19,4 +15,23 @@
   ucf /usr/share/autofs/conffiles/default/autofs /etc/default/autofs
 fi
 
+# In version 5.0.6 (wheezy), the package has been renamed
+# from autofs5 to autofs.  We properly Breaks/Replaces the old package,
+# and dummy/transitional `autofs5' is also provided, so regular upgrades
+# and new installs works.  But when a system had old autofs5 installed
+# and the user installs new autofs manually, the system ends up having
+# config files of old autofs5, together with maintainer scripts, and
+# this new autofs package.  We need to ensure that old autofs5 package
+# can be purged, but its maintscripts tries to deregister/remove
+# ucf-controlled files, -- the same as we maintain above.  We must stop
+# it from doing so, and the only way we currently know to do that is to
+# REMOVE old package's maintscripts to stop it from being executed.
+# Suggested by Ben Hutchings and Steve Langasek.  #686146
+if [ "$1" = configure ]; then
+  if postrm="$(dpkg-query -c autofs5 postrm 2>/dev/null)" && [ -n "$postrm" ]
+  then
+    rm -f "$postrm"
+  fi
+fi
+
 #DEBHELPER#
diff -Nru autofs-5.0.6/debian/autofs.postrm autofs-5.0.7/debian/autofs.postrm
--- autofs-5.0.6/debian/autofs.postrm	2012-06-01 15:17:59.000000000 +0400
+++ autofs-5.0.7/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.7/debian/changelog
--- autofs-5.0.6/debian/changelog	2012-06-02 14:47:03.000000000 +0400
+++ autofs-5.0.7/debian/changelog	2012-09-26 21:15:05.000000000 +0400
@@ -1,3 +1,75 @@
+autofs (5.0.7-1) unstable; urgency=low
+
+  * new upstream (5.0.7) release.  It brings the following changes:
+    - fixed remount deadlock, and several other locking fixes
+    - fixed umount recovery for busy direct mounts
+    - removed old code (mount-move which was fixed in 5.0.6-4 #686438)
+    - fix hosts lookup module to be more robust
+    - implemented abilty to re-read indirect maps on the fly (sighup)
+    - fixes for nfs handling to be more robust
+    - several fixes for multi-mount entries
+    - several fixes for NFSv4 mounts (Closes: #675798)
+    and a few more small/misc fixes.  This is all-bugfix changes, making
+    the code more robust and less buggy.
+  * removed --disable-mount-move configure option, not needed anymore.
+  * removed autofs-5.0.6-upstream-git.patch.
+  * refreshed manpages-hyphen.patch.
+  * added selected fixes from upstream git, up to upstream/master commit
+    9872cdbf9f1588174121e6ffe6f7509cde2d98e9:
+    - 0001-autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch (Closes: #678408)
+    - 0002-autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch
+    - 0004-autofs-5.0.7-fix-parse-buffer-initialization.patch
+    - 0005-autofs-5.0.7-fix-typo-in-automount-8.patch
+  * added remove-kernel-mount.nfs-version-check.patch to stop automount from
+    checking for very old mount.nfs or kernel.  The check isn't necessary
+    (that's pre-squeeze versions, so not even versioned Breaks are needed
+    anymore), but it is also harmful, since automount spawns mount.nfs at
+    startup and confuses upstart and systemd who start tracking wrong
+    process.  The patch just removes these checks assuming we always use
+    recent enough versions.  (Closes: #678555)
+
+ -- Michael Tokarev <mjt@tls.msk.ru>  Wed, 26 Sep 2012 21:15:05 +0400
+
+autofs (5.0.6-4) unstable; urgency=low
+
+  * configure with --disable-mount-move -- upstream even removed the
+    code in question for 5.0.7 release (Closes: #686438)
+  * remove autofs5.postrm in autofs.postinst to cope with old maintscript
+    removing our configfiles.  See comments in autofs.postinst for more
+    details (Closes: #686146)
+  * added allow-nsswitch.conf-to-not-contain-automount-lines.patch
+    (submitted to upstream too) to stop automount from complaining
+    when nsswitch.conf does not mention autofs (which is almost every
+    install anyway).  (Closes: #682266, #602090)
+
+ -- Michael Tokarev <mjt@tls.msk.ru>  Sat, 22 Sep 2012 13:07:46 +0400
+
+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, #683936)
+  * 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]
@@ -56,6 +128,7 @@
        negative lookups on *" (Closes: #617317).
     - "autofs5-ldap: simple bind auth feature request" (Closes: #595808).
     - "autofs5-ldap: SASL auth broken" (Closes: #568813).
+    - "nobind option to stop bind-mounting local dirs" (Closes: #557337).
   * package rename: dropping '5' from package names (Closes: #655351).
   * NMU changes acknowledged (Closes: #603491, #583094).
   * register /etc/default/autofs with ucf (Closes: #556961).
diff -Nru autofs-5.0.6/debian/control autofs-5.0.7/debian/control
--- autofs-5.0.6/debian/control	2012-06-01 17:28:04.000000000 +0400
+++ autofs-5.0.7/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/0001-autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch autofs-5.0.7/debian/patches/0001-autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch
--- autofs-5.0.6/debian/patches/0001-autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch	1970-01-01 03:00:00.000000000 +0300
+++ autofs-5.0.7/debian/patches/0001-autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch	2012-09-24 11:34:33.000000000 +0400
@@ -0,0 +1,33 @@
+From ebc62059641517ea4d219fa1ecc17b92acef6cc0 Mon Sep 17 00:00:00 2001
+From: Ian Kent <ikent@redhat.com>
+Date: Wed, 12 Sep 2012 09:09:49 +0800
+Subject: autofs-5.0.7 - fix nobind sun escaped map entries
+
+If a map contains a Sun colon escape to indicate the mount is a local
+file system and the "nobind" option is present there is no hostname in
+the mount location and the mount fails.
+
+diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c
+index 9b8e5f1..bbbb1de 100644
+--- a/modules/mount_nfs.c
++++ b/modules/mount_nfs.c
+@@ -263,13 +263,14 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
+ 			} else
+ 				strcpy(loc, n_addr);
+ 		} else {
+-			loc = malloc(strlen(this->name) + strlen(this->path) + 2);
++			char *host = this->name ? this->name : "localhost";
++			loc = malloc(strlen(host) + strlen(this->path) + 2);
+ 			if (!loc) {
+ 				char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
+ 				error(ap->logopt, "malloc: %s", estr);
+ 				goto forced_fail;
+ 			}
+-			strcpy(loc, this->name);
++			strcpy(loc, host);
+ 		}
+ 		strcat(loc, ":");
+ 		strcat(loc, this->path);
+-- 
+1.7.10.4
+
diff -Nru autofs-5.0.6/debian/patches/0002-autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch autofs-5.0.7/debian/patches/0002-autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch
--- autofs-5.0.6/debian/patches/0002-autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch	1970-01-01 03:00:00.000000000 +0300
+++ autofs-5.0.7/debian/patches/0002-autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch	2012-09-24 11:33:26.000000000 +0400
@@ -0,0 +1,35 @@
+From 577c70ae32a18f9aa1fdfca162aecc17cdfb5b64 Mon Sep 17 00:00:00 2001
+From: Ian Kent <ikent@redhat.com>
+Date: Wed, 12 Sep 2012 09:10:53 +0800
+Subject: autofs-5.0.7 - fix use cache entry after free mistake
+
+Fix an obvious use after free mistake in lookup_prune_one_cache().
+
+diff --git a/daemon/lookup.c b/daemon/lookup.c
+index 7909536..e3d9536 100644
+--- a/daemon/lookup.c
++++ b/daemon/lookup.c
+@@ -1103,15 +1103,18 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti
+ 		if (valid)
+ 			cache_delete(mc, key);
+ 		else if (!is_mounted(_PROC_MOUNTS, path, MNTS_AUTOFS)) {
++			dev_t devid = ap->dev;
+ 			status = CHE_FAIL;
++			if (ap->type == LKP_DIRECT)
++				devid = this->dev;
+ 			if (this->ioctlfd == -1)
+ 				status = cache_delete(mc, key);
+ 			if (status != CHE_FAIL) {
+ 				if (ap->type == LKP_INDIRECT) {
+ 					if (ap->flags & MOUNT_FLAG_GHOST)
+-						rmdir_path(ap, path, ap->dev);
++						rmdir_path(ap, path, devid);
+ 				} else
+-					rmdir_path(ap, path, this->dev);
++					rmdir_path(ap, path, devid);
+ 			}
+ 		}
+ 		cache_unlock(mc);
+-- 
+1.7.10.4
+
diff -Nru autofs-5.0.6/debian/patches/0004-autofs-5.0.7-fix-parse-buffer-initialization.patch autofs-5.0.7/debian/patches/0004-autofs-5.0.7-fix-parse-buffer-initialization.patch
--- autofs-5.0.6/debian/patches/0004-autofs-5.0.7-fix-parse-buffer-initialization.patch	1970-01-01 03:00:00.000000000 +0300
+++ autofs-5.0.7/debian/patches/0004-autofs-5.0.7-fix-parse-buffer-initialization.patch	2012-09-24 11:33:38.000000000 +0400
@@ -0,0 +1,37 @@
+From 5ca7ff3cf5619def8af62c2da6c5b4bf7e0a4dc2 Mon Sep 17 00:00:00 2001
+From: Ian Kent <ikent@redhat.com>
+Date: Wed, 12 Sep 2012 09:12:29 +0800
+Subject: autofs-5.0.7 - fix parse buffer initialization
+
+When parsing a master map entry, if the mount point path is longer than
+the following map string the lexical analyzer buffer may not have a null
+terminator where it is expected. If the map name string also contains a
+string that is the same as a map type at the end the map name the map
+name is not constructed correctly because of this lack of a string
+terminator in the buffer.
+
+diff --git a/lib/master_tok.l b/lib/master_tok.l
+index 0d6edb7..30abb15 100644
+--- a/lib/master_tok.l
++++ b/lib/master_tok.l
+@@ -74,7 +74,8 @@ int my_yyinput(char *, int);
+ #define unput(c) (*(char *) --line = c)
+ #endif
+ 
+-char buff[1024];
++#define BUFF_LEN	1024
++char buff[BUFF_LEN];
+ char *bptr;
+ char *optr = buff;
+ unsigned int tlen;
+@@ -174,6 +175,7 @@ OPTNTOUT	(-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo
+ 		*bptr = '\0';
+ 		strcpy(master_lval.strtype, buff);
+ 		bptr = buff;
++		memset(buff, 0, BUFF_LEN);
+ 		return(PATH);
+ 	}
+ 
+-- 
+1.7.10.4
+
diff -Nru autofs-5.0.6/debian/patches/0005-autofs-5.0.7-fix-typo-in-automount-8.patch autofs-5.0.7/debian/patches/0005-autofs-5.0.7-fix-typo-in-automount-8.patch
--- autofs-5.0.6/debian/patches/0005-autofs-5.0.7-fix-typo-in-automount-8.patch	1970-01-01 03:00:00.000000000 +0300
+++ autofs-5.0.7/debian/patches/0005-autofs-5.0.7-fix-typo-in-automount-8.patch	2012-09-24 11:34:52.000000000 +0400
@@ -0,0 +1,21 @@
+From 9872cdbf9f1588174121e6ffe6f7509cde2d98e9 Mon Sep 17 00:00:00 2001
+From: Ian Kent <ikent@redhat.com>
+Date: Wed, 12 Sep 2012 09:12:52 +0800
+Subject: autofs-5.0.7 - fix typo in automount(8)
+
+diff --git a/man/automount.8 b/man/automount.8
+index 0186984..dddebce 100644
+--- a/man/automount.8
++++ b/man/automount.8
+@@ -51,7 +51,7 @@ are over-ridden macro definitions of the same name specified in
+ mount entries.
+ .TP
+ .I "\-f, \-\-foreground"
+-Run the daemon in the forground and log to stderr instead of syslog."
++Run the daemon in the foreground and log to stderr instead of syslog."
+ .TP
+ .I "\-r, \-\-random-multimount-selection"
+ Enables the use of ramdom selection when choosing a host from a
+-- 
+1.7.10.4
+
diff -Nru autofs-5.0.6/debian/patches/allow-nsswitch.conf-to-not-contain-automount-lines.patch autofs-5.0.7/debian/patches/allow-nsswitch.conf-to-not-contain-automount-lines.patch
--- autofs-5.0.6/debian/patches/allow-nsswitch.conf-to-not-contain-automount-lines.patch	1970-01-01 03:00:00.000000000 +0300
+++ autofs-5.0.7/debian/patches/allow-nsswitch.conf-to-not-contain-automount-lines.patch	2012-09-22 12:53:18.000000000 +0400
@@ -0,0 +1,40 @@
+From 54c46805cf5acc36b29d4ad080f0dc3000670c33 Mon Sep 17 00:00:00 2001
+From: Michael Tokarev <mjt@tls.msk.ru>
+Date: Wed, 12 Sep 2012 19:46:03 +0400
+Subject: [PATCH] Allow nsswitch.conf to not contain automount lines
+Bug-Debian: http://bugs.debian.org/682266
+
+Current code does not allow a case when nsswitch.conf
+does not mention automount map at all, like all new
+installations.  It logs a rather unpleasant error
+message instead:
+
+ syntax error in nsswitch config near [ syntax error ]
+
+this patch has a minimal fix, to allo "file" to be empty.
+
+Whole parser in C is about 25 lines of code, the "grammar"
+is trivial, and it is better to ditch all this yacc/lex
+stuff, but that will be much more intrusive change.
+
+Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
+Cc: 682266@bugs.debian.org
+---
+ lib/nss_parse.y |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/nss_parse.y b/lib/nss_parse.y
+index a39fda4..055e9d7 100644
+--- a/lib/nss_parse.y
++++ b/lib/nss_parse.y
+@@ -72,6 +72,7 @@ file: {
+ 		nss_debug = YYDEBUG;
+ #endif
+ 	} sources NL
++	| /* empty */
+ 	;
+ 
+ sources: nss_source
+-- 
+1.7.10.4
+
diff -Nru autofs-5.0.6/debian/patches/filagdir.patch autofs-5.0.7/debian/patches/filagdir.patch
--- autofs-5.0.6/debian/patches/filagdir.patch	1970-01-01 03:00:00.000000000 +0300
+++ autofs-5.0.7/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.7/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.7/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.7/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.7/debian/patches/manpages-hyphen.patch	2012-09-24 11:20:35.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
+@@ -217,7 +217,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. The hosts map cannot be dynamically updated and requires a HUP signal
+ to be sent to the daemon for it to check hosts for an update. Due to possible
diff -Nru autofs-5.0.6/debian/patches/remove-kernel-mount.nfs-version-check.patch autofs-5.0.7/debian/patches/remove-kernel-mount.nfs-version-check.patch
--- autofs-5.0.6/debian/patches/remove-kernel-mount.nfs-version-check.patch	1970-01-01 03:00:00.000000000 +0300
+++ autofs-5.0.7/debian/patches/remove-kernel-mount.nfs-version-check.patch	2012-09-26 20:44:24.000000000 +0400
@@ -0,0 +1,102 @@
+From: Michael Tokarev <mjt@tls.msk.ru>
+Subject: remove kernel and mount.nfs version check
+Forwarded: no
+Bug-Debian: http://bugs.debian.org/678555
+Bug-Ubuntu: http://pad.lv/1016673
+
+autofs daemon checks for kernel and mount.nfs versions and uses
+slightly different code if kernel is older than 2.6.22 or mount.nfs
+does not use string options.  Both cases are of very old, pre-squeeze,
+versions.
+
+But because automount spawns mount.nfs at startup, this interferes
+with systemd and upstart daemon pid tracking mechanism (they track
+pid of mount.nfs, not automount as a result).  Fix this by removing
+the check entirely.
+
+Note that for current Debian and Ubuntu versions, no versioned Breaks
+are necessary.
+
+The patch is based on a similar patch by Dmitrijs Ledkovs.
+
+--- debian.orig/daemon/automount.c
++++ debian/daemon/automount.c
+@@ -51,9 +51,6 @@
+ const char *mapdir = AUTOFS_MAP_DIR;	/* Location of mount maps */
+ const char *confdir = AUTOFS_CONF_DIR;	/* Location of autofs config file */
+ 
+-unsigned int nfs_mount_uses_string_options = 0;
+-static struct nfs_mount_vers vers, check = {1, 1, 1};
+-
+ /* autofs fifo name prefix */
+ const char *fifodir = AUTOFS_FIFO_DIR "/autofs.fifo";
+ 
+@@ -1281,8 +1278,6 @@
+ 	if (status)
+ 		fatal(status);
+ 
+-	nfs_mount_uses_string_options = check_nfs_mount_version(&vers, &check);
+-
+ 	master_mutex_lock();
+ 	if (master->reading) {
+ 		status = pthread_mutex_unlock(&mrc.mutex);
+@@ -1941,8 +1936,6 @@
+ 
+ 	defaults_read_config(0);
+ 
+-	nfs_mount_uses_string_options = check_nfs_mount_version(&vers, &check);
+-
+ 	kpkt_len = get_kpkt_len();
+ 	timeout = defaults_get_timeout();
+ 	ghost = defaults_get_browse_mode();
+--- debian.orig/include/mounts.h
++++ debian/include/mounts.h
+@@ -75,16 +75,7 @@
+ 	struct list_head ordered;
+ };
+ 
+-
+-struct nfs_mount_vers {
+-	unsigned int major;
+-	unsigned int minor;
+-	unsigned int fix;
+-};
+ unsigned int linux_version_code(void);
+-int check_nfs_mount_version(struct nfs_mount_vers *, struct nfs_mount_vers *);
+-extern unsigned int nfs_mount_uses_string_options;
+-
+ unsigned int query_kproto_ver(void);
+ unsigned int get_kver_major(void);
+ unsigned int get_kver_minor(void);
+--- debian.orig/modules/replicated.c
++++ debian/modules/replicated.c
+@@ -953,9 +953,8 @@
+ 	 * But also allow the MOUNT_WAIT configuration parameter to override
+ 	 * the probing.
+ 	 */
+-	if (nfs_mount_uses_string_options &&
+-	    defaults_get_mount_wait() == -1 &&
+-	   (kern_vers = linux_version_code()) > KERNEL_VERSION(2, 6, 22)) {
++	/* we assume kernel and mount.nfs are recent enough */
++	if (defaults_get_mount_wait() == -1) {
+ 		if (!this)
+ 			return 1;
+ 	} else {
+--- debian.orig/lib/mounts.c
++++ debian/lib/mounts.c
+@@ -164,6 +164,7 @@
+ 	return kver.minor;
+ }
+ 
++#if 0
+ #ifdef HAVE_MOUNT_NFS
+ static int extract_version(char *start, struct nfs_mount_vers *vers)
+ {
+@@ -299,6 +300,7 @@
+ 	return 0;
+ }
+ #endif
++#endif
+ 
+ /*
+  * Make common autofs mount options string
diff -Nru autofs-5.0.6/debian/patches/series autofs-5.0.7/debian/patches/series
--- autofs-5.0.6/debian/patches/series	2012-06-01 23:24:13.000000000 +0400
+++ autofs-5.0.7/debian/patches/series	2012-09-26 19:42:52.000000000 +0400
@@ -1,6 +1,13 @@
-# upstream git patch
 #
-autofs-5.0.6-upstream-git.patch
+# selected patches from upstream git, without CHANGELOG and configure chunks
+0001-autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch
+0002-autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch
+0004-autofs-5.0.7-fix-parse-buffer-initialization.patch
+0005-autofs-5.0.7-fix-typo-in-automount-8.patch
+#
+# bugfixes forwarded to upstream
+filagdir.patch
+allow-nsswitch.conf-to-not-contain-automount-lines.patch
 #
 # Debian patches
 #
@@ -14,3 +21,5 @@
 do-not-check-for-modprobe-procfs-or-load-module.patch
 save-hesiod-libs-correctly.patch
 link-daemon-with-lpthread.patch
+fix-ldflags.patch
+remove-kernel-mount.nfs-version-check.patch
diff -Nru autofs-5.0.6/debian/rules autofs-5.0.7/debian/rules
--- autofs-5.0.6/debian/rules	2012-06-01 22:59:00.000000000 +0400
+++ autofs-5.0.7/debian/rules	2012-09-24 10:33:37.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: