Skip to contentSkip to conversation

Fix, to fix the ordering of +ypmapname entries in /etc/auto.master

PATCH In review Chris Feist 2 participants 2 messages Oct 21, 2004 – Oct 22, 2004 Kernel automounter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix, to fix the ordering of +ypmapname entries in /etc/auto.master

Ian,

This patch will have automount process map entries that refer to yp maps (ie. +auto_master) in the same order as they show up in the /etc/auto.master file. Previously all entries that didn't refer to another yp map were processed before entries refering to a yp map.

For example with the following /etc/auto.master:
/home /etc/auto.home
+auto_master
/misc /etc/auto.misc

In 4.1.3, all maps in auto_master would be included after the /home & /misc line.

With this patch all lines in the auto_master file will be processed after the /home line, but before the /misc line.

Thanks,
Chris

samples/rc.autofs.in renamed from samples/rc.autofs.in.plus-map-ordering +12 -3
@@ -94,10 +94,19 @@
 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/^\+//'`
+        cat /etc/auto.master | sed -e '/^#/d' -e '/^$/d' | (
+        while read auto_master_in
+        do
+            if [ "`echo $auto_master_in | grep '^+'`" = "" ]; then
+                echo $auto_master_in
+            else
+                for nismap in `cat /etc/auto.master | grep '^\+' |
+                        sed -e '/^#/d' -e '/^$/d'`; do
+                    catnismap `echo "$nismap" | sed -e 's/^\+//'`
+                done
+            fi
         done
+        )
     fi
 }
 function getnismounts()

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

maintainer
#1 lore raw
Quoted 12 lines · Chris Feist

Ian,

This patch will have automount process map entries that refer to yp maps (ie. +auto_master) in the same order as they show up in the /etc/auto.master file. Previously all entries that didn't refer to another yp map were processed before entries refering to a yp map.

For example with the following /etc/auto.master:
/home /etc/auto.home
+auto_master
/misc /etc/auto.misc

Quoted 6 lines

In 4.1.3, all maps in auto_master would be included after the /home & /misc line.

With this patch all lines in the auto_master file will be processed after the /home line, but before the /misc line.

Seems I'll need a reply template for you Chris.

Thanks as usual.

Ian