Bug 178308 - ldap config will always default to using yp mapping
ldap config will always default to using yp mapping
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: autofs (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ian Kent
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-19 05:34 EST by Joachim Selke
Modified: 2007-11-30 17:11 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-11 11:56:29 EDT
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 Joachim Selke 2006-01-19 05:34:33 EST
+++ This bug was initially created as a clone of Bug #73123 +++

Here is a short summary of Bug #73123 which is still present in Fedora Core 4
and has an easy fix (at least I think so).


Description of problem:
When using autofs with ldap, drive mapping are shown as coming from yp not ldap.
 This produces an RPC failure on NIS operation, because there is no nis map
called ldap.  Here is the output from service autofs status:

Configured Mount Points:
------------------------
/usr/sbin/automount /misc yp ldap  admin.example.com:ou=auto.misc,dc=example,dc=com


Version-Release number of selected component (if applicable):
(1:4.1.4-15)


How reproducible:
Always


Steps to Reproduce:
1.setup auto.master in ldap 
2.configure autofs to use ldap
3.service autofs status


Actual Results:  Configured Mount Points:
---Configured Mount Points:
------------------------
/usr/sbin/automount /misc yp ldap  admin.example.com:ou=auto.misc,dc=example,dc=com


Expected Results:  Configured Mount Points:
---Configured Mount Points:
------------------------
/usr/sbin/automount /misc ldap  admin.example.com:ou=auto.misc,dc=example,dc=com

There should be no yp in the statement.


Possible fix:

Starting with line 325 of /etc/rc.d/init.d/autofs there is a distinction of
cases for the different map types. Adding a case for the ldap map type solves
the problem:

elif [ "$map" = "ldap" ] ; then
    maptype=$map
    map=
Comment 1 Joachim Selke 2006-04-09 06:51:42 EDT
This bug still exists in Fedora Core 5 (autofs-4.1.4-16.2.2).
Comment 2 Ian Kent 2006-04-11 09:10:32 EDT
(In reply to comment #1)
> This bug still exists in Fedora Core 5 (autofs-4.1.4-16.2.2).

Yes, not good.

I wish I'd looked at this more closely sooner, sorry.

I nearly applied this change without due consideration but, having checked, I'm
not sure your recommendation will work correctly.

The LDAP configuration data from bz#73123 used for the test appears incorrect
for a couple of reasons.

There are two different schema used in the entries when only one can be used. 

I'll assume that you are actually using the "automountMap" type entries (perhaps
the presence of the nis type entry will cause problems as as well because it
appears to point to itself).

I think the entry:

automountInformation: ldap ldap:ou=auto.home,dc=home,dc=local

should be

automountInformation: ldap:ou=auto.home,dc=home,dc=local

Is there some way you check what happens if this is changed without breaking
your production environment?

Also, if your not using the nis schema entry you really should make an ldif of
it (if you want to keep it) and delete it. It may cause more problems.

Ian
Comment 3 Joachim Selke 2006-04-11 09:39:19 EDT
I made some tests and here are the results.

Test 1 (with "ldap", no modification to /etc/init.d/autofs)
===========================================================

Using the following LDAP entries:

dn: ou=auto.master,dc=thi,dc=uni-hannover,dc=de
objectClass: automountMap
ou: auto.master

dn: cn=/home,ou=auto.master,dc=thi,dc=uni-hannover,dc=de
objectClass: automount
cn: /home
automountInformation: ldap ldap.thi.uni-hannover.de:ou=auto.home,dc=thi,dc=uni
 -hannover,dc=de

dn: ou=auto.home,dc=thi,dc=uni-hannover,dc=de
objectClass: automountMap
ou: auto.home

dn: cn=/,ou=auto.home,dc=thi,dc=uni-hannover,dc=de
objectClass: automount
cn: /
automountInformation: -fstype=nfs nfs.thi.uni-hannover.de:/export/home/&

When logging in /var/log/messages says:
Apr 11 15:35:24 brown automount[31262]: lookup(yp): map ldap: Local domain name
not set

The mount is not successful. I don't know what this error message means. How can
I get debug output?



Test 2 (with "ldap", modification to /etc/init.d/autofs)
========================================================

The LDAP entries are the same as in test 1.

/etc/init.d/autofs is modified as mentioned above.

With this the mount works when logging in.

/var/log/messages says:

Apr 11 15:40:55 brown automount[32191]: lookup(ldap): got answer, but no first
entry for (&(objectclass=nisObject)(cn=selke))
Apr 11 15:40:55 brown automount[32191]: lookup(ldap): got answer, but no first
entry for (&(objectclass=automount)(cn=selke))
Apr 11 15:40:55 brown automount[32191]: lookup(ldap): got answer, but no first
entry for (&(objectclass=automount)(automountKey=selke))
Apr 11 15:40:55 brown automount[32191]: lookup(ldap): got answer, but no first
entry for (&(objectclass=nisObject)(cn=/))
Apr 11 15:40:55 brown automount[32191]: lookup(ldap): got answer, but no first
entry for (&(objectclass=automount)(automountKey=/))

This looks good.


Test 3 (without "ldap", no modification to /etc/init.d/autofs)
==============================================================

The LDAP entries are the same as in test 1 and 2 with the following exception:

dn: cn=/home,ou=auto.master,dc=thi,dc=uni-hannover,dc=de
objectClass: automount
cn: /home
automountInformation: ldap ldap.thi.uni-hannover.de:ou=auto.home,dc=thi,dc=uni
 -hannover,dc=de

When logging in the mount does not work.

/var/log/messages says:

Apr 11 15:26:11 brown automount[30903]: cannot open lookup module ldap.thi.uni-h
annover.de (/usr/lib/autofs/lookup_ldap.thi.uni-hannover.de.so: cannot open shar
ed object file: No such file or directory)

So the "ldap" seems necessary because autofs uses it for selecting the lookup
module.



Can I test something else for you?
Comment 4 Ian Kent 2006-04-11 10:06:01 EDT
(In reply to comment #3)
> Test 3 (without "ldap", no modification to /etc/init.d/autofs)
> ==============================================================
> 
> The LDAP entries are the same as in test 1 and 2 with the following exception:
> 
> dn: cn=/home,ou=auto.master,dc=thi,dc=uni-hannover,dc=de
> objectClass: automount
> cn: /home
> automountInformation: ldap ldap.thi.uni-hannover.de:ou=auto.home,dc=thi,dc=uni
>  -hannover,dc=de

Can you change the "ldap ldap.thi..." to "ldap:ldap.thi..." and try again please.

snip ...

> Can I test something else for you?

Yes please, above.

Ian

Comment 5 Joachim Selke 2006-04-11 11:45:37 EDT
(In reply to comment #4)
> Can you change the "ldap ldap.thi..." to "ldap:ldap.thi..." and try again
> please.

It works. :-)

I think this "bug" can be closed now, thank you.

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