Bug 239029 - Autofs is not looking up automountkey in ldap correctly.
Summary: Autofs is not looking up automountkey in ldap correctly.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: autofs
Version: 4.5
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jeff Moyer
QA Contact: Brock Organ
URL:
Whiteboard:
: 242071 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-05-04 14:59 UTC by Steve Rigler
Modified: 2018-10-19 23:20 UTC (History)
2 users (show)

Fixed In Version: RHBA-2007-0734
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-15 16:02:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Logs from ldap server when autofs tries to mount "/software/Linux" (3.67 KB, text/plain)
2007-05-04 14:59 UTC, Steve Rigler
no flags Details
Handle the return code of CHE_MISSING properly in lookup_one. (543 bytes, patch)
2007-07-23 18:14 UTC, Jeff Moyer
no flags Details | Diff
Fix up broken logic statement (545 bytes, patch)
2007-09-04 17:11 UTC, Jeff Moyer
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0734 0 normal SHIPPED_LIVE autofs bug fix update 2007-11-14 16:46:54 UTC

Description Steve Rigler 2007-05-04 14:59:28 UTC
Description of problem:
We are using ldap maps using the automountkey/automountinformation type schema.
 After upgrading to autofs-4.1.3-199.3, automount is no longer searching for
automountkey correctly.  In the ldap server logs we see automount searching for
"cn=<key>", "cn=/", and "automountkey=/", but never a search for
"automountkey=<key>".

Version-Release number of selected component (if applicable):
autofs-4.1.3-199.3

How reproducible:
Always

Steps to Reproduce:
1. Use maps in ldap with automountkey/automountinformation schema
2. Start autofs
3.
  
Actual results:
Keys are never matched, so the mount never happens successfully.

Expected results:
Automount should search for automountkey=<mountpoint>

Additional info:

Comment 1 Steve Rigler 2007-05-04 14:59:28 UTC
Created attachment 154129 [details]
Logs from ldap server when autofs tries to mount "/software/Linux"

Comment 2 Jeff Moyer 2007-05-04 15:35:14 UTC
Please include a debug log and a copy of your master map and the ldif for the
map in question.  Please also provide the contents of /etc/sysconfig/autofs and
the automount: line in /etc/nsswitch.conf.  You can find information about
generating debug logs from:
  http://people.redhat.com/jmoyer/

Thanks!

Comment 3 Steve Rigler 2007-05-04 15:48:44 UTC
Chalk this up as user error.

We change /etc/sysconfig/autofs to reflect the auto.master name.  I noticed that
the rpm created /etc/sysconfig/autofs.rpmnew with the primary difference being
"OLD_LDAP_LOOKUP=0".  Adding this line to /etc/sysconfig/autofs fixes our problem.

Thanks for the quick response!

Comment 4 Jeff Moyer 2007-05-04 15:52:55 UTC
Hmm, OLD_LDAP_LOOKUP=1 is supposed to preserve the existing behaviour!  It seems
I botched that up, but good.  I'm going to keep this bug open until I can figure
out exactly what is going on.

I'm glad it's working for you.  You should also notice a reduced load on your
ldap servers with this new package.  Enjoy!

Comment 5 Glen Dosey 2007-05-08 20:42:03 UTC
It should be noted this is not user error. It appears to be a change in default
behavior, perhaps unintentionally. Previous versions of autofs did not define
OLD_LDAP_LOOKUP in /etc/sysconfig/autofs . Specifically autofs-4.1.3-187.
Upgrading to autofs-4.1.3-199.3 introduced changes into the autofs startup
script, specifically the OLD_LDAP_LOOKUP variable which is defined to 1 in the
script, thereby enabling the (undocumented ?) --use-old-ldap-lookup option. This
option apparently disables lookups using the automount style schema and enables
lookups using only the nisMap style schema.

Will a new package be available which maintains the existing default behavior
without requiring changes to the /etc/sysconfig/autofs file ?

Comment 6 Jeff Moyer 2007-05-08 21:07:25 UTC
(In reply to comment #5)
> It should be noted this is not user error. It appears to be a change in default
> behavior, perhaps unintentionally.
[snip]

Let me set the story straight, here.  I know this is not a user error, and I am
investigating a fix for this problem.

I introduced a patch to reduce the load on the back-end LDAP servers:
* Wed Jan  3 2007  Jeff Moyer <jmoyer> - 1:4.1.3-199
- Resolves: reduce the load incurred on ldap servers (bz #210182, bz #210185)

The patch introduced the OLD_LDAP_LOOKUP variable in /etc/sysconfig/autofs TO
RETAIN BACKWARDS COMPATIBILITY.  The old behaviour was to try every schema type
for every LDAP query until an answer was returned.  This is what should still be
happening (and obviously is not) when this flag is set to 1.

Now, with the new code, we cycle through each available schma type until we find
one that works.  We then squirrel away the information on which schema works so
that we don't have to try every one in succession for future lookups.

Given that the new behaviour seems to work, it is actually preferrable to use
it.  I will, however, fix the fallback behaviour.

> Will a new package be available which maintains the existing default behavior
> without requiring changes to the /etc/sysconfig/autofs file ?

Yes, as I stated above.

Comment 7 greg matthews 2007-05-11 15:48:58 UTC
This bit us too after an up2date. Can confirm that OLD_LDAP_LOOKUP=0 gets it
working again.



Comment 8 Chris Van Hoof 2007-06-01 15:32:31 UTC
*** Bug 242071 has been marked as a duplicate of this bug. ***

Comment 10 Jeff Moyer 2007-07-23 18:14:11 UTC
Created attachment 159799 [details]
Handle the return code of CHE_MISSING properly in lookup_one.

This patch fixes the problem in my test environment.

Comment 12 RHEL Program Management 2007-07-23 18:18:56 UTC
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.

Comment 15 Jeff Moyer 2007-07-24 20:02:57 UTC
A fix for this bug was committed to autofs version 4.1.3-226.

Comment 18 Jeff Moyer 2007-09-03 12:29:07 UTC
This patch is missing parenthesis, which changes the result of the calculation.
 It needs to be fixed.

Comment 19 Jeff Moyer 2007-09-04 17:11:22 UTC
Created attachment 186341 [details]
Fix up broken logic statement

Comment 22 Jeff Moyer 2007-09-05 18:57:57 UTC
A fix for this issue was committed to autofs version 4.1.3-231.

Comment 26 errata-xmlrpc 2007-11-15 16:02:20 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0734.html



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