Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 251262

Summary: ldap-agent needs to find slapd.stats file dynamically
Product: [Retired] 389 Reporter: Nathan Kinder <nkinder>
Component: snmpAssignee: Nathan Kinder <nkinder>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: low Docs Contact:
Priority: low    
Version: 1.1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 17:04:38 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:
Bug Depends On:    
Bug Blocks: 240316, 427409    
Attachments:
Description Flags
CVS Diffs
none
Revised Diffs none

Description Nathan Kinder 2007-08-07 22:42:35 UTC
Our SNMP subagent (ldap-agent) currently requires a full path to a DS instance
in it's config file.  It is hardcoded to look in the log subdirectory for the
slapd.stats file.  It also uses expects a config subdirectory to find the
dse.ldif.  This will no longer work now that DS has been restructured to follow
FHS standards.

The proposed fix changes the ldap-agent config to simply expect the instance
name (i.e - slapd-foo).  The subagent will then use this instance name to load
the dse.ldif from the proper location in $SYSCONFDIR/$PACKAGE_NAME.  The
subagent will look up the value of nsslapd-tmpdir to find out where the
slapd.stats file is for that particular instance.  I also improved the error
checking around processing the ldap-agent config file.

Comment 1 Nathan Kinder 2007-08-07 22:42:35 UTC
Created attachment 160867 [details]
CVS Diffs

Comment 2 Rich Megginson 2007-08-07 22:54:32 UTC
That's not going to work if the value for nsslapd-tmpdir wraps to the next line,
which probably won't happen in production systems, but might in weird install
cases or QA.

Comment 3 Nathan Kinder 2007-08-08 06:18:52 UTC
Created attachment 160880 [details]
Revised Diffs

Rich brings up a good point about dealing with wrapped lines in the dse.ldif.  


This new set of diffs addresses this concern by using the ldif parsing
functions from the libldif library that is part of the Mozilla LDAP C SDK.  I
also did some error checking cleanup, particularly ensuring that we close any
files that we opened if we encounter an error condition while processing the
config.

I have also tested that these changes work when there is a wrapped line for one
of the attributes that we read in dse.ldif.

Comment 4 Rich Megginson 2007-08-08 16:13:20 UTC
Nice!

Comment 5 Nathan Kinder 2007-08-08 16:50:35 UTC
Checked into HEAD.  Thanks for the review Rich!

Checking in Makefile.am;
/cvs/dirsec/ldapserver/Makefile.am,v  <--  Makefile.am
new revision: 1.54; previous revision: 1.53
done
Checking in Makefile.in;
/cvs/dirsec/ldapserver/Makefile.in,v  <--  Makefile.in
new revision: 1.63; previous revision: 1.62
done
Checking in ltmain.sh;
/cvs/dirsec/ldapserver/ltmain.sh,v  <--  ltmain.sh
new revision: 1.17; previous revision: 1.16
done
Checking in ldap/servers/snmp/main.c;
/cvs/dirsec/ldapserver/ldap/servers/snmp/main.c,v  <--  main.c
new revision: 1.11; previous revision: 1.10
done