[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: autofs and OpenLDAP integration



Nalin wrote:

> The helper attempts to use the RFC2307 nisObject schema, but if it
> doesn't find any entries which look right to it, it will try again
> using attribute names which match the iPlanet automount schema.

I saw that already in the source code.

> So you'd see this if the filter matched entries in the directory
> which didn't have the needed attributes (which is weird, considering
> that the filter includes the objectclass being searched for, and the
> attributes which it then attempts to read are required).
>
> This should duplicate the first search pretty closely:
> ldapsearch -x '(&(objectclass=automountMap)(ou=auto.master))' dn

Here is my version (I added -LLL to get only the entries):

michels@grommit:~ > ldapsearch -x
'(&(objectclass=automountMap)(ou=auto.master))' dn -LLL
dn: ou=auto.master,dc=mathematik,dc=uni-trier,dc=de

michels@grommit:~ >

Is the blank line between dn: ... and michels@... correct? Or should I see
something else there?

>
> Then, using the DN of the returned object, do this:
> ldapsearch -x -b DN '(objectclass=automount)' cn automountInformation

michels@grommit:~ > ldapsearch -x -b
'ou=auto.master,dc=mathematik,dc=uni-trier,dc=de' cn automountInformation -LLL
dn: ou=auto.master,dc=mathematik,dc=uni-trier,dc=de

dn: cn=/misc, ou=auto.master,dc=mathematik,dc=uni-trier,dc=de
automountInformation: /etc/auto.misc

michels@grommit:~ >

Again two blank lines in the output!

> The result of that search is what the helper will attempt to print in
> a form which the autofs init script is expecting (i.e., one which
> resembles the output of "ypcat -k", which is how it reads auto.master
> from NIS).
>
> Using the nisObject schema, the searches look more like this:
> ldapsearch -x '(&(objectclass=nisMap)(nisMapName=auto.master))' dn
> ldapsearch -x -b DN '(objectclass=nisObject)' cn nisMapEntry

I also added the RFC2307 conform entries. They look like this:

michels@grommit:~ > cat /tmp/automount.ldif
dn: nisMapName=auto.master,dc=mathematik,dc=uni-trier,dc=de
objectClass: top
objectClass: nisMap
nisMapName: auto.master

dn: cn=/misc,nisMapName=auto.master,dc=mathematik,dc=uni-trier,dc=de
objectClass: nisObject
cn: /misc
nisMapEntry: /etc/auto.misc
nisMapName: auto.master

dn: nisMapName=auto.misc,dc=mathematik,dc=uni-trier,dc=de
objectClass: top
objectClass: nisMap
nisMapName: auto.misc

dn: cn=cdr,nisMapName=auto.misc,dc=mathematik,dc=uni-trier,dc=de
objectClass: nisObject
cn: cdr
nisMapEntry:    -fstype=iso9660,ro      :/dev/hdc
nisMapName: auto.misc

dn: cn=cd,nisMapName=auto.misc,dc=mathematik,dc=uni-trier,dc=de
objectClass: nisObject
cn: cd
nisMapEntry:    -fstype=iso9660,ro      :/dev/hdb
nisMapName: auto.misc

So this gives me:

michels@grommit:~ > ldapsearch -x
'(&(objectclass=nisMap)(nisMapName=auto.master))' dn -LLL
dn: nisMapName=auto.master,dc=mathematik,dc=uni-trier,dc=de

michels@grommit:~ > ldapsearch -x -b
'nisMapName=auto.master,dc=mathematik,dc=uni-trier,dc=de' cn nisMapEntry -LLL
dn: nisMapName=auto.master,dc=mathematik,dc=uni-trier,dc=de

dn: cn=/misc,nisMapName=auto.master,dc=mathematik,dc=uni-trier,dc=de
nisMapEntry: /etc/auto.misc

michels@grommit:~ >

Here too, there are blank lines!

> Hopefully this will help you track down where things are going amiss.
>
> Cheers,
>
> Nalin

Again autofs-ldap-auto-master (with my additional debug output) produces:

michels@grommit:~ > ./autofs-ldap-auto-master
keys: (null)
values[0]: /etc/auto.misc
keys: (null)
values[0]: /etc/auto.misc

I interpret the output as follows:

autofs-ldap-auto-master does the first search and gets the correct dn (I
checked that)
then the second search is done, but this time it gets a key which points to
NULL, therefore leaving out the printf command
the function dump_map is done now, but because found is not set to 1, the main-

function calls dump_map again, this time with parameters which reflect the
iPlanet scheme
dump_map doesn't produce more output in this second run, and so does the
additional debugging code

So where am I wrong? Did I missed some attributes? Could you please give me an
example of the output you see when you execute the ldapsearch's from above?
That might help me.

Thanks,

Christian