diff options
-rw-r--r-- | source3/passdb/pdb_ldap.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 0d680db2be..6fdf80074c 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -2896,12 +2896,15 @@ static NTSTATUS ldapsam_get_account_policy(struct pdb_methods *methods, int poli struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)methods->private_data; - char *attrs[] = { - (char *)get_attr_key2string(acctpol_attr_list, LDAP_ATTR_ACCOUNT_POLICY_NAME), - (char *)get_attr_key2string(acctpol_attr_list, LDAP_ATTR_ACCOUNT_POLICY_VAL), + const char *attrs[] = { + NULL, + NULL, NULL }; + attrs[0] = get_attr_key2string(acctpol_attr_list, LDAP_ATTR_ACCOUNT_POLICY_NAME); + attrs[1] = get_attr_key2string(acctpol_attr_list, LDAP_ATTR_ACCOUNT_POLICY_VAL); + if (cache_account_policy_get(policy_index, value)) { DEBUG(11,("ldapsam_get_account_policy: got valid value from cache\n")); return NT_STATUS_OK; @@ -3009,12 +3012,15 @@ static NTSTATUS ldapsam_set_account_policy(struct pdb_methods *methods, int poli struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)methods->private_data; - char *attrs[] = { - (char *)get_attr_key2string(acctpol_attr_list, LDAP_ATTR_ACCOUNT_POLICY_NAME), - (char *)get_attr_key2string(acctpol_attr_list, LDAP_ATTR_ACCOUNT_POLICY_VAL), + const char *attrs[] = { + NULL, + NULL, NULL }; + attrs[0] = get_attr_key2string(acctpol_attr_list, LDAP_ATTR_ACCOUNT_POLICY_NAME), + attrs[1] = get_attr_key2string(acctpol_attr_list, LDAP_ATTR_ACCOUNT_POLICY_VAL), + policy_string = decode_account_policy_name(policy_index); if (!policy_string) { DEBUG(0,("ldapsam_set_account_policy: invalid policy\n")); |