Bug 65212 - autofs startup script doesn't handle ldap maps properly?
autofs startup script doesn't handle ldap maps properly?
Status: CLOSED CANTFIX
Product: Red Hat Linux
Classification: Retired
Component: autofs (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
:
Depends On: 73123
Blocks:
  Show dependency treegraph
 
Reported: 2002-05-20 08:45 EDT by Jonathan Kamens
Modified: 2007-04-18 12:42 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-10-18 14:12:02 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 Jonathan Kamens 2002-05-20 08:45:04 EDT
We have configured autofs to look in ldap by putting "ldap" on the "automount"
line in /etc/nsswitch.conf.

/usr/lib/autofs/autofs-ldap-auto-master returns this:

  /home ou=auto.home,dc=worldwinner,dc=com
  /ww ou=auto.local,dc=worldwinner,dc=com

Unfortunately, /etc/rc.d/init.d/autofs does the wrong thing, because the code in
getmounts() expects the second fields on the lines above to start with "ldap:",
which  theyobviously don't.

I don't think our automount entries in ldap are wrong, but I'm happy to be
corrected about it; I think the startup script is wrong.  I fixed it by changing
getldapmounts() to look like this, although I don't know if this is the
"correct" or "best" solution:

function getldapmounts()
{
    /usr/lib/autofs/autofs-ldap-auto-master 2> /dev/null |
    awk '{ $2 = "ldap:" $2; print }'
}
Comment 1 Jose Vicente Nunez Zuleta 2002-11-04 15:30:34 EST
I used sed instead in the getldapmounts() function:

# Construct the LDAP mount points properly
# josevnz at newbreak dot com
function getldapmounts()
{
    #/usr/lib/autofs/autofs-ldap-auto-master 2> /dev/null

    # Get the LDAP server from the 'ldap.conf'.
    LDAP_SERVER=`cat /etc/openldap/ldap.conf | grep -v '#'| grep HOST| sed
-e's/HOST //'`
    # Get the default base
    LDAP_BASE=` cat /etc/openldap/ldap.conf | grep -v '#'| grep BASE| sed
-e's/BASE //'`

    #/usr/lib/autofs/autofs-ldap-auto-master 2> /dev/null
    /usr/lib/autofs/autofs-ldap-auto-master|sed -e"s/[a-zA-Z0-9]*\..*/
ldap\:$LDAP_SERVER\:nisMapName=&,$LDAP_BASE/"
}

Is written in sed and uses the ldap server specified in the
/etc/openldap/ldap.conf file.
Comment 2 Chris Hedemark 2003-02-05 14:50:54 EST
I've been running into the same problem and see that this has not yet been 
addressed.  Can this be addressed under my Enterprise support entitlement? 
Comment 3 Chris Hedemark 2003-02-05 15:29:00 EST
The patch attached to #73123 seems to fix this.  It is an easy patch and 
should hopefully be included in 7.3's errata! 
Comment 4 Need Real Name 2004-02-08 00:53:55 EST
I ran into the same problem.

It can be fixed by changing the entries in your LDAP server without 
modifying any scripts. The source code for /usr/lib/autofs/autofs-
ldap-auto-master shows where it's printing the information:
----
for(entry = ldap_first_entry(ld, messages);
    entry != NULL;
    entry = ldap_next_entry(ld, entry)) {
        keys = ldap_get_values(ld, entry, entry_key_attribute);
        values = ldap_get_values(ld, entry, value_attribute);
        if(keys && keys[0] && values && values[0]) {
            found = 1;
            printf("%s %s\n", keys[0], values[0]);
        }
----

Notice the printf prints the key then the value.

The key is taken from the 'cn: ', and the second is taken from what 
it considers to be 'value'. For my LDAP server, 'value' is 
the 'nisMapEntry:'. In other words, I have an entry something like 
this:

# auto.rhome, auto.master, yyy, zzz
dn: cn=auto.rhome,nisMapName=auto.master,o=yyy,l=zzz
objectClass: nisObject
cn: /rhome
nisMapEntry: ldap:node.example.com:nisMapName=auto.rhome,o=rtr,l=zko
nisMapName: auto.master

Notice that the 'cn:' specifies the directory name,and 'nisMapEntry:' 
contains the full entry as it would be seen in auto.master file, 
including the 'ldap:' and the node (though the documentation says the 
node can be omitted and will be taken from the /etc/ldap.conf file).

Finally, the LDAP server hosts all of the automount files including 
the auto.master file, and I don't need to put any files in /etc to 
get it working.

Cheers.
Comment 5 Need Real Name 2004-02-08 00:58:29 EST
Forgot to mention:

The above works for Redhat Enterprise Linux 2.1 (taken from Redhat 
7.2 code stream), Redhat 9.0, and Redhat Enterprise Linux 3.0. 
Probably works for others also. I just don't have the machines to try 
it.
Comment 6 Bill Nottingham 2006-08-04 23:58:13 EDT
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (http://www.fedoralegacy.org/)
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been
provided.

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.
Comment 7 Jonathan Kamens 2006-08-10 03:58:47 EDT
I imagine that this must be fixed by now, but I really have no idea.  I'm no
longer at a site that uses LDAP, so I can't easily confirm that it's fixed.
Comment 8 Bill Nottingham 2006-10-18 14:12:02 EDT
Red Hat Linux is no longer supported by Red Hat, Inc. If you are still
running Red Hat Linux, you are strongly advised to upgrade to a
current Fedora Core release or Red Hat Enterprise Linux or comparable.
Some information on which option may be right for you is available at
http://www.redhat.com/rhel/migrate/redhatlinux/.

Red Hat apologizes that these issues have not been resolved yet. We do
want to make sure that no important bugs slip through the cracks.
If this issue is still present in a current Fedora Core release, please
open a new bug with the relevant information.

Closing as CANTFIX.

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