diff options
author | Rich Megginson <rmeggins@redhat.com> | 2005-01-25 22:38:13 +0000 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2005-01-25 22:38:13 +0000 |
commit | e64a91376288adece5d9578a93ede1bc15db1b5d (patch) | |
tree | 3d693bb559c91e2e1c606064e4b9504000126a53 /ldap/servers/slapd/entry.c | |
parent | 9c26d438cf54749a9803ca8d9305e4a085dd2f75 (diff) | |
download | ds-e64a91376288adece5d9578a93ede1bc15db1b5d.tar.gz ds-e64a91376288adece5d9578a93ede1bc15db1b5d.tar.xz ds-e64a91376288adece5d9578a93ede1bc15db1b5d.zip |
Bug(s) fixed: 145179
Bug Description: The auth specific PAM libraries do not have a run time
dependency on libpam, but they do use symbols
in libpam - they expect the executable has already loaded libpam and
made its symbols visible to all other
dynamically loaded libraries. This breaks with DS when loading the PAM
plugin since we just use the default
dlopen arguments, which make the symbols private. We need a way to tell
the plugin loader to treat certain
plugins differently without changing the behavior for all plugins.
Reviewed by: dboreham, nkinder (Thanks!)
Fix Description: Added two new plugin configuration options:
nsslapd-pluginLoadNow and nsslapd-pluginLoadGlobal. These are boolean
valued and false by default (also false if absent). LoadNow causes all
symbols in the plugin and all of its dependents to be loaded
immediately, as opposed to load lazy which only loads the symbol when
used the first time (we probably don't ever want to do this, but it's
there if we need it). LoadGlobal makes all loaded symbols visible to
the executable and all other dynamically loaded libraries, which solves
the PAM problem.
Platforms tested: RHEL3
Flag Day: no
Doc impact: Yes. Need to document the two new plugin config attributes
and their behavior, and document slapi_entry_get_bool().
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Diffstat (limited to 'ldap/servers/slapd/entry.c')
-rw-r--r-- | ldap/servers/slapd/entry.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c index 0d315053..dc232db2 100644 --- a/ldap/servers/slapd/entry.c +++ b/ldap/servers/slapd/entry.c @@ -2180,6 +2180,36 @@ slapi_entry_attr_get_ulong( const Slapi_Entry* e, const char *type) return r; } +PRBool +slapi_entry_attr_get_bool( const Slapi_Entry* e, const char *type) +{ + PRBool r = PR_FALSE; /* default if no attr */ + Slapi_Attr* attr; + slapi_entry_attr_find(e, type, &attr); + if (attr!=NULL) + { + Slapi_Value *v; + const struct berval *bvp; + + slapi_valueset_first_value( &attr->a_present_values, &v); + bvp = slapi_value_get_berval(v); + if ((bvp == NULL) || (bvp->bv_len == 0)) { /* none or empty == false */ + r = PR_FALSE; + } else if (!PL_strncasecmp(bvp->bv_val, "true", bvp->bv_len)) { + r = PR_TRUE; + } else if (!PL_strncasecmp(bvp->bv_val, "false", bvp->bv_len)) { + r = PR_FALSE; + } else if (!PL_strncasecmp(bvp->bv_val, "yes", bvp->bv_len)) { + r = PR_TRUE; + } else if (!PL_strncasecmp(bvp->bv_val, "no", bvp->bv_len)) { + r = PR_FALSE; + } else { /* assume numeric: 0 - false: non-zero - true */ + r = (PRBool)slapi_value_get_ulong(v); + } + } + return r; +} + void slapi_entry_attr_set_charptr( Slapi_Entry* e, const char *type, const char *value) { |