r5166: From James Peach - remove minor C99-isms.
authorJeremy Allison <jra@samba.org>
Wed, 2 Feb 2005 01:58:18 +0000 (01:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:55:31 +0000 (10:55 -0500)
Jeremy.
(This used to be commit 54ac409d4fd3b6e8e2bd338dabed446a92507811)

source3/passdb/pdb_ldap.c

index 0d680db2be7d4eda80588775cc415204beb78430..6fdf80074c580ba068ef65d8a95b46ffefa0db29 100644 (file)
@@ -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"));