Bug 248175

Summary: Include maps not working correctly with LDAP
Product: Red Hat Enterprise Linux 4 Reporter: Steve Rigler <srigler>
Component: autofsAssignee: Jeff Moyer <jmoyer>
Status: CLOSED ERRATA QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: low    
Version: 4.5CC: ikent
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0734 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-15 16:02:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
tgz file with ldif of included map, and other relevant info.
none
Don't reset the basedn for included maps. none

Description Steve Rigler 2007-07-13 18:04:17 UTC
Description of problem:
I am attempting to include an LDAP map within a file map.  The LDAP map is
included, however so are all of our other LDAP maps.

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

How reproducible:
Every time

Steps to Reproduce:
1. Configure /etc/auto.master to use a file map
2. Configure file map to include a LDAP map
3.
  
Actual results:
Maps other than the desired LDAP map are included.

Expected results:
Only the included LDAP map should be used.

Additional info:

Comment 1 Steve Rigler 2007-07-13 18:04:17 UTC
Created attachment 159223 [details]
tgz file with ldif of included map, and other relevant info.

Comment 2 Jeff Moyer 2007-07-13 18:20:15 UTC
lookup_map_included does this:
	ctxt = context_init(map);
	if (!ctxt)
		return 0;
which sets up the base dn, as shown in the logs:
Jul 13 12:41:21 houl11 automount[9120]: lookup(ldap): server = "(default)", port
 = 389, base dn = "automountmapname=auto_int,dc..."

but then we do this:

	ctxt->base = NULL;

hmmm.  I'll have to give some thought to the reason for this piece of code.  In
this case, if we hadn't set the base pointer to NULL, the query would have
worked as desired.

I'll attach a preliminary patch in a few minutes.

Comment 3 Jeff Moyer 2007-07-13 18:22:42 UTC
Created attachment 159226 [details]
Don't reset the basedn for included maps.

Please give this a try.  If you are unable to build packages, then please let
me know what architecture you are running and I will provide packages for you.

Comment 4 Steve Rigler 2007-07-13 18:40:42 UTC
Just tried it and it works good.  With the patch only the requested map is being
used.

Comment 6 RHEL Program Management 2007-07-20 20:08:14 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 7 Jeff Moyer 2007-07-20 21:39:11 UTC
A fix for this issue was committed to autofs-4_1_3-225.  An RHTS test was added
under /CoreOS/autofs/bugzillas, subtest bz248175.

Comment 12 errata-xmlrpc 2007-11-15 16:02:49 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