Bug 520190 - autofs fails to follow subsequent maps specified in LDAP with ldap:<dn> specification
Summary: autofs fails to follow subsequent maps specified in LDAP with ldap:<dn> speci...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: autofs
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Ian Kent
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-28 20:08 UTC by Andy Cobaugh
Modified: 2009-11-10 02:09 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-10 02:09:39 UTC


Attachments (Terms of Use)

Description Andy Cobaugh 2009-08-28 20:08:42 UTC
Description of problem:
autofs-5.0.1-0.rc2.88 fails to follow automount maps in ldap when automountInformation attribute contains another automountMapName specified as ldap:<dn>. 

For example:

automountInformation: ldap:automountMapName=foo,ou=automount,dc=bx,dc=psu,dc=edu

will be interpreted as "ldap" being the host and the DN being the name of the export.

Version-Release number of selected component (if applicable):
autofs-5.0.1-0.rc2.88

How reproducible:
always

Steps to Reproduce:
1. Try to specify an automount map in automountInformation attr
2.
3.
  
Actual results:
automount map using ldap:<dn> syntax is interpreted as a host and mount

Expected results:
automount map should be used instead of it trying to mount the contents of automountInformation attr

Additional info: I think there was a patch that fixed this against 5.0.3, but it doesn't seem to be included in the autofs that ships with RHEL 5.3

