Bug 251262 - ldap-agent needs to find slapd.stats file dynamically
Summary: ldap-agent needs to find slapd.stats file dynamically
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: snmp
Version: 1.1.0
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Nathan Kinder
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 240316 FDS1.1.0
TreeView+ depends on / blocked
 
Reported: 2007-08-07 22:42 UTC by Nathan Kinder
Modified: 2015-12-07 17:04 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-07 17:04:38 UTC
Embargoed:


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

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


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