Browse Source

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.
Nathan Kinder 14 years ago
parent
commit
334b965a2a
1 changed files with 3 additions and 5 deletions
  1. 3 5
      ldap/servers/plugins/acct_usability/acct_usability.c

+ 3 - 5
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