Comment 1 Ian Kent 2009-08-31 03:23:16 UTC
(In reply to comment #0)
> Description of problem:
> autofs-5.0.1-0.rc2.88 fails to follow automount maps in ldap when
> automountInformation attribute contains another automountMapName specified as
> ldap:<dn>. 
> 
> For example:
> 
> automountInformation:
> ldap:automountMapName=foo,ou=automount,dc=bx,dc=psu,dc=edu
> 
> will be interpreted as "ldap" being the host and the DN being the name of the
> export.

I do seem to remember something like that.
I thought I fixed that in RHEL-5.3.

> 
> Version-Release number of selected component (if applicable):
> autofs-5.0.1-0.rc2.88

But rev 0.rc2.102 is the RHEL-5.3 version?
Does it also happen with rev 0.rc2.102?

Ian

Comment 2 Andy Cobaugh 2009-08-31 13:11:28 UTC
(In reply to comment #1)
> 
> But rev 0.rc2.102 is the RHEL-5.3 version?
> Does it also happen with rev 0.rc2.102?

Hmm, apparently I had .88 and .102 installed at the same time. Let me reinstall autofs entirely and try again.

--andy

Comment 3 Andy Cobaugh 2009-08-31 13:32:15 UTC
Nope, this still happens with autofs-5.0.1-0.rc2.102.el5_3.1

with automountInformation set to automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu

I'm seeing this:

Aug 31 09:26:22 localhost automount[18351]: lookup_mount: lookup(ldap): looking up s2.persephone.bx.psu.edu
Aug 31 09:26:22 localhost automount[18351]: do_bind: lookup(ldap): auth_required: 1, sasl_mech (null)
Aug 31 09:26:22 localhost automount[18351]: do_bind: lookup(ldap): ldap anonymous bind returned 0
Aug 31 09:26:22 localhost automount[18351]: lookup_one: lookup(ldap): searching for "(&(objectclass=automount)(|(automountKey=s2.persephone.bx.psu.edu)(automountKey=/)(automountKey=\2A)))" under "automountMapName=auto_nfs,ou=automount,dc=bx,dc=psu,dc=edu"
Aug 31 09:26:22 localhost automount[18351]: lookup_one: lookup(ldap): getting first entry for automountKey="s2.persephone.bx.psu.edu"
Aug 31 09:26:22 localhost automount[18351]: lookup_one: lookup(ldap): examining first entry
Aug 31 09:26:22 localhost automount[18351]: lookup_mount: lookup(ldap): s2.persephone.bx.psu.edu -> automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu
Aug 31 09:26:22 localhost automount[18351]: parse_mount: parse(sun): expanded entry: automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu
Aug 31 09:26:22 localhost automount[18351]: parse_mount: parse(sun): gathered options: 
Aug 31 09:26:22 localhost automount[18351]: parse_mount: parse(sun): dequote("automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu") -> automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu
Aug 31 09:26:22 localhost automount[18351]: parse_mount: parse(sun): core of entry: options=, loc=automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu
Aug 31 09:26:22 localhost automount[18351]: sun_mount: parse(sun): mounting root /nfs, mountpoint s2.persephone.bx.psu.edu, what automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu, fstype nfs, options (null)
Aug 31 09:26:22 localhost automount[18351]: mount_mount: mount(nfs): root=/nfs name=s2.persephone.bx.psu.edu what=automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu, fstype=nfs, options=(null)
Aug 31 09:26:22 localhost automount[18351]: host automountMapName=s2.persephone.bx.psu.edu: lookup failure 1
Aug 31 09:26:22 localhost automount[18351]: host ou=automount: lookup failure 1
Aug 31 09:26:22 localhost automount[18351]: host dc=bx: lookup failure 1
Aug 31 09:26:22 localhost automount[18351]: host dc=psu: lookup failure 1
Aug 31 09:26:22 localhost automount[18351]: mount(nfs): no hosts available

This is using the [//servername/]dn syntax. The "old style" ldap:servername:mapname also does not work.

Comment 4 Ian Kent 2009-08-31 14:56:26 UTC
(In reply to comment #3)
> Nope, this still happens with autofs-5.0.1-0.rc2.102.el5_3.1
> 
> with automountInformation set to
> automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu

Maybe you need to explain a bit more.
Where is the map name in the above?

Ian

Comment 5 Ian Kent 2009-08-31 15:00:50 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Nope, this still happens with autofs-5.0.1-0.rc2.102.el5_3.1
> > 
> > with automountInformation set to
> > automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu
> 
> Maybe you need to explain a bit more.
> Where is the map name in the above?

On second thought, looking closer at the log, post your LDAP
map, both the master map and the maps it referrers to.

Ian

Comment 6 Andy Cobaugh 2009-08-31 19:28:22 UTC
dn: automountMapName=auto.master,ou=automount,dc=bx,dc=psu,dc=edu
objectClass: automountMap
automountMapName: auto.master

dn: automountKey=/nfs,automountMapName=auto.master,ou=automount,dc=bx,dc=psu,d
 c=edu
objectClass: automount
automountKey: /nfs
automountInformation: auto_nfs --ghost --timeout 60

dn: automountMapName=auto_nfs,ou=automount,dc=bx,dc=psu,dc=edu
objectClass: automountMap
automountMapName: auto_nfs

dn: automountKey=s2.persephone.bx.psu.edu,automountMapName=auto_nfs,ou=automou
 nt,dc=bx,dc=psu,dc=edu
objectClass: automount
automountKey: s2.persephone.bx.psu.edu
automountInformation: automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu

dn: automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu
objectClass: automountMap
automountMapName: s2.persephone.bx.psu.edu

dn: automountKey=md1k-4-data,automountMapName=s2.persephone.bx.psu.edu,ou=auto
 mount,dc=bx,dc=psu,dc=edu
objectClass: automount
automountKey: md1k-4-data
automountInformation: -fstype=nfs,rw,nosuid,rsize=32768,wsize=32768,soft,intr 
 s2.persephone.bx.psu.edu:/zfs/md1k-4/data

I certainly haven't ruled out a configuration issue on my end, so I'd be willing to change anything to help rule out my ldap config.

Comment 7 Ian Kent 2009-09-01 02:19:12 UTC
(In reply to comment #6)
> dn: automountMapName=auto.master,ou=automount,dc=bx,dc=psu,dc=edu
> objectClass: automountMap
> automountMapName: auto.master
> 
> dn: automountKey=/nfs,automountMapName=auto.master,ou=automount,dc=bx,dc=psu,d
>  c=edu
> objectClass: automount
> automountKey: /nfs
> automountInformation: auto_nfs --ghost --timeout 60
> 
> dn: automountMapName=auto_nfs,ou=automount,dc=bx,dc=psu,dc=edu
> objectClass: automountMap
> automountMapName: auto_nfs
> 
> dn: automountKey=s2.persephone.bx.psu.edu,automountMapName=auto_nfs,ou=automou
>  nt,dc=bx,dc=psu,dc=edu
> objectClass: automount
> automountKey: s2.persephone.bx.psu.edu
> automountInformation:
> automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu
> 
> dn: automountMapName=s2.persephone.bx.psu.edu,ou=automount,dc=bx,dc=psu,dc=edu
> objectClass: automountMap
> automountMapName: s2.persephone.bx.psu.edu
> 
> dn: automountKey=md1k-4-data,automountMapName=s2.persephone.bx.psu.edu,ou=auto
>  mount,dc=bx,dc=psu,dc=edu
> objectClass: automount
> automountKey: md1k-4-data
> automountInformation: -fstype=nfs,rw,nosuid,rsize=32768,wsize=32768,soft,intr 
>  s2.persephone.bx.psu.edu:/zfs/md1k-4/data
> 
> I certainly haven't ruled out a configuration issue on my end, so I'd be
> willing to change anything to help rule out my ldap config.  

I've been looking at these entries for a while now and I'm having
trouble understanding what your trying to achieve.

Can you describe how you believe this is supposed to work?
One thing is sure, whatever you're trying to do, it isn't setup
correctly.

Ian

Comment 8 Andy Cobaugh 2009-09-01 02:38:53 UTC
Essentially, /nfs will contain a list of all nfs servers, then under each server we will have a list of all exports. What I'm trying to do is have each key under /nfs point to a mount map name for each server, so automountMapName=s2.persephone.bx.psu.edu will contain all of s2's mounts. 

This is kind of a more hard-coded way of doing a /net -hosts, but the difference being we have more control over mount options.

I have been using this same config through actual files for at least 3 years now, on everything from rhel2 on up with no problem whatsoever, where a key points to another mount map file. This way each server has all of its mounts in separate files. For example, /etc/auto.nfs would have a key for the s2 server that specified file:/etc/auto.nfs.s2.

Does that make sense?

Comment 9 Ian Kent 2009-09-01 06:27:23 UTC
(In reply to comment #8)
> Essentially, /nfs will contain a list of all nfs servers, then under each
> server we will have a list of all exports. What I'm trying to do is have each
> key under /nfs point to a mount map name for each server, so
> automountMapName=s2.persephone.bx.psu.edu will contain all of s2's mounts. 
> 
> This is kind of a more hard-coded way of doing a /net -hosts, but the
> difference being we have more control over mount options.
> 
> I have been using this same config through actual files for at least 3 years
> now, on everything from rhel2 on up with no problem whatsoever, where a key
> points to another mount map file. This way each server has all of its mounts in
> separate files. For example, /etc/auto.nfs would have a key for the s2 server
> that specified file:/etc/auto.nfs.s2.

Almost, except for the key being a map, that's not valid, but
the mount location can be a map though, when using submaps.

How about posting a couple of examples from your file map so
I can see what your doing their.

It sounds like your trying to use submaps, which is fine but
I suspect you may have been taking advantage of some file map
specific functionality that might not be specifically supported
so we might need to change to an expected syntax. Or the
translation from the file maps isn't quite right. In either
case, post the example and we will work out what we need to do.

Ian

Comment 10 Andy Cobaugh 2009-09-01 13:42:09 UTC
=/etc/auto.master=

/nfs /etc/auto.nfs --timeout=120 --ghost


=/etc/auto.nfs=

s2                  -fstype=autofs --ghost file:/etc/auto.nfs.s2


=/etc/auto.nfs.s2=

md1k-4_data     -fstype=nfs,rw,nosuid,rsize=8192,wsize=8192 s2.persephone.bx.psu.edu:/zfs/md1k-4/data
md1k-4_archive  -fstype=nfs,ro,nosuid,rsize=8192            s2.persephone.bx.psu.edu:/zfs/md1k-4/archive
md1k-5_data     -fstype=nfs,rw,nosuid,rsize=8192,wsize=8192 s2.persephone.bx.psu.edu:/zfs/md1k-5/data
md1k-5_archive  -fstype=nfs,ro,nosuid,rsize=8192            s2.persephone.bx.psu.edu:/zfs/md1k-5/archive
md1k-6_data     -fstype=nfs,rw,nosuid,rsize=8192,wsize=8192 s2.persephone.bx.psu.edu:/zfs/md1k-6/data
md1k-6_archive  -fstype=nfs,ro,nosuid,rsize=8192            s2.persephone.bx.psu.edu:/zfs/md1k-6/archive

Comment 11 Ian Kent 2009-09-02 03:09:57 UTC
Firstly, in comment #6, it appears you are happy to just give
the unqualified map names in the configuration and let autofs
fill in the extra bits. So lets continue that.

In /etc/nssswitch.conf you would have:

automount: ldap

Be aware that if /etc/nssswitch.conf has:

automount: files ldap

any map (or file) of the same name existing in /etc will
override the remote ldap map, however, in file maps you can
"+" include the remote ldap map as a means of providing host
specific local customization.

So, given this, a straight conversion of the map in comment #10,
with map name auto.nfs changed to auto_nfs and the rsize and wsize
changed to 32k should look something like:

#
# Container for map auto.master
#
dn: automountMapName=auto.master,ou=automount,dc=bx,dc=psu,dc=edu
objectClass: top
objectClass: automountMap
automountMapName: auto.master

#
# Entry in map auto.master for indirect mount /nfs using map
# auto_nfs.
#
dn: automountKey=/nfs,automountMapName=auto.master,ou=automount,dc=bx,dc=psu,d
 c=edu
objectClass: top
objectClass: automount
automountKey: /nfs
automountInformation: auto_nfs --ghost --timeout 60
automountMapName: auto.master

#
# Container for indirect mount map auto_nfs.
#
dn: automountMapName=auto_nfs,ou=automount,dc=bx,dc=psu,dc=edu
objectClass: top
objectClass: automountMap
automountMapName: auto_nfs

#
# Entry in map auto_nfs, a submap entry pointing to map
# auto_nfs.s2, for host s2.persephone.bx.psu.edu.
#
dn: automountKey=s2.persephone.bx.psu.edu,automountMapName=auto_nfs,ou=automou
 nt,dc=bx,dc=psu,dc=edu
objectClass: top
objectClass: automount
automountKey: s2.persephone.bx.psu.edu
automountInformation: -fstype=autofs auto_nfs.s2
automountMapName: auto_nfs

#
# Container for map auto_nfs.s2.
#
dn: automountMapName=auto_nfs.s2,ou=automount,dc=bx,dc=psu,dc=edu
objectClass: top
objectClass: automountMap
automountMapName: auto_nfs.s2

#
# Entries for map auto_nfs.s2.
# Can't really do anything about the line wrap but I expect you
# get the idea.
#
dn: automountKey=md1k-4_data,automountMapName=auto_nfs.s2,ou=automount,dc=bx,dc=psu,dc=edu
objectClass: top
objectClass: automount
automountKey: md1k-4_data
automountInformation: -fstype=nfs,rw,nosuid,rsize=32768,wsize=32768 
 s2.persephone.bx.psu.edu:/zfs/md1k-4/data
automountMapName: auto_nfs.s2

dn: automountKey=md1k-4_archive,automountMapName=auto_nfs.s2,ou=automount,dc=bx,dc=psu,dc=edu
objectClass: top
objectClass: automount
automountKey: md1k-4_archive
automountInformation: -fstype=nfs,rw,nosuid,rsize=32768,wsize=32768 
 s2.persephone.bx.psu.edu:/zfs/md1k-4/archive
automountMapName: auto_nfs.s2

dn: automountKey=md1k-5_data,automountMapName=auto_nfs.s2,ou=automount,dc=bx,dc=psu,dc=edu
objectClass: top
objectClass: automount
automountKey: md1k-5_data
automountInformation: -fstype=nfs,rw,nosuid,rsize=32768,wsize=32768 
 s2.persephone.bx.psu.edu:/zfs/md1k-5/data
automountMapName: auto_nfs.s2

dn: automountKey=md1k-5_archive,automountMapName=auto_nfs.s2,ou=automount,dc=bx,dc=psu,dc=edu
objectClass: top
objectClass: automount
automountKey: md1k-5_archive
automountInformation: -fstype=nfs,rw,nosuid,rsize=32768,wsize=32768 
 s2.persephone.bx.psu.edu:/zfs/md1k-5/archive
automountMapName: auto_nfs.s2

.......

Comment 12 Ian Kent 2009-09-02 03:18:05 UTC
Missed an option ...

(In reply to comment #11)

snip ...

> 
> So, given this, a straight conversion of the map in comment #10,
> with map name auto.nfs changed to auto_nfs and the rsize and wsize
> changed to 32k should look something like:

snip ...

> #
> # Container for indirect mount map auto_nfs.
> #
> dn: automountMapName=auto_nfs,ou=automount,dc=bx,dc=psu,dc=edu
> objectClass: top
> objectClass: automountMap
> automountMapName: auto_nfs
> 
> #
> # Entry in map auto_nfs, a submap entry pointing to map
> # auto_nfs.s2, for host s2.persephone.bx.psu.edu.
> #
> dn: automountKey=s2.persephone.bx.psu.edu,automountMapName=auto_nfs,ou=automou
>  nt,dc=bx,dc=psu,dc=edu
> objectClass: top
> objectClass: automount
> automountKey: s2.persephone.bx.psu.edu
> automountInformation: -fstype=autofs auto_nfs.s2
> automountMapName: auto_nfs

In comment #10 you also gave the "--ghost" option to the submap,
and although I think the option should propagate from the master
map (you'll need to check that), the automountInformation
attribute above should read:

automountInformation: -fstype=autofs --ghost auto_nfs.s2

Ian

Comment 13 Andy Cobaugh 2009-09-02 03:50:47 UTC
The --ghost does propogate.

The automountMapName attr shouldn't be on the automountKey=s2.persephone.bx.psu.edu entry.

This does work now. All of the examples I could find online used the syntax that I had posted before for specifying sub-mounts, and I guess it never ocurred to me that automountInformation could contain the same statements one would use in the files equivalent.

Is there a way to specify the sub mount map name (auto_nfs.s2  for example) by DN, instead of letting autofs search for this? I think you may have hinted that there was a way to do this.

Thanks for the help btw, and if this is all documented somewhere in the autofs package, I apologize for taking up your time. I thought I was following everything correctly as stated in auto.master(5), but I guess I missed something?

Comment 14 Ian Kent 2009-09-02 08:01:14 UTC
(In reply to comment #13)
> The --ghost does propogate.

OK.

> 
> The automountMapName attr shouldn't be on the
> automountKey=s2.persephone.bx.psu.edu entry.

Oops!

> 
> This does work now. All of the examples I could find online used the syntax
> that I had posted before for specifying sub-mounts, and I guess it never
> ocurred to me that automountInformation could contain the same statements one
> would use in the files equivalent.
> 
> Is there a way to specify the sub mount map name (auto_nfs.s2  for example) by
> DN, instead of letting autofs search for this? I think you may have hinted that
> there was a way to do this.

As long as you tell autofs that it is a submount, with the -fstype
option, you should be able to use any of the various "ldap:..."
syntax available. I think the problem previously was that this was
missing from the automountInformation and autofs was trying to
mount the dn.

Something like:

automountInformation: -fstype=autofs ldap:automountMapName=auto_nfs.s2,<rest of dn>

should work OK.


> 
> Thanks for the help btw, and if this is all documented somewhere in the autofs
> package, I apologize for taking up your time. I thought I was following
> everything correctly as stated in auto.master(5), but I guess I missed
> something?  

Perhaps it isn't clear, but ther should also be some examples
in /usr/share/doc/autofs-...., but I don't think they show
submount examples.

Ian

Comment 15 Ian Kent 2009-11-09 02:32:03 UTC
It looks like this issue is resolved.
Can you confirm that or comment on any ongoing problem please?

Comment 16 Andy Cobaugh 2009-11-10 01:06:32 UTC
Issue is resolved, I've encountered no further problems.


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