allow one to specify multiple direct maps
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
@@ -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-' ]