Skip to contentSkip to conversation

allow one to specify multiple direct maps

PATCH New Jeff Moyer 1 participant 1 message Nov 3, 2006 Kernel automounter

lore
Share & tools
lore

Jeff Moyer

author
#0 lore raw

PATCH 1/1 allow one to specify multiple direct maps

Hi, Ian, list,

Currently, the autofs init script filters out all duplicate map names. This patch turns off that filtering for direct maps, allowing multiple "/-" keys in the master map.

This was tested successfully on my systems here. Comments welcome.

-Jeff

samples/rc.autofs.in +12 -9
index 8cd3eb1..d00f2ab 100644
@@ -253,15 +253,18 @@ function getmounts()
 	    fi
 
 	    # Do not include a map if it is a duplicate, maps on top of
-	    # another map or another map, maps on top of it.
-	    for knownmap in $knownmaps
-	    do	
-		if [ "`echo $dir/ | grep ^$knownmap`" != "" \
-			-o "`echo $knownmap | grep ^$dir/`" != "" \]
-		then 
-		    continue 2
-		fi	
-	    done
+	    # another map or another map maps on top of it, unless it's
+	    # a direct map.
+	    if [ x`echo $dir | grep -E "^/-"` == 'x' ]; then
+		for knownmap in $knownmaps
+		do
+		    if [ "`echo $dir/ | grep ^$knownmap`" != "" \
+			    -o "`echo $knownmap | grep ^$dir/`" != "" \]
+		    then
+			continue 2
+		    fi
+		done
+	    fi
 
 	    if [ ! -z "$dir" -a ! -z "$map" \
 			-a x`echo "$map" | cut -c1` != 'x-' ]