Bug 537466 - nsslapd-distribution-plugin should not require plugin name to begin with "lib"
Summary: nsslapd-distribution-plugin should not require plugin name to begin with "lib"
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Server - Plugins
Version: 1.3.0
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Keywords:
: 537234 (view as bug list)
Depends On:
Blocks: 434914 389_1.2.6
TreeView+ depends on / blocked
 
Reported: 2009-11-13 18:22 UTC by Jenny Galipeau
Modified: 2015-12-07 17:03 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2015-12-07 17:03:34 UTC


Attachments (Terms of Use)
patch (3.08 KB, patch)
2010-01-26 18:15 UTC, Rich Megginson
nhosoi: review+
Details | Diff

Description Jenny Galipeau 2009-11-13 18:22:22 UTC
Description of problem:
The nsslapd-distribution-plugin should not require the plugin name to begin with "lib". 
Example: "standard_distrib_plugin_Linux.so" will result in failure to load the plugin and the following in the errors log:

13/Nov/2009:09:51:09 -0500] - Netscape Portable Runtime error -5977: /usr//dirsrv/plugins/standard_distrib_plugin_Linux.so: cannot open shared object file: No such file or directory
[13/Nov/2009:09:51:09 -0500] - Could not open library "/usr//dirsrv/plugins/standard_distrib_plugin_Linux.so" for plugin Entry Distribution
[13/Nov/2009:09:51:09 -0500] - ERROR: node cn="o=my_suffix.com",cn=mapping tree,cn=config cannot find distribution plugin. Netscape Portable Runtime -5977 (Failure to load dynamic library.) 


Version-Release number of selected component (if applicable):
DS 9.0

How reproducible:


Steps to Reproduce:
1. place the plugin in /usr/lib<64>/dirsrv/plugins
2. Add the following:

dn: cn=BE_1,cn=ldbm database,cn=plugins,cn=config
objectclass: top
objectclass: extensibleObject
objectclass: nsBackendInstance
cn: BE_1
nsslapd-suffix: o=my_suffix.com

dn: cn=BE_2,cn=ldbm database,cn=plugins,cn=config
objectclass: top
objectclass: extensibleObject
objectclass: nsBackendInstance
cn: BE_2
nsslapd-suffix: o=my_suffix.com

dn: cn=BE_3,cn=ldbm database,cn=plugins,cn=config
objectclass: top
objectclass: extensibleObject
objectclass: nsBackendInstance
cn: BE_3
nsslapd-suffix: o=my_suffix.com

dn: cn="o=my_suffix.com",cn=mapping tree,cn=config
objectclass: top
objectclass: extensibleObject
objectclass: nsMappingTree
cn: "o=my_suffix.com"
nsslapd-state: backend
nsslapd-backend: BE_1
nsslapd-backend: BE_2
nsslapd-backend: BE_3
nsslapd-distribution-plugin: standard_distrib_plugin_Linux.so
nsslapd-distribution-funct: alpha_distribution

3. check the errors log
4. renaming the library to libstandard_distrib_plugin_Linux.so , will resolve the problem.
  
Actual results:


Expected results:


Additional info:

Comment 3 Rich Megginson 2009-12-02 18:48:21 UTC
*** Bug 537234 has been marked as a duplicate of this bug. ***

Comment 4 Rich Megginson 2010-01-26 18:15:25 UTC
Created attachment 386889 [details]
patch

Comment 5 Noriko Hosoi 2010-01-26 18:30:39 UTC
Comment on attachment 386889 [details]
patch

ack.

Comment 6 Rich Megginson 2010-01-26 18:41:59 UTC
To ssh://git.fedorahosted.org/git/389/ds.git
   73fdd3b..62d9674  master -> master

commit 62d967419616d77891c78e4ee3553482cbea1c17
Author: Rich Megginson <rmeggins@redhat.com>
Date:   Tue Jan 26 11:15:18 2010 -0700

    Reviewed by: nhosoi (Thanks!)
    Branch: HEAD
    Fix Description: We use the function PL_GetLibraryName from NSPR to get the
    platform specific DLL/shared lib filename suffix.  Unfortunately, this funct
    also prepends the string "lib" to the given name if the given file has no
    suffix.  If the given name already has the correct suffix, it does not prepe
    the "lib" to the name.  get_plugin_name() should look for the original
    library name in the string returned by PL_GetLibraryName.  If it is there, a
    has something before it in the string, see if it is "/lib" - if so, remove t
    extraneous "lib" string.  If "/lib" is not there, then just pass the string
    through as is.
    To summarize:
    /full/path/to/name.so -> /full/path/to/name.so - error if /full/path/to/name
    name -> /default/plugin/path/libname.so -> /default/plugin/path/name.so
    name.so -> /default/plugin/path/name.so
    Platforms tested: RHEL5 x86_64
    Flag Day: no
    Doc impact: no

Comment 7 Jenny Galipeau 2010-06-02 13:19:09 UTC
verfied - RHEL 4

version:
redhat-ds-base-8.2.0-2010053104.el4dsrv

plugin loaded correctly - no errors

# dc\3Dexample\2Cdc\3Dcom, mapping tree, config
dn: cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config
objectClass: top
objectClass: extensibleObject
objectClass: nsMappingTree
cn: dc=example,dc=com
cn: "dc=example,dc=com"
nsslapd-state: backend
nsslapd-backend: userRoot
nsslapd-backend: BE_1
nsslapd-backend: BE_2
nsslapd-backend: BE_3
nsslapd-distribution-plugin: standard_distrib_plugin_Linux.so
nsslapd-distribution-funct: alpha_distribution


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