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

Bug#280809: autofs: options are disregarded



On Thu, Nov 11, 2004 at 03:15:05PM -0500, Matthias G. Imhof wrote:
> We are using NIS maps. For remote login, the rsize and wsize needs to be
> reduced. In earlier versions of autofs, option in /etc/auto.master were
> honored.

They are still honored, but they do not seem to be honored on NIS maps. Could
you please test the attached patch (which copies options from auto.master
into the NIS maps) and see if it works for you? (I don't have access to a NIS
setup, so I can't do testing except with a simulated ypcat.)

/* Steinar */
-- 
Homepage: http://www.sesse.net/
--- debian/autofs/etc/init.d/autofs	2004-12-08 00:53:16.000000000 +0100
+++ /etc/init.d/autofs	2004-12-08 01:25:29.000000000 +0100
@@ -105,15 +105,23 @@
     else
         map="$1"
     fi
-    /usr/bin/ypcat -k "$map" 2> /dev/null | sed -e '/^#/d' -e '/^$/d'
+    
+    # Append the map's options at the _start_ if there are any options already
+    # (ie. myopt -> $2,myopt), otherwise just append them at the end.
+    /usr/bin/ypcat -k "$map" 2> /dev/null |
+      sed -e '/^#/d' -e '/^$/d' \
+          -e "s/^[ \t]*\([^ \t]\+\)[ \t]\+\([^ \t]\+\)[ \t]\+\([^ \t]\+\)/\1 \2 $2,\3/" \
+	  -e "s/^[ \t]*\([^ \t]\+\)[ \t]\+\([^ \t]\+\)[ \t]*$/\1 \2 $2/"
 }
 function getfilemounts()
 {
     if [ -f /etc/auto.master ] ; then
         cat /etc/auto.master | grep -v '^\+' | sed -e '/^#/d' -e '/^$/d'
-        for nismap in `cat /etc/auto.master | grep '^\+' | sed -e '/^#/d' -e '/^$/d'`; do
-            catnismap `echo "$nismap" | sed -e 's/^\+//'`
-        done
+	cat /etc/auto.master | grep '^\+' | sed -e '/^#/d' -e '/^$/d' | (
+        while read map options; do
+	    catnismap `echo "$map" | sed -e 's/^\+//'` $options
+	done
+	)
     fi
 }
 function getnismounts()

Reply to: