[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm ldbm_attrcrypt_config.c, 1.6, 1.7 ldbm_config.c, 1.16, 1.17 ldbm_index_config.c, 1.8, 1.9 ldbm_modrdn.c, 1.9, 1.10

Nathan Kinder nkinder at fedoraproject.org
Thu Nov 13 23:08:21 UTC 2008


Author: nkinder

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9536/ldap/servers/slapd/back-ldbm

Modified Files:
	ldbm_attrcrypt_config.c ldbm_config.c ldbm_index_config.c 
	ldbm_modrdn.c 
Log Message:
Resolves: 470918
Summary: Made replica_set_updatedn detect value add modify operations properly.



Index: ldbm_attrcrypt_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ldbm_attrcrypt_config.c	10 Nov 2006 23:45:39 -0000	1.6
+++ ldbm_attrcrypt_config.c	13 Nov 2008 23:08:18 -0000	1.7
@@ -304,7 +304,7 @@
 
         if (strcasecmp(config_attr, "nsEncryptionAlgorithm") == 0) {
 
-            if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+            if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
 
                 for (j = 0; mods[i]->mod_bvalues[j] != NULL; j++) {
                     int cipher = ldbm_attrcrypt_parse_cipher(mods[i]->mod_bvalues[j]->bv_val);
@@ -315,7 +315,7 @@
                 }
                 continue;
             }
-            if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+            if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
                 if ((mods[i]->mod_bvalues == NULL) ||
                     (mods[i]->mod_bvalues[0] == NULL)) {
 					/* Not legal */


Index: ldbm_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_config.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ldbm_config.c	17 Oct 2008 16:54:47 -0000	1.16
+++ ldbm_config.c	13 Nov 2008 23:08:18 -0000	1.17
@@ -1727,8 +1727,8 @@
                 continue;
             }
             
-            if ((mods[i]->mod_op & LDAP_MOD_DELETE) || 
-                ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD)) { 
+            if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op) || 
+                SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { 
                 rc= LDAP_UNWILLING_TO_PERFORM; 
                 PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "%s attributes is not allowed", 
                         (mods[i]->mod_op & LDAP_MOD_DELETE) ? "Deleting" : "Adding"); 


Index: ldbm_index_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_index_config.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ldbm_index_config.c	15 Jul 2008 16:49:43 -0000	1.8
+++ ldbm_index_config.c	13 Nov 2008 23:08:19 -0000	1.9
@@ -392,14 +392,14 @@
         config_attr = (char *)mods[i]->mod_type;
 
         if (strcasecmp(config_attr, "nsIndexType") == 0) {
-            if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+            if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
                 for (j = 0; mods[i]->mod_bvalues[j] != NULL; j++) {
                     charray_add(&addIndexTypesArray,
                         slapi_ch_strdup(mods[i]->mod_bvalues[j]->bv_val));
                 }
                 continue;
             }
-            if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+            if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
                 if ((mods[i]->mod_bvalues == NULL) ||
                     (mods[i]->mod_bvalues[0] == NULL)) {
                     if (deleteIndexTypesArray) {
@@ -416,14 +416,14 @@
             }
         }
         if (strcasecmp(config_attr, "nsMatchingRule") == 0) {
-            if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+            if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
                 for (j = 0; mods[i]->mod_bvalues[j] != NULL; j++) {
                     charray_add(&addMatchingRulesArray,
                         slapi_ch_strdup(mods[i]->mod_bvalues[j]->bv_val));
                 }
                 continue;
             }
-            if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+            if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
                 if ((mods[i]->mod_bvalues == NULL) ||
                     (mods[i]->mod_bvalues[0] == NULL)) {
                     if (deleteMatchingRulesArray) {


Index: ldbm_modrdn.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ldbm_modrdn.c	17 Oct 2008 22:12:48 -0000	1.9
+++ ldbm_modrdn.c	13 Nov 2008 23:08:19 -0000	1.10
@@ -977,7 +977,7 @@
     for (mod = slapi_mods_get_first_mod(smods_wsi);
 		 mod != NULL;
 		 mod = slapi_mods_get_next_mod(smods_wsi)) {
-		if (((mod->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) && 
+		if (SLAPI_IS_MOD_DELETE(mod->mod_op) && 
 			(strcasecmp(mod->mod_type, type) == 0) &&
 			(mod->mod_bvalues != NULL) && 
 			(slapi_attr_value_cmp(attr, *mod->mod_bvalues, bvp) == 0)) {




More information about the Fedora-directory-commits mailing list