Bug 6208 - autofs init script doesn't work with NIS-distributed maps
Summary: autofs init script doesn't work with NIS-distributed maps
Status: CLOSED DUPLICATE of bug 6484
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: autofs
Version: 6.1
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Cristian Gafton
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-10-21 22:58 UTC by neumann
Modified: 2008-05-01 15:37 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 1999-11-01 22:36:05 UTC


Attachments (Terms of Use)

Description neumann 1999-10-21 22:58:46 UTC
The init script for autofs does check for a local
auto-master file in /etc before asking the NIS server. This
is against the usual philosophy that NIS maps take
precedence over local files.

Additionally if the map from the NIS server is used the
script assumes map-type 'yp' as default what makes it
impossible to mix local and NIS maps.

Included is a patch that moves the NIS maps to the front of
the script and additionally checks if the found auto.master
map contains any maps that begin with a slash, then assuming
that a local map is wanted, setting the map type to 'file'.

--- rc.d/init.d/autofs.orig     Mon Sep 20 17:13:32 1999
+++ rc.d/init.d/autofs  Sat Oct 16 19:20:35 1999
@@ -37,6 +37,36 @@
 function getmounts()
 {
 #
+#      Next to check for YellowPage maps to be loaded
+#
+  if [ -e /usr/bin/ypcat ] && [ `ypcat -k auto.master
2>/dev/null | wc -l` -gt 0 ]
+  then
+    ypcat -k auto.master | (
+       while read dir map options
+       do
+           if [ ! -z "$dir" -a ! -z "$map" \
+                       -a x`echo "$map" | cut -c1` != 'x-'
]
+           then
+               map=`echo "$map" | sed -e 's/^auto_/auto./'`
+               if echo $options | grep -- '-t' >/dev/null
2>&1 ; then
+                   mountoptions="--timeout $(echo $options
| \
+                     sed 's/^.*-t\(imeout\)*[
\t]*\([0-9][0-9]*\).*$/\2/g')"
+               fi
+               options=`echo "$options" | sed -e '
+                 s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g
+                 s/\(^\|[ \t]\)-/\1/g'`
+               if [ x`echo "$map" | grep '^\/'` != 'x' ]
+                   then
+                        type="file"
+                    else
+                        type="yp"
+               fi
+               echo "/usr/sbin/automount $mountoptions $dir
$type $map $options $localoptions"
+           fi
+       done
+    )
+else
+#
 #      Check for local maps to be loaded
 #
 if [ -f /etc/auto.master ] ; then
@@ -87,30 +117,6 @@
                        ;;
                esac
                unset basecommand
-           fi
-       done
-    )
-else
-#
-#      Next to check for YellowPage maps to be loaded
-#
-  if [ -e /usr/bin/ypcat ] && [ `ypcat -k auto.master
2>/dev/null | wc -l` -gt 0 ]
-  then
-    ypcat -k auto.master | (
-       while read dir map options
-       do
-           if [ ! -z "$dir" -a ! -z "$map" \
-                       -a x`echo "$map" | cut -c1` != 'x-'
]
-           then
-               map=`echo "$map" | sed -e 's/^auto_/auto./'`
-               if echo $options | grep -- '-t' >/dev/null
2>&1 ; then
-                   mountoptions="--timeout $(echo $options
| \
-                     sed 's/^.*-t\(imeout\)*[
\t]*\([0-9][0-9]*\).*$/\2/g')"
-               fi
-               options=`echo "$options" | sed -e '
-                 s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g
-                 s/\(^\|[ \t]\)-/\1/g'`
-               echo "/usr/sbin/automount $mountoptions $dir
yp $map $options $localoptions"
            fi
        done
     )

Comment 1 Bill Nottingham 1999-11-01 22:36:59 UTC
*** This bug has been marked as a duplicate of 6484 ***


Note You need to log in before you can comment on or make changes to this bug.