Bug 6208 - autofs init script doesn't work with NIS-distributed maps
autofs init script doesn't work with NIS-distributed maps
Status: CLOSED DUPLICATE of bug 6484
Product: Red Hat Linux
Classification: Retired
Component: autofs (Show other bugs)
6.1
All Linux
high Severity medium
: ---
: ---
Assigned To: Cristian Gafton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-10-21 18:58 EDT by neumann
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-11-01 17:36:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description neumann 1999-10-21 18:58:46 EDT
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 17:36:59 EST
*** 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.