Greetings!
"H. Peter Anvin" <[EMAIL PROTECTED]> writes:
> Camm Maguire wrote:
> >
> > Greetings!
> >
> > Scott McDermott <[EMAIL PROTECTED]> writes:
> >
> > > [EMAIL PROTECTED] on Tue 29/02 12:43 -0800:
> > > > > That would take too long at large sites. How about
> > > > >
> > > > > +if [ `ypcat -k $map 2>/dev/null | head | wc -l` -eq 0 ] ; then
> > > > > + map=`echo "$map" | sed -e 's/^auto_/auto./'`
> > > > > +fi
> > > > >
> > > > > besides what about when auto_home is just "+auto.home" ?
> > > >
> > > > Handling + in auto_master would be nice. The + as an entry in a map
> > > > is utterly and fundamentally broken (a map is an associative lookup,
> > > > d**** it!)
> >
> > Handling included maps would indeed be a useful kludge. But one
> > requiring significant effort, it seems.
>
> Not just that, it would require breaking a very nice internal
> abstraction.
>
Agreed!
> > How about just for now using
> > the heuristic above -- included maps will of course still not work,
> > but I think this would effectively handle other (no '+' map)
> > situations, and these are the errors people are actually seeing.
> >
> > Any objection to me patching the Debian autofs package as above? And
> > separately, any objection to me patching the Debian autofs package
> > with the daemon patch I submitted earlier?
>
> No, please go right ahead. Even better would be if you could send me a
> patch for the (attempt at) multidistribution rc file that I can send.
>
> -hpa
OK, and thanks! So here is what I'm planning to upload soon. Any
other suggestions most welcome!
--- autofs-3.1.4.orig/samples/rc.autofs.in
+++ autofs-3.1.4/samples/rc.autofs.in
@@ -106,7 +106,10 @@
if [ ! -z "$dir" -a ! -z "$map" \
-a x`echo "$map" | cut -c1` != 'x-' ]
then
- map=`echo "$map" | sed -e 's/^auto_/auto./'`
+ if echo $map | grep ^auto_ >/dev/null && \
+ [ $(ypcat $map 2>/dev/null | head | wc -l) -eq 0 ] ; then
+ map=`echo "$map" | sed -e 's/^auto_/auto./'`
+ fi
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')"
Take care,
--
Camm Maguire [EMAIL PROTECTED]
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah