Bug 251262 - ldap-agent needs to find slapd.stats file dynamically
ldap-agent needs to find slapd.stats file dynamically
Product: 389
Classification: Community
Component: snmp (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Nathan Kinder
Viktor Ashirov
Depends On:
Blocks: 240316 FDS1.1.0
  Show dependency treegraph
Reported: 2007-08-07 18:42 EDT by Nathan Kinder
Modified: 2015-12-07 12:04 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-12-07 12:04:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
CVS Diffs (5.22 KB, patch)
2007-08-07 18:42 EDT, Nathan Kinder
no flags Details | Diff
Revised Diffs (10.04 KB, patch)
2007-08-08 02:18 EDT, Nathan Kinder
no flags Details | Diff

  None (edit)
Description Nathan Kinder 2007-08-07 18:42:35 EDT
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 18:42:35 EDT
Created attachment 160867 [details]
CVS Diffs
Comment 2 Rich Megginson 2007-08-07 18:54:32 EDT
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 02:18:52 EDT
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

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 12:13:20 EDT
Comment 5 Nathan Kinder 2007-08-08 12:50:35 EDT
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
Checking in Makefile.in;
/cvs/dirsec/ldapserver/Makefile.in,v  <--  Makefile.in
new revision: 1.63; previous revision: 1.62
Checking in ltmain.sh;
/cvs/dirsec/ldapserver/ltmain.sh,v  <--  ltmain.sh
new revision: 1.17; previous revision: 1.16
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

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