ldap/servers/plugins/acct_usability/acct_usability.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
New commits:
commit 334b965a2a6fb43157b8e3b7ed3102497884dc8f
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Thu Oct 6 08:32:48 2011 -0700
Bug 743966 - Compiler warnings in account usability plugin
This addresses 2 compiler warnings that are seen when compiling the
account usability plug-in. One issue is that we are passing a 'char *'
to slapi_get_pwpolicy(), which expects a 'Slapi_DN *'. The other
issue is that we are calling plugin_call_acl_plugin(), which is not
a public function. This function is wrapped by the public function
slapi_access_allowed(), which we should use instead.
diff --git a/ldap/servers/plugins/acct_usability/acct_usability.c
b/ldap/servers/plugins/acct_usability/acct_usability.c
index bc8e73d..19e55c3 100644
--- a/ldap/servers/plugins/acct_usability/acct_usability.c
+++ b/ldap/servers/plugins/acct_usability/acct_usability.c
@@ -242,7 +242,7 @@ static LDAPControl *auc_create_response_ctrl(Slapi_Entry *e)
}
/* Fetch password policy info */
- pwpolicy = slapi_get_pwpolicy(slapi_entry_get_ndn(e));
+ pwpolicy = slapi_get_pwpolicy(slapi_entry_get_sdn(e));
if (pwpolicy) {
expired = slapi_pwpolicy_is_expired(pwpolicy, e, &expire_time,
&remaining_grace);
inactive = slapi_pwpolicy_is_locked(pwpolicy, e, &unlock_time);
@@ -378,11 +378,9 @@ auc_pre_search(Slapi_PBlock *pb)
/* Fetch the feature entry and see if the requestor is allowed access. */
PR_snprintf(dn, sizeof(dn), "dn: oid=%s,cn=features,cn=config",
AUC_OID);
if ((feature = slapi_str2entry(dn,0)) != NULL) {
- char *dummyAttr = "1.1";
- char *dummyAttrs[2] = { NULL, NULL };
+ char *dummy_attr = "1.1";
- dummyAttrs[0] = dummyAttr;
- ldapcode = plugin_call_acl_plugin (pb, feature, dummyAttrs, NULL,
SLAPI_ACL_READ, ACLPLUGIN_ACCESS_DEFAULT, NULL);
+ ldapcode = slapi_access_allowed(pb, feature, dummy_attr, NULL,
SLAPI_ACL_READ);
}
/* If the feature entry does not exist, deny use of the control. Only
Show replies by date