From fedora-directory-commits at redhat.com Mon Aug 1 18:05:56 2005 From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder)) Date: Mon, 1 Aug 2005 14:05:56 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/uiduniq uid.c, 1.6, 1.7 Message-ID: <200508011805.j71I5uso009407@cvs-int.fedora.redhat.com> Author: nkinder Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9391 Modified Files: uid.c Log Message: 164017 - Attribute uniqueness plugin now only checks for conflicts in subtrees that the operation applies to Index: uid.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq/uid.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- uid.c 19 Apr 2005 22:07:35 -0000 1.6 +++ uid.c 1 Aug 2005 18:05:27 -0000 1.7 @@ -383,8 +383,14 @@ */ for(;argc > 0;argc--,argv++) { - result = search(*argv, attrName, attr, values, dn); - if (result) break; + /* + * The DN should already be normalized, so we don't have to + * worry about that here. + */ + if (slapi_dn_issuffix(dn, *argv)) { + result = search(*argv, attrName, attr, values, dn); + if (result) break; + } } return result; } From fedora-directory-commits at redhat.com Wed Aug 10 20:56:37 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Wed, 10 Aug 2005 16:56:37 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/uiduniq 7bit.c, 1.5, 1.6 Message-ID: <200508102056.j7AKubR7009896@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9879 Modified Files: 7bit.c Log Message: Bug(s) fixed: 165600 Bug Description: Adding multiple attributes using a single ldapmodify crashes ns-slapd Reviewed by: Nathan (Thanks!) Fix Description: In C, the array '[]' dereference operator takes precedence over the '*' deref operator. In this case, I needed to put parentheses around the pointer dereference to avoid having array dereferenced first. modary is a pointer to an array, not an array, so I can't dereference it with the array operator until I first dereference the pointer. Platforms tested: RHEL3 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: 7bit.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq/7bit.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- 7bit.c 19 Apr 2005 22:07:35 -0000 1.5 +++ 7bit.c 10 Aug 2005 20:56:35 -0000 1.6 @@ -344,7 +344,7 @@ *modary = (LDAPMod **)slapi_ch_malloc(*capacity * sizeof(LDAPMod *)); } } - *modary[*nmods] = toadd; + (*modary)[*nmods] = toadd; (*nmods)++; } From fedora-directory-commits at redhat.com Thu Aug 11 16:45:07 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Thu, 11 Aug 2005 12:45:07 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/views views.c, 1.5, 1.6 Message-ID: <200508111645.j7BGj7fH006583@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/views In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6565/ldapserver/ldap/servers/plugins/views Modified Files: views.c Log Message: Bug(s) fixed: 165640 Bug Description: Directory Server crashes when deleting a view Reviewed by: Nathan (Thanks!) Fix Description: Needed to pass in the _address_ of theCache.pCacheViews to views_cache_add_ll_entry. Yet another lesson in using the compiler to catch type errors rather than casting to void*. Platforms tested: RHEL3 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: views.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/views/views.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- views.c 19 Apr 2005 22:07:36 -0000 1.5 +++ views.c 11 Aug 2005 16:45:04 -0000 1.6 @@ -1529,7 +1529,7 @@ theView->parentid = 0; /* add view to the cache */ - views_cache_add_ll_entry((void**)theCache.pCacheViews, (void *)theView); + views_cache_add_ll_entry((void**)&theCache.pCacheViews, (void *)theView); views_cache_discover_parent(theView); if(theView->pParent) From fedora-directory-commits at redhat.com Fri Aug 12 05:49:57 2005 From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder)) Date: Fri, 12 Aug 2005 01:49:57 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd libslapd.def, 1.11, 1.12 slapi-private.h, 1.8, 1.9 Message-ID: <200508120549.j7C5nv5p025590@cvs-int.fedora.redhat.com> Author: nkinder Update of /cvs/dirsec/ldapserver/ldap/servers/slapd In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25560 Modified Files: libslapd.def slapi-private.h Log Message: 164843 - Modified indexing to deal with attribute subtypes Index: libslapd.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/libslapd.def,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- libslapd.def 19 Apr 2005 22:07:36 -0000 1.11 +++ libslapd.def 12 Aug 2005 05:49:54 -0000 1.12 @@ -1056,6 +1056,7 @@ slapi_entry_delete_values_sv @1058 slapi_entry_attr_replace_sv @1059 + valuearray_find @1060 valuearray_free @1061 slapd_Client_auth @1062 slapi_rand_r @1063 Index: slapi-private.h =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slapi-private.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- slapi-private.h 19 Apr 2005 22:07:37 -0000 1.8 +++ slapi-private.h 12 Aug 2005 05:49:54 -0000 1.9 @@ -778,6 +778,7 @@ void valuearray_add_value_fast(Slapi_Value ***vals, Slapi_Value *addval, int nvals, int *maxvals, int exact, int passin); void valuearray_add_valuearray( Slapi_Value ***vals, Slapi_Value **addvals, PRUint32 flags ); void valuearray_add_valuearray_fast( Slapi_Value ***vals, Slapi_Value **addvals, int nvals, int naddvals, int *maxvals, int exact, int passin ); +int valuearray_find(const Slapi_Attr *a, Slapi_Value **va, const Slapi_Value *v); /****************************************************************************** From fedora-directory-commits at redhat.com Fri Aug 12 05:49:57 2005 From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder)) Date: Fri, 12 Aug 2005 01:49:57 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm back-ldbm.h, 1.5, 1.6 index.c, 1.5, 1.6 Message-ID: <200508120550.j7C5nvsT025597@cvs-int.fedora.redhat.com> Author: nkinder Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25560/back-ldbm Modified Files: back-ldbm.h index.c Log Message: 164843 - Modified indexing to deal with attribute subtypes Index: back-ldbm.h =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/back-ldbm.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- back-ldbm.h 25 Apr 2005 16:24:23 -0000 1.5 +++ back-ldbm.h 12 Aug 2005 05:49:55 -0000 1.6 @@ -637,6 +637,7 @@ #define BE_INDEX_PRESENCE 4 /* (w/DEL) remove the presence index */ #define BE_INDEX_TOMBSTONE 8 /* Index entry as a tombstone */ #define BE_INDEX_DONT_ENCRYPT 16 /* Disable any encryption if this flag is set */ +#define BE_INDEX_EQUALITY 32 /* (w/DEL) remove the equality index */ /* Name of attribute type used for binder-based look through limit */ #define LDBM_LOOKTHROUGHLIMIT_AT "nsLookThroughLimit" Index: index.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/index.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- index.c 19 Apr 2005 22:07:38 -0000 1.5 +++ index.c 12 Aug 2005 05:49:55 -0000 1.6 @@ -453,35 +453,118 @@ ) { int rc = 0; - int i; - Slapi_Attr *attr; + int i, j; ID id = olde->ep_id; - Slapi_Value **svals = NULL; + int flags = 0; + char buf[SLAPD_TYPICAL_ATTRIBUTE_NAME_MAX_LENGTH]; + char *basetype = NULL; + char *tmp = NULL; + Slapi_Attr *curr_attr = NULL; + Slapi_ValueSet *all_vals = NULL; + Slapi_ValueSet *mod_vals = NULL; + Slapi_Value **evals = NULL; /* values that still exist after a + * delete. + */ + Slapi_Value **mods_valueArray = NULL; /* values that are specified in this + * operation. + */ + Slapi_Value **deleted_valueArray = NULL; /* values whose index entries + * should be deleted. + */ for ( i = 0; mods[i] != NULL; i++ ) { + /* Get base attribute type */ + basetype = buf; + tmp = slapi_attr_basetype(mods[i]->mod_type, buf, sizeof(buf)); + if(tmp != NULL) { + basetype = tmp; /* basetype was malloc'd */ + } + + /* Get a list of all remaining values for the base type + * and any present subtypes. + */ + all_vals = slapi_valueset_new(); + + for (curr_attr = newe->ep_entry->e_attrs; curr_attr != NULL; curr_attr = curr_attr->a_next) { + if (slapi_attr_type_cmp( basetype, curr_attr->a_type, SLAPI_TYPE_CMP_BASE ) == 0) { + valueset_add_valuearray(all_vals, attr_get_present_values(curr_attr)); + } + } + + evals = valueset_get_valuearray(all_vals); + + /* Get a list of all values specified in the operation. + */ + if ( mods[i]->mod_bvalues != NULL ) { + valuearray_init_bervalarray(mods[i]->mod_bvalues, + &mods_valueArray); + } + switch ( mods[i]->mod_op & ~LDAP_MOD_BVALUES ) { case LDAP_MOD_REPLACE: + flags = BE_INDEX_DEL; + /* Get a list of all values being deleted. + */ + mod_vals = slapi_valueset_new(); + + for (curr_attr = olde->ep_entry->e_attrs; curr_attr != NULL; curr_attr = curr_attr->a_next) { + if (slapi_attr_type_cmp( mods[i]->mod_type, curr_attr->a_type, SLAPI_TYPE_CMP_EXACT ) == 0) { + valueset_add_valuearray(mod_vals, attr_get_present_values(curr_attr)); + } + } + + deleted_valueArray = valueset_get_valuearray(mod_vals); + + /* If subtypes exist, don't remove the presence + * index. + */ + if ( evals != NULL && deleted_valueArray != NULL) { + /* evals will contain the new value that is being + * added as part of the replace operation if one + * was specified. We must remove this value from + * evals to know if any subtypes are present. + */ + slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &curr_attr ); + if ( mods_valueArray != NULL ) { + for ( j = 0; mods_valueArray[j] != NULL; j++ ) { + valuearray_remove_value(curr_attr, evals, mods_valueArray[j]); + } + } + + /* Search evals for the values being deleted. If + * they don't exist, delete the equality index. + */ + for ( j = 0; deleted_valueArray[j] != NULL; j++ ) { + if (valuearray_find(curr_attr, evals, deleted_valueArray[j]) == -1) { + if (!(flags & BE_INDEX_EQUALITY)) { + flags |= BE_INDEX_EQUALITY; + } + } else { + /* Remove duplicate value from deleted value array */ + valuearray_remove_value(curr_attr, deleted_valueArray, deleted_valueArray[j]); + j--; + } + } + } else { + flags |= BE_INDEX_PRESENCE|BE_INDEX_EQUALITY; + } + /* We need to first remove the old values from the * index. */ - if ( slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &attr ) == 0 && - (svals = attr_get_present_values(attr)) != NULL ) { index_addordel_values_sv( be, mods[i]->mod_type, - svals, NULL, id, - BE_INDEX_DEL|BE_INDEX_PRESENCE, - txn ); - } + deleted_valueArray, evals, id, + flags, txn ); + + /* Free valuearray */ + slapi_valueset_free(mod_vals); case LDAP_MOD_ADD: - if ( mods[i]->mod_bvalues == NULL ) { + if ( mods_valueArray == NULL ) { rc = 0; } else { - Slapi_Value **mods_valueArray = NULL; - valuearray_init_bervalarray(mods[i]->mod_bvalues, - &mods_valueArray); rc = index_addordel_values_sv( be, mods[i]->mod_type, mods_valueArray, NULL, id, BE_INDEX_ADD, txn ); - valuearray_free(&mods_valueArray); } break; @@ -489,44 +572,88 @@ if ( (mods[i]->mod_bvalues == NULL) || (mods[i]->mod_bvalues[0] == NULL) ) { rc = 0; - /* if no value are specified all the values will - * be suppressed -> remove the presence index + flags = BE_INDEX_DEL; + + /* Get a list of all values that are being + * deleted. */ - if ( slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &attr ) == 0 && - (svals = attr_get_present_values(attr)) != NULL ) { - index_addordel_values_sv( be, mods[i]->mod_type, - svals, NULL, id, BE_INDEX_DEL|BE_INDEX_PRESENCE, txn); + mod_vals = slapi_valueset_new(); + + for (curr_attr = olde->ep_entry->e_attrs; curr_attr != NULL; curr_attr = curr_attr->a_next) { + if (slapi_attr_type_cmp( mods[i]->mod_type, curr_attr->a_type, SLAPI_TYPE_CMP_EXACT ) == 0) { + valueset_add_valuearray(mod_vals, attr_get_present_values(curr_attr)); + } + } + + deleted_valueArray = valueset_get_valuearray(mod_vals); + + /* If subtypes exist, don't remove the + * presence index. + */ + if (evals != NULL) { + for (curr_attr = newe->ep_entry->e_attrs; (curr_attr != NULL); + curr_attr = curr_attr->a_next) { + if (slapi_attr_type_cmp( basetype, curr_attr->a_type, SLAPI_TYPE_CMP_BASE ) == 0) { + /* Check if the any values being deleted + * also exist in a subtype. + */ + for ( j=0; deleted_valueArray[j] != NULL; j++) { + if ( valuearray_find(curr_attr, evals, deleted_valueArray[j]) == -1 ) { + /* If the equality flag isn't already set, set it */ + if (!(flags & BE_INDEX_EQUALITY)) { + flags |= BE_INDEX_EQUALITY; + } + } else { + /* Remove duplicate value from the mod list */ + valuearray_remove_value(curr_attr, deleted_valueArray, deleted_valueArray[j]); + j--; + } + } + } + } + } else { + flags = BE_INDEX_DEL|BE_INDEX_PRESENCE|BE_INDEX_EQUALITY; } + + /* Update the index */ + index_addordel_values_sv( be, mods[i]->mod_type, + deleted_valueArray, evals, id, flags, txn); + + slapi_valueset_free(mod_vals); } else { + /* determine if the presence key should be * removed (are we removing the last value * for this attribute?) */ - int flags = BE_INDEX_DEL; - Slapi_Value ** svals = NULL; - Slapi_Value **mods_valueArray = NULL; - - valuearray_init_bervalarray(mods[i]->mod_bvalues, - &mods_valueArray); - - if (slapi_entry_attr_find(newe->ep_entry, - mods[i]->mod_type, &attr) == 0) { - svals = attr_get_present_values(attr); + if (evals == NULL || evals[0] == NULL) { + flags = BE_INDEX_DEL|BE_INDEX_PRESENCE; + } else { + flags = BE_INDEX_DEL; } - if (svals == NULL || svals[0] == NULL) { - flags |= BE_INDEX_PRESENCE; - } + /* If the same value doesn't exist in a subtype, set + * BE_INDEX_EQUALITY flag so the equality index is + * removed. + */ + slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &curr_attr); + if ( valuearray_find(curr_attr, evals, mods_valueArray[i]) == -1 ) { + flags |= BE_INDEX_EQUALITY; + } - rc = index_addordel_values_sv( be, mods[i]->mod_type, + rc = index_addordel_values_sv( be, basetype, mods_valueArray, - svals, id, flags, txn ); - valuearray_free(&mods_valueArray); + evals, id, flags, txn ); } rc = 0; break; } + /* free memory */ + slapi_ch_free((void **)&tmp); + valuearray_free(&mods_valueArray); + slapi_valueset_free(all_vals); + if ( rc != 0 ) { ldbm_nasty(errmsg, 1040, rc); return( rc ); @@ -1595,7 +1722,11 @@ /* * equality index entry */ - if ( ai->ai_indexmask & INDEX_EQUALITY ) { + if (( ai->ai_indexmask & INDEX_EQUALITY ) && + (flags & (BE_INDEX_ADD|BE_INDEX_EQUALITY))) { + /* on delete, only remove the equality index if the + * BE_INDEX_EQUALITY flag is set. + */ slapi_call_syntax_values2keys_sv( ai->ai_plugin, vals, &ivals, LDAP_FILTER_EQUALITY ); From fedora-directory-commits at redhat.com Fri Aug 12 19:07:40 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Fri, 12 Aug 2005 15:07:40 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm index.c, 1.6, 1.7 Message-ID: <200508121907.j7CJ7eYL013327@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13302 Modified Files: index.c Log Message: Bug(s) fixed: 165827 Bug Description: Daily Acceptance: Directory Install failed to register Directory server as a Red Hat server (81) Reviewed by: Nathan (Thanks!) Fix Description: The index code, in the replace case, was not checking to see if there were actually any values to delete before attempting to delete them. This fix just checks to see if there are any values to delete. Platforms tested: RHEL3 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing with the new indexing tests New Tests integrated into TET: none Index: index.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/index.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- index.c 12 Aug 2005 05:49:55 -0000 1.6 +++ index.c 12 Aug 2005 19:07:37 -0000 1.7 @@ -550,10 +550,12 @@ } /* We need to first remove the old values from the - * index. */ + * index, if any. */ + if (deleted_valueArray) { index_addordel_values_sv( be, mods[i]->mod_type, deleted_valueArray, evals, id, flags, txn ); + } /* Free valuearray */ slapi_valueset_free(mod_vals); From fedora-directory-commits at redhat.com Fri Aug 12 22:52:32 2005 From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder)) Date: Fri, 12 Aug 2005 18:52:32 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm ldbm_delete.c, 1.4, 1.5 Message-ID: <200508122252.j7CMqWIn017643@cvs-int.fedora.redhat.com> Author: nkinder Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17627 Modified Files: ldbm_delete.c Log Message: 165862 - Needed to set BE_INDEX_EQUALITY flag when doing a delete of an entry. Index: ldbm_delete.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_delete.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ldbm_delete.c 19 Apr 2005 22:07:38 -0000 1.4 +++ ldbm_delete.c 12 Aug 2005 22:52:29 -0000 1.5 @@ -401,7 +401,7 @@ } } /* delete from attribute indexes */ - addordel_flags = BE_INDEX_DEL|BE_INDEX_PRESENCE; + addordel_flags = BE_INDEX_DEL|BE_INDEX_PRESENCE|BE_INDEX_EQUALITY; if (delete_tombstone_entry) { addordel_flags |= BE_INDEX_TOMBSTONE; /* tell index code we are deleting a tombstone */ From fedora-directory-commits at redhat.com Mon Aug 15 20:59:30 2005 From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder)) Date: Mon, 15 Aug 2005 16:59:30 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm index.c, 1.7, 1.8 Message-ID: <200508152059.j7FKxU7A031183@cvs-int.fedora.redhat.com> Author: nkinder Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31167 Modified Files: index.c Log Message: 166012 - Use of incorrect iterator in indexing code was causing illegal access of memory which sometimes resulted in crashing. Index: index.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/index.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- index.c 12 Aug 2005 19:07:37 -0000 1.7 +++ index.c 15 Aug 2005 20:59:27 -0000 1.8 @@ -639,8 +639,12 @@ * removed. */ slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &curr_attr); - if ( valuearray_find(curr_attr, evals, mods_valueArray[i]) == -1 ) { - flags |= BE_INDEX_EQUALITY; + for (j = 0; mods_valueArray[j] != NULL; j++ ) { + if ( valuearray_find(curr_attr, evals, mods_valueArray[j]) == -1 ) { + if (!(flags & BE_INDEX_EQUALITY)) { + flags |= BE_INDEX_EQUALITY; + } + } } rc = index_addordel_values_sv( be, basetype, From fedora-directory-commits at redhat.com Thu Aug 25 00:41:47 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 24 Aug 2005 20:41:47 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/tools dbscan.c, 1.12, 1.13 Message-ID: <200508250041.j7P0flTL006522@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/tools In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6506 Modified Files: dbscan.c Log Message: [Bug 166632] dbscan: not to truncate the entry even if it is larger than BUFSIZ By default, it dumps the entire entry. (it used to be truncated at the BUFSIZ size). In case no need to dump the entire entry, introduced the truncate option "-t". Index: dbscan.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/dbscan.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- dbscan.c 19 Apr 2005 22:07:42 -0000 1.12 +++ dbscan.c 25 Aug 2005 00:41:44 -0000 1.13 @@ -68,25 +68,25 @@ #define CHANGELOGTYPE 0x8 /* display mode */ -#define RAWDATA 0x1 -#define SHOWCOUNT 0x2 -#define SHOWDATA 0x4 +#define RAWDATA 0x1 +#define SHOWCOUNT 0x2 +#define SHOWDATA 0x4 #define SHOWSUMMARY 0x8 /* stolen from slapi-plugin.h */ -#define SLAPI_OPERATION_BIND 0x00000001UL -#define SLAPI_OPERATION_UNBIND 0x00000002UL -#define SLAPI_OPERATION_SEARCH 0x00000004UL -#define SLAPI_OPERATION_MODIFY 0x00000008UL -#define SLAPI_OPERATION_ADD 0x00000010UL -#define SLAPI_OPERATION_DELETE 0x00000020UL -#define SLAPI_OPERATION_MODDN 0x00000040UL -#define SLAPI_OPERATION_MODRDN SLAPI_OPERATION_MODDN -#define SLAPI_OPERATION_COMPARE 0x00000080UL -#define SLAPI_OPERATION_ABANDON 0x00000100UL -#define SLAPI_OPERATION_EXTENDED 0x00000200UL -#define SLAPI_OPERATION_ANY 0xFFFFFFFFUL -#define SLAPI_OPERATION_NONE 0x00000000UL +#define SLAPI_OPERATION_BIND 0x00000001UL +#define SLAPI_OPERATION_UNBIND 0x00000002UL +#define SLAPI_OPERATION_SEARCH 0x00000004UL +#define SLAPI_OPERATION_MODIFY 0x00000008UL +#define SLAPI_OPERATION_ADD 0x00000010UL +#define SLAPI_OPERATION_DELETE 0x00000020UL +#define SLAPI_OPERATION_MODDN 0x00000040UL +#define SLAPI_OPERATION_MODRDN SLAPI_OPERATION_MODDN +#define SLAPI_OPERATION_COMPARE 0x00000080UL +#define SLAPI_OPERATION_ABANDON 0x00000100UL +#define SLAPI_OPERATION_EXTENDED 0x00000200UL +#define SLAPI_OPERATION_ANY 0xFFFFFFFFUL +#define SLAPI_OPERATION_NONE 0x00000000UL #define ONEMEG (1024*1024) @@ -94,7 +94,7 @@ #include #endif -typedef u_int32_t ID; +typedef u_int32_t ID; typedef unsigned int uint32; @@ -104,29 +104,41 @@ uint32 id[1]; } IDL; +uint32 file_type = 0; +uint32 min_display = 0; +uint32 display_mode = 0; +int truncatesiz = 0; +long pres_cnt = 0; +long eq_cnt = 0; +long app_cnt = 0; +long sub_cnt = 0; +long match_cnt = 0; +long ind_cnt = 0; +long allids_cnt = 0; +long other_cnt = 0; + /** db_printf - functioning same as printf but a place for manipluating output. */ void db_printf(char *fmt, ...) { - va_list ap; + va_list ap; - va_start(ap, fmt); - vfprintf(stdout, fmt, ap); + va_start(ap, fmt); + vfprintf(stdout, fmt, ap); } void db_printfln(char *fmt, ...) { - va_list ap; + va_list ap; - va_start(ap, fmt); - vfprintf(stdout, fmt, ap); - vfprintf(stdout, "\n", NULL); + va_start(ap, fmt); + vfprintf(stdout, fmt, ap); + vfprintf(stdout, "\n", NULL); } int MAX_BUFFER = 4096; int MIN_BUFFER = 20; - static IDL *idl_make(DBT *data) { IDL *idl = NULL, *xidl; @@ -174,14 +186,17 @@ /* format a string for easy printing */ #define FMT_LF_OK 1 #define FMT_SP_OK 2 -static char *format_raw(unsigned char *s, int len, int flags) +static char *format_raw(unsigned char *s, int len, int flags, + unsigned char *buf, int buflen) { - static unsigned char buf[BUFSIZ]; /* not intended to be threadsafe */ static char hex[] = "0123456789ABCDEF"; - unsigned char *p, *o; + unsigned char *p, *o, *bufend = buf + buflen - 1; int i; - for (p = s, o = buf, i = 0; i < len; p++, i++) { + if (NULL == buf || buflen <= 0) + return NULL; + + for (p = s, o = buf, i = 0; i < len && o < bufend; p++, i++) { if ((*p == '%') || (*p <= ' ') || (*p >= 126)) { /* index keys are stored with their trailing NUL */ if ((*p == 0) && (i == len-1)) @@ -199,24 +214,26 @@ } else { *o++ = *p; } - if (o-buf > BUFSIZ-5) { - /* out of space */ + if (truncatesiz > 0 && o > bufend - 5) { + /* truncate it */ strcpy(o, " ..."); i = len; + o += 4; } } *o = 0; return (char *)buf; } -static char *format(unsigned char *s, int len) +static char *format(unsigned char *s, int len, unsigned char *buf, int buflen) { - return format_raw(s, len, 0); + return format_raw(s, len, 0, buf, buflen); } -static char *format_entry(unsigned char *s, int len) +static char *format_entry(unsigned char *s, int len, + unsigned char *buf, int buflen) { - return format_raw(s, len, FMT_LF_OK | FMT_SP_OK); + return format_raw(s, len, FMT_LF_OK | FMT_SP_OK, buf, buflen); } static char *idl_format(IDL *idl, int isfirsttime, int *done) @@ -251,46 +268,46 @@ /*** Copied from cl5_api.c: _cl5ReadString ***/ void _cl5ReadString (char **str, char **buff) { - if (str) - { - int len = strlen (*buff); - - if (len) - { - *str = strdup(*buff); - (*buff) += len + 1; - } - else /* just null char - skip it */ - { - *str = NULL; - (*buff) ++; - } - } - else /* just skip this string */ - { - (*buff) += strlen (*buff) + 1; - } + if (str) + { + int len = strlen (*buff); + + if (len) + { + *str = strdup(*buff); + (*buff) += len + 1; + } + else /* just null char - skip it */ + { + *str = NULL; + (*buff) ++; + } + } + else /* just skip this string */ + { + (*buff) += strlen (*buff) + 1; + } } /** print_attr - print attribute name followed by one value. - assume the value stored as null terminated string. + assume the value stored as null terminated string. */ void print_attr(char *attrname, char **buff) { - char *val = NULL; + char *val = NULL; + + _cl5ReadString(&val, buff); + if(attrname != NULL || val != NULL) { + db_printf("\t"); + } - _cl5ReadString(&val, buff); - if(attrname != NULL || val != NULL) { - db_printf("\t"); - } - - if(attrname) { - db_printf("%s: ", attrname); - } - if(val != NULL) { - db_printf("%s\n", val); - free(val); - } + if(attrname) { + db_printf("%s: ", attrname); + } + if(val != NULL) { + db_printf("%s\n", val); + free(val); + } } /*** Copied from cl5_api.c: _cl5ReadMods ***/ @@ -302,34 +319,34 @@ ----------- <1 byte modop><4 byte count> {<4 byte size><4 byte size>... || - ...} + ...} */ void _cl5ReadMod(char **buff); void _cl5ReadMods(char **buff) { - char *pos = *buff; - uint32 i; - uint32 mod_count; - - /* need to copy first, to skirt around alignment problems on certain - architectures */ - memcpy((char *)&mod_count, *buff, sizeof(mod_count)); - mod_count = ntohl(mod_count); - pos += sizeof (mod_count); - - - for (i = 0; i < mod_count; i++) - { - _cl5ReadMod (&pos); - } + char *pos = *buff; + uint32 i; + uint32 mod_count; + + /* need to copy first, to skirt around alignment problems on certain + architectures */ + memcpy((char *)&mod_count, *buff, sizeof(mod_count)); + mod_count = ntohl(mod_count); + pos += sizeof (mod_count); + + + for (i = 0; i < mod_count; i++) + { + _cl5ReadMod (&pos); + } - *buff = pos; + *buff = pos; } /** print_ber_attr - print one line of attribute, the value was stored - in ber format, length followed by string. + in ber format, length followed by string. */ void print_ber_attr(char* attrname, char** buff) { @@ -341,18 +358,18 @@ *buff += sizeof (uint32); if (bv_len > 0) { - db_printf("\t\t"); + db_printf("\t\t"); + + if(attrname != NULL) { + db_printf("%s: ", attrname); + } - if(attrname != NULL) { - db_printf("%s: ", attrname); - } - - val = malloc(bv_len + 1); - memcpy (val, *buff, bv_len); - val[bv_len] = 0; - *buff += bv_len; - db_printf("%s\n", val); - free(val); + val = malloc(bv_len + 1); + memcpy (val, *buff, bv_len); + val[bv_len] = 0; + *buff += bv_len; + db_printf("%s\n", val); + free(val); } } @@ -362,51 +379,51 @@ */ static ID id_stored_to_internal(char* b) { - ID i; - i = (ID)b[3] & 0x000000ff; - i |= (((ID)b[2]) << 8) & 0x0000ff00; - i |= (((ID)b[1]) << 16) & 0x00ff0000; - i |= ((ID)b[0]) << 24; - return i; + ID i; + i = (ID)b[3] & 0x000000ff; + i |= (((ID)b[2]) << 8) & 0x0000ff00; + i |= (((ID)b[1]) << 16) & 0x00ff0000; + i |= ((ID)b[0]) << 24; + return i; } static void id_internal_to_stored(ID i,char *b) { - if ( sizeof(ID) > 4 ) { - memset (b+4, 0, sizeof(ID)-4); - } + if ( sizeof(ID) > 4 ) { + memset (b+4, 0, sizeof(ID)-4); + } - b[0] = (char)(i >> 24); - b[1] = (char)(i >> 16); - b[2] = (char)(i >> 8); - b[3] = (char)i; + b[0] = (char)(i >> 24); + b[1] = (char)(i >> 16); + b[2] = (char)(i >> 8); + b[3] = (char)i; } void _cl5ReadMod(char **buff) { - char *pos = *buff; - uint32 i; - uint32 val_count; - char *type = NULL; - int op; - - op = (*pos) & 0x000000FF; - pos ++; - _cl5ReadString (&type, &pos); - - /* need to do the copy first, to skirt around alignment problems on - certain architectures */ - memcpy((char *)&val_count, pos, sizeof(val_count)); - val_count = ntohl(val_count); - pos += sizeof (uint32); - - for (i = 0; i < val_count; i++) - { - print_ber_attr(type, &pos); - } + char *pos = *buff; + uint32 i; + uint32 val_count; + char *type = NULL; + int op; + + op = (*pos) & 0x000000FF; + pos ++; + _cl5ReadString (&type, &pos); + + /* need to do the copy first, to skirt around alignment problems on + certain architectures */ + memcpy((char *)&val_count, pos, sizeof(val_count)); + val_count = ntohl(val_count); + pos += sizeof (uint32); + + for (i = 0; i < val_count; i++) + { + print_ber_attr(type, &pos); + } - (*buff) = pos; - free(type); + (*buff) = pos; + free(type); } /* @@ -427,93 +444,80 @@ */ void print_changelog(unsigned char *data, int len) { - uint8_t version; - unsigned long operation_type; - char *pos = (char *)data; - uint32 thetime32; - time_t thetime; - uint32 replgen; - - /* read byte of version */ - version = *((uint8_t *)pos); - if (version != 5) - { - db_printf("Invalid changelog db version %i\nWorks for version 5 only.\n", version); - exit(1); - } - pos += sizeof(version); - - /* read change type */ - operation_type = (unsigned long)(*(uint8_t *)pos); - pos ++; - - /* need to do the copy first, to skirt around alignment problems on - certain architectures */ - memcpy((char *)&thetime32, pos, sizeof(thetime32)); - - replgen = ntohl(thetime32); - pos += sizeof(uint32); - thetime = (time_t)replgen; - db_printf("\treplgen: %ld %s", replgen, ctime((time_t *)&thetime)); - - /* read csn */ - print_attr("csn", &pos); - /* read UniqueID */ - print_attr("uniqueid", &pos); - - /* figure out what else we need to read depending on the operation type */ - switch (operation_type) - { - case SLAPI_OPERATION_ADD: - print_attr("parentuniqueid", &pos); - print_attr("dn", &pos); - /* convert mods to entry */ - db_printf("\toperation: add\n"); - _cl5ReadMods(&pos); - break; - - case SLAPI_OPERATION_MODIFY: - print_attr("dn", &pos); - db_printf("\toperation: modify\n"); - _cl5ReadMods(&pos); - break; - - case SLAPI_OPERATION_MODRDN: - print_attr("dn", &pos); - print_attr("newrdn", &pos); - pos ++; - print_attr("dn", &pos); - print_attr("uniqueid", &pos); - db_printf("\toperation: modrdn\n"); - _cl5ReadMods(&pos); - break; - - case SLAPI_OPERATION_DELETE: - print_attr("dn", &pos); - db_printf("\toperation: delete\n"); - break; - - default: - db_printf("Failed to format entry\n"); - break; - } -} + uint8_t version; + unsigned long operation_type; + char *pos = (char *)data; + uint32 thetime32; + time_t thetime; + uint32 replgen; + + /* read byte of version */ + version = *((uint8_t *)pos); + if (version != 5) + { + db_printf("Invalid changelog db version %i\nWorks for version 5 only.\n", version); + exit(1); + } + pos += sizeof(version); -uint32 file_type = 0; -uint32 min_display = 0; -uint32 display_mode = 0; -int verbose = 0; -long pres_cnt = 0; -long eq_cnt = 0; -long app_cnt = 0; -long sub_cnt = 0; -long match_cnt = 0; -long ind_cnt = 0; -long allids_cnt = 0; -long other_cnt = 0; + /* read change type */ + operation_type = (unsigned long)(*(uint8_t *)pos); + pos ++; + + /* need to do the copy first, to skirt around alignment problems on + certain architectures */ + memcpy((char *)&thetime32, pos, sizeof(thetime32)); + + replgen = ntohl(thetime32); + pos += sizeof(uint32); + thetime = (time_t)replgen; + db_printf("\treplgen: %ld %s", replgen, ctime((time_t *)&thetime)); + + /* read csn */ + print_attr("csn", &pos); + /* read UniqueID */ + print_attr("uniqueid", &pos); + + /* figure out what else we need to read depending on the operation type */ + switch (operation_type) + { + case SLAPI_OPERATION_ADD: + print_attr("parentuniqueid", &pos); + print_attr("dn", &pos); + /* convert mods to entry */ + db_printf("\toperation: add\n"); + _cl5ReadMods(&pos); + break; + case SLAPI_OPERATION_MODIFY: + print_attr("dn", &pos); + db_printf("\toperation: modify\n"); + _cl5ReadMods(&pos); + break; -static void display_index_item(DBC *cursor, DBT *key, DBT *data) + case SLAPI_OPERATION_MODRDN: + print_attr("dn", &pos); + print_attr("newrdn", &pos); + pos ++; + print_attr("dn", &pos); + print_attr("uniqueid", &pos); + db_printf("\toperation: modrdn\n"); + _cl5ReadMods(&pos); + break; + + case SLAPI_OPERATION_DELETE: + print_attr("dn", &pos); + db_printf("\toperation: delete\n"); + break; + + default: + db_printf("Failed to format entry\n"); + break; + } +} + +static void display_index_item(DBC *cursor, DBT *key, DBT *data, + unsigned char *buf, int buflen) { IDL *idl = NULL; int ret = 0; @@ -527,9 +531,10 @@ if (file_type & VLVINDEXTYPE) { /* vlv index file */ if (1 > min_display) { /* recno is always 1 */ if (display_mode & SHOWCOUNT) { /* key size=1 */ - printf("%-40s 1\n", format(key->data, key->size)); + printf("%-40s 1\n", + format(key->data, key->size, buf, buflen)); } else { - printf("%-40s\n", format(key->data, key->size)); + printf("%-40s\n", format(key->data, key->size, buf, buflen)); } if (display_mode & SHOWDATA) { cursor->c_get(cursor, key, data, DB_GET_RECNO); @@ -558,17 +563,18 @@ if ( allids_cnt == 0 && (display_mode & SHOWSUMMARY)) { printf("The following index keys reached allids:\n"); } - printf("%-40s(allids)\n", format(key->data, key->size)); + printf("%-40s(allids)\n", format(key->data, key->size, buf, buflen)); allids_cnt++; } else { if (idl->used < min_display) { goto index_done; /* less than minimum display count */ } else if (display_mode & SHOWCOUNT) { /* key size */ - printf("%-40s%d\n", format(key->data, key->size), idl->used); + printf("%-40s%d\n", + format(key->data, key->size, buf, buflen), idl->used); } else if (!(display_mode & SHOWSUMMARY) || (display_mode & SHOWDATA)) { /* show keys only if show summary is not set or - * even if it's set, but with show data */ - printf("%-40s\n", format(key->data, key->size)); + * even if it's set, but with show data */ + printf("%-40s\n", format(key->data, key->size, buf, buflen)); } if (display_mode & SHOWDATA) { char *formatted_idl = NULL; @@ -632,26 +638,48 @@ static void display_item(DBC *cursor, DBT *key, DBT *data) { + static unsigned char *buf = NULL; + static int buflen = 0; + int tmpbuflen; + + if (truncatesiz > 0) { + tmpbuflen = truncatesiz; + } else if (file_type & INDEXTYPE) { + /* +256: extra buffer for '\t' and '%##' */ + tmpbuflen = key->size + 256; + } else { + /* +1024: extra buffer for '\t' and '%##' */ + tmpbuflen = (key->size > data->size ? key->size : data->size) + 1024; + } + if (buflen < tmpbuflen) { + buflen = tmpbuflen; + buf = (unsigned char *)realloc(buf, buflen); + if (NULL == buf) { + printf("\t(malloc failed -- %d bytes)\n", buflen); + return; + } + } + if (display_mode & RAWDATA) { - printf("%s\n", format(key->data, key->size)); - printf("\t%s\n", format(data->data, data->size)); + printf("%s\n", format(key->data, key->size, buf, buflen)); + printf("\t%s\n", format(data->data, data->size, buf, buflen)); } else { if (file_type & INDEXTYPE) { - display_index_item(cursor, key, data); + display_index_item(cursor, key, data, buf, buflen); } else if (file_type & CHANGELOGTYPE) { - /* changelog db file */ - printf("\ndbid: %s\n", format(key->data, key->size)); + /* changelog db file */ + printf("\ndbid: %s\n", format(key->data, key->size, buf, buflen)); print_changelog(data->data, data->size); return; } else if (file_type & ENTRYTYPE) { /* id2entry file */ ID entry_id = id_stored_to_internal(key->data); printf("id %d\n", entry_id); - printf("\t%s\n", format_entry(data->data, data->size)); + printf("\t%s\n", format_entry(data->data, data->size, buf, buflen)); } else { /* user didn't tell us what kind of file, dump it raw */ - printf("%s\n", format(key->data, key->size)); - printf("\t%s\n", format(data->data, data->size)); + printf("%s\n", format(key->data, key->size, buf, buflen)); + printf("\t%s\n", format(data->data, data->size, buf, buflen)); } } return; @@ -704,6 +732,7 @@ printf(" common options:\n"); printf(" -f specify db file\n"); printf(" -R dump as raw data\n"); + printf(" -t entry truncate size (bytes)\n"); printf(" entry file options:\n"); printf(" -K lookup only a specific entry id\n"); printf(" index file options:\n"); @@ -743,7 +772,9 @@ uint32 entry_id = 0xffffffff; int c; - while ((c = getopt(argc, argv, "f:Rl:nG:srk:K:hv")) != EOF) { + key.flags = DB_DBT_REALLOC; + data.flags = DB_DBT_REALLOC; + while ((c = getopt(argc, argv, "f:Rl:nG:srk:K:hvt:")) != EOF) { switch (c) { case 'f': filename = optarg; @@ -782,7 +813,10 @@ find_key = optarg; break; case 'K': - id_internal_to_stored((ID)atoi(optarg), (char *)&entry_id); + id_internal_to_stored((ID)atoi(optarg), (char *)&entry_id); + break; + case 't': + truncatesiz = atoi(optarg); break; case 'h': default: @@ -801,7 +835,7 @@ file_type |= INDEXTYPE; if (0 == strncmp(filename, "vlv#", 4)) { file_type |= VLVINDEXTYPE; - } + } } ret = db_env_create(&env, 0); @@ -907,37 +941,37 @@ if ( display_mode & SHOWSUMMARY) { - if ( allids_cnt > 0 ) { - printf("Index keys that reached ALLIDs threshold: %ld\n", allids_cnt); - } - - if ( pres_cnt > 0 ) { - printf("Presence index keys: %ld\n", pres_cnt); - } - - if ( eq_cnt > 0 ) { - printf("Equality index keys: %ld\n", eq_cnt); - } - - if ( app_cnt > 0 ) { - printf("Approximate index keys: %ld\n", app_cnt); - } - - if ( sub_cnt > 0 ) { - printf("Substring index keys: %ld\n", sub_cnt); - } - - if ( match_cnt > 0 ) { - printf("Match index keys: %ld\n", match_cnt); - } - - if ( ind_cnt > 0 ) { - printf("Indirect index keys: %ld\n", ind_cnt); - } - - if ( other_cnt > 0 ) { - printf("This file contains %ld number of unknown type ( possible corruption)\n",other_cnt); - } + if ( allids_cnt > 0 ) { + printf("Index keys that reached ALLIDs threshold: %ld\n", allids_cnt); + } + + if ( pres_cnt > 0 ) { + printf("Presence index keys: %ld\n", pres_cnt); + } + + if ( eq_cnt > 0 ) { + printf("Equality index keys: %ld\n", eq_cnt); + } + + if ( app_cnt > 0 ) { + printf("Approximate index keys: %ld\n", app_cnt); + } + + if ( sub_cnt > 0 ) { + printf("Substring index keys: %ld\n", sub_cnt); + } + + if ( match_cnt > 0 ) { + printf("Match index keys: %ld\n", match_cnt); + } + + if ( ind_cnt > 0 ) { + printf("Indirect index keys: %ld\n", ind_cnt); + } + + if ( other_cnt > 0 ) { + printf("This file contains %ld number of unknown type ( possible corruption)\n",other_cnt); + } } From fedora-directory-commits at redhat.com Thu Aug 25 00:58:30 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 24 Aug 2005 20:58:30 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd attr.c, 1.5, 1.6 attrlist.c, 1.4, 1.5 entry.c, 1.9, 1.10 proto-slap.h, 1.10, 1.11 valueset.c, 1.4, 1.5 Message-ID: <200508250058.j7P0wUKA006573@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/slapd In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6551 Modified Files: attr.c attrlist.c entry.c proto-slap.h valueset.c Log Message: [Bug 164834] modify/replace allows multiple same valued attributes in an entry 1) Eliminated SLAPD_MODUTIL_TREE_THREASHHOLD from attr.c as well as valueset.c. With this change, if an attribute has more than 1 value to add/replace/delete, it creates an AVL tree to check the duplicates. 2) Replace was not checking the duplicated value at all. Added a code to put the attribute values into the AVL tree as being done for add and delete. Index: attr.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/attr.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- attr.c 19 Apr 2005 22:07:36 -0000 1.5 +++ attr.c 25 Aug 2005 00:58:27 -0000 1.6 @@ -710,19 +710,12 @@ } /* - * If we are adding or deleting SLAPD_MODUTIL_TREE_THRESHHOLD or more - * entries, we use an AVL tree to speed up searching for duplicates or - * values we are trying to delete. This threshhold is somewhat arbitrary; - * we should really take some measurements to determine an optimal number. - */ -#define SLAPD_MODUTIL_TREE_THRESHHOLD 5 - -/* - * Add a value array to an attribute. If SLAPD_MODUTIL_TREE_THRESHHOLD or - * more values are being added, we build an AVL tree of any existing + * Add a value array to an attribute. + * If more than one values are being added, we build an AVL tree of any existing * values and then update that in parallel with the existing values. This - * is done so that we do not waste a lot of CPU time searching for duplicate - * values. The AVL tree is created and destroyed all within this function. + * AVL tree is used to detect the duplicates not only between the existing + * values and to-be-added values but also among the to-be-added values. + * The AVL tree is created and destroyed all within this function. * * Returns * LDAP_SUCCESS - OK @@ -733,28 +726,28 @@ attr_add_valuearray(Slapi_Attr *a, Slapi_Value **vals, const char *dn) { int i = 0; - int duplicate_index = -1; - int was_present_null = 0; - int rc = LDAP_SUCCESS; + int numofvals = 0; + int duplicate_index = -1; + int was_present_null = 0; + int rc = LDAP_SUCCESS; if (valuearray_isempty(vals)) { /* * No values to add (unexpected but acceptable). */ return rc; - } + } /* * determine whether we should use an AVL tree of values or not */ - while ( i < SLAPD_MODUTIL_TREE_THRESHHOLD - 1 && vals[i] != NULL ) { - i++; - } + for ( i = 0; vals[i] != NULL; i++ ) ; + numofvals = i; /* * detect duplicate values */ - if ( i >= SLAPD_MODUTIL_TREE_THRESHHOLD - 1 ) { + if ( numofvals > 1 ) { /* * Several values to add: use an AVL tree to detect duplicates. */ @@ -763,82 +756,85 @@ "detect duplicate values\n", 0, 0, 0 ); if (valueset_isempty(&a->a_present_values)) { - /* if the attribute contains no values yet, just check the - * input vals array for duplicates - */ + /* if the attribute contains no values yet, just check the + * input vals array for duplicates + */ Avlnode *vtree = NULL; rc= valuetree_add_valuearray(a->a_type, a->a_plugin, vals, &vtree, &duplicate_index); valuetree_free(&vtree); - was_present_null = 1; + was_present_null = 1; } else { - /* the attr and vals both contain values, check intersection */ + /* the attr and vals both contain values, check intersection */ rc= valueset_intersectswith_valuearray(&a->a_present_values, a, vals, &duplicate_index); } } else if ( !valueset_isempty(&a->a_present_values) ) { /* - * Small number of values to add: don't bother constructing + * One or no value to add: don't bother constructing * an AVL tree, etc. since it probably isn't worth the time. */ for ( i = 0; vals[i] != NULL; ++i ) { if ( slapi_attr_value_find( a, slapi_value_get_berval(vals[i]) ) == 0 ) { - duplicate_index = i; - rc = LDAP_TYPE_OR_VALUE_EXISTS; - break; + duplicate_index = i; + rc = LDAP_TYPE_OR_VALUE_EXISTS; + break; } - } + } } - /* - * add values if no duplicates detected - */ + /* + * add values if no duplicates detected + */ if(rc==LDAP_SUCCESS) { - valueset_add_valuearray( &a->a_present_values, vals ); - } + valueset_add_valuearray( &a->a_present_values, vals ); + } - /* In the case of duplicate value, rc == LDAP_TYPE_OR_VALUE_EXISTS or - * LDAP_OPERATIONS_ERROR - */ - else if ( duplicate_index >= 0 ) { - char avdbuf[BUFSIZ]; - char bvvalcopy[BUFSIZ]; - char *duplicate_string = "null or non-ASCII"; - - i = 0; - while ( (unsigned int)i < vals[duplicate_index]->bv.bv_len && - i < BUFSIZ - 1 && - vals[duplicate_index]->bv.bv_val[i] && - isascii ( vals[duplicate_index]->bv.bv_val[i] )) { - i++; - } - - if ( i ) { - if ( vals[duplicate_index]->bv.bv_val[i] == 0 ) { - duplicate_string = vals[duplicate_index]->bv.bv_val; - } - else { - strncpy ( &bvvalcopy[0], vals[duplicate_index]->bv.bv_val, i ); - bvvalcopy[i] = '\0'; - duplicate_string = bvvalcopy; - } - } - - slapi_log_error( SLAPI_LOG_FATAL, NULL, "add value \"%s\" to " - "attribute type \"%s\" in entry \"%s\" failed: %s\n", - duplicate_string, - a->a_type, - dn ? escape_string(dn,avdbuf) : "", - (was_present_null ? "duplicate new value" : "value exists")); - } + /* In the case of duplicate value, rc == LDAP_TYPE_OR_VALUE_EXISTS or + * LDAP_OPERATIONS_ERROR + */ + else if ( duplicate_index >= 0 ) { + char avdbuf[BUFSIZ]; + char bvvalcopy[BUFSIZ]; + char *duplicate_string = "null or non-ASCII"; + + i = 0; + while ( (unsigned int)i < vals[duplicate_index]->bv.bv_len && + i < BUFSIZ - 1 && + vals[duplicate_index]->bv.bv_val[i] && + isascii ( vals[duplicate_index]->bv.bv_val[i] )) { + i++; + } + + if ( i ) { + if ( vals[duplicate_index]->bv.bv_val[i] == 0 ) { + duplicate_string = vals[duplicate_index]->bv.bv_val; + } + else { + strncpy ( &bvvalcopy[0], vals[duplicate_index]->bv.bv_val, i ); + bvvalcopy[i] = '\0'; + duplicate_string = bvvalcopy; + } + } + + slapi_log_error( SLAPI_LOG_FATAL, NULL, "add value \"%s\" to " + "attribute type \"%s\" in entry \"%s\" failed: %s\n", + duplicate_string, + a->a_type, + dn ? escape_string(dn,avdbuf) : "", + (was_present_null ? "duplicate new value" : "value exists")); + } return( rc ); } /* quickly toss an attribute's values and replace them with new ones * (used by attrlist_replace_fast) + * Returns + * LDAP_SUCCESS - OK + * LDAP_OPERATIONS_ERROR - Existing duplicates in attribute. */ -void attr_replace(Slapi_Attr *a, Slapi_Value **vals) +int attr_replace(Slapi_Attr *a, Slapi_Value **vals) { - valueset_replace(&a->a_present_values, vals); + return valueset_replace(a, &a->a_present_values, vals); } int Index: attrlist.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/attrlist.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- attrlist.c 19 Apr 2005 22:07:36 -0000 1.4 +++ attrlist.c 25 Aug 2005 00:58:27 -0000 1.5 @@ -268,18 +268,24 @@ /* * attrlist_replace - replace the attribute value(s) with this value(s) + * + * Returns + * LDAP_SUCCESS - OK (including the attr not found) + * LDAP_OPERATIONS_ERROR - Existing duplicates in attribute. */ -void attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals) +int attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals) { Slapi_Attr **a = NULL; Slapi_Value **values = NULL; + int rc = LDAP_SUCCESS; if (vals == NULL || vals[0] == NULL) { (void)attrlist_delete(alist, type); } else { attrlist_find_or_create(alist, type, &a); valuearray_init_bervalarray(vals, &values); - attr_replace(*a, values); + rc = attr_replace(*a, values); } + return rc; } Index: entry.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/entry.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- entry.c 24 May 2005 16:11:19 -0000 1.9 +++ entry.c 25 Aug 2005 00:58:27 -0000 1.10 @@ -2792,8 +2792,7 @@ struct berval **vals ) { - attrlist_replace( &e->e_attrs, type, vals ); - return 0; + return attrlist_replace( &e->e_attrs, type, vals ); } int Index: proto-slap.h =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/proto-slap.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- proto-slap.h 19 Apr 2005 22:07:36 -0000 1.10 +++ proto-slap.h 25 Aug 2005 00:58:27 -0000 1.11 @@ -61,7 +61,7 @@ */ void attr_done(Slapi_Attr *a); int attr_add_valuearray(Slapi_Attr *a, Slapi_Value **vals, const char *dn); -void attr_replace(Slapi_Attr *a, Slapi_Value **vals); +int attr_replace(Slapi_Attr *a, Slapi_Value **vals); int attr_check_onoff ( const char *attr_name, char *value, long minval, long maxval, char *errorbuf ); int attr_check_minmax ( const char *attr_name, char *value, long minval, long maxval, char *errorbuf ); @@ -80,7 +80,7 @@ void attrlist_add(Slapi_Attr **attrs, Slapi_Attr *a); int attrlist_count_subtypes(Slapi_Attr *a, const char *type); Slapi_Attr *attrlist_find_ex( Slapi_Attr *a, const char *type, int *type_name_disposition, char** actual_type_name, void **hint ); -void attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals); +int attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals); /* * attrsyntax.c @@ -158,7 +158,7 @@ int valueset_intersectswith_valuearray(Slapi_ValueSet *vs, const Slapi_Attr *a, Slapi_Value **values, int *duplicate_index); Slapi_ValueSet *valueset_dup(const Slapi_ValueSet *dupee); void valueset_remove_string(const Slapi_Attr *a, Slapi_ValueSet *vs, const char *s); -void valueset_replace(Slapi_ValueSet *vs, Slapi_Value **vals); +int valueset_replace(Slapi_Attr *a, Slapi_ValueSet *vs, Slapi_Value **vals); void valueset_update_csn_for_valuearray(Slapi_ValueSet *vs, const Slapi_Attr *a, Slapi_Value **valuestoupdate, CSNType t, const CSN *csn, Slapi_Value ***valuesupdated); void valueset_set_valuearray_byval(Slapi_ValueSet *vs, Slapi_Value **addvals); void valueset_set_valuearray_passin(Slapi_ValueSet *vs, Slapi_Value **addvals); Index: valueset.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/valueset.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- valueset.c 19 Apr 2005 22:07:37 -0000 1.4 +++ valueset.c 25 Aug 2005 00:58:27 -0000 1.5 @@ -1015,13 +1015,6 @@ } /* - * If we are adding or deleting SLAPD_MODUTIL_TREE_THRESHHOLD or more - * entries, we use an AVL tree to speed up searching for duplicates or - * values we are trying to delete. This threshhold is somewhat arbitrary; - * we should really take some measurements to determine an optimal number. - */ -#define SLAPD_MODUTIL_TREE_THRESHHOLD 5 -/* * Remove an array of values from a value set. * The removed values are passed back in an array. * @@ -1044,9 +1037,10 @@ } /* - * determine whether we should use an AVL tree of values or not + * If there are more then one values, build an AVL tree to check + * the duplicated values. */ - if ( numberofvaluestodelete >= SLAPD_MODUTIL_TREE_THRESHHOLD) + if ( numberofvaluestodelete > 1 ) { /* * Several values to delete: first build an AVL tree that @@ -1132,7 +1126,7 @@ } else { - /* We don't have to delete very many values, so we use brute force. */ + /* We delete one or no value, so we use brute force. */ int i; for ( i = 0; rc==LDAP_SUCCESS && valuestodelete[i] != NULL; ++i ) { @@ -1210,7 +1204,7 @@ { /* No intersection */ } - else if ( numberofvalues >= SLAPD_MODUTIL_TREE_THRESHHOLD) + else if ( numberofvalues > 1 ) { /* * Several values to add: use an AVL tree to detect duplicates. @@ -1234,7 +1228,7 @@ else { /* - * Small number of values to add: don't bother constructing + * One value to add: don't bother constructing * an AVL tree, etc. since it probably isn't worth the time. * * JCM - This is actually quite slow because the comparison function is looked up many times. @@ -1267,15 +1261,39 @@ /* quickly throw away any old contents of this valueset, and stick in the * new ones. + * + * return value: LDAP_SUCCESS - OK + * : LDAP_OPERATIONS_ERROR - duplicated values given */ -void -valueset_replace(Slapi_ValueSet *vs, Slapi_Value **vals) +int +valueset_replace(Slapi_Attr *a, Slapi_ValueSet *vs, Slapi_Value **valstoreplace) { + int rc = LDAP_SUCCESS; + int numberofvalstoreplace= valuearray_count(valstoreplace); if(!valuearray_isempty(vs->va)) - { + { slapi_valueset_done(vs); - } - vs->va = vals; + } + /* verify the given values are not duplicated. + if replacing with one value, no need to check. just replace it. + */ + if (numberofvalstoreplace > 1) + { + Avlnode *vtree = NULL; + rc = valuetree_add_valuearray( a->a_type, a->a_plugin, valstoreplace, &vtree, NULL ); + valuetree_free(&vtree); + if ( LDAP_SUCCESS != rc ) + { + /* There were already duplicate values in the value set */ + rc = LDAP_OPERATIONS_ERROR; + } + } + + if ( rc == LDAP_SUCCESS ) + { + vs->va = valstoreplace; + } + return rc; } /* @@ -1296,7 +1314,7 @@ struct valuearrayfast vaf_valuesupdated; int numberofvaluestoupdate= valuearray_count(valuestoupdate); valuearrayfast_init(&vaf_valuesupdated,*valuesupdated); - if (numberofvaluestoupdate>=SLAPD_MODUTIL_TREE_THRESHHOLD) + if (numberofvaluestoupdate > 1) /* multiple values to update */ { int i; Avlnode *vtree = NULL; From fedora-directory-commits at redhat.com Thu Aug 25 18:25:11 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Thu, 25 Aug 2005 14:25:11 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd attr.c, 1.5, 1.5.2.1 attrlist.c, 1.4, 1.4.2.1 entry.c, 1.8.2.1, 1.8.2.2 proto-slap.h, 1.10, 1.10.2.1 valueset.c, 1.4, 1.4.2.1 Message-ID: <200508251825.j7PIPBc2004150@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/slapd In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4127 Modified Files: Tag: Directory71RtmBranch attr.c attrlist.c entry.c proto-slap.h valueset.c Log Message: [Bug 164834] modify/replace allows multiple same valued attributes in an entry 1) Eliminated SLAPD_MODUTIL_TREE_THREASHHOLD from attr.c as well as valueset.c. With this change, if an attribute has more than 1 value to add/replace/delete, it creates an AVL tree to check the duplicates. 2) Replace was not checking the duplicated value at all. Added a code to put the attribute values into the AVL tree as being done for add and delete. Index: attr.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/attr.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- attr.c 19 Apr 2005 22:07:36 -0000 1.5 +++ attr.c 25 Aug 2005 18:25:08 -0000 1.5.2.1 @@ -710,19 +710,12 @@ } /* - * If we are adding or deleting SLAPD_MODUTIL_TREE_THRESHHOLD or more - * entries, we use an AVL tree to speed up searching for duplicates or - * values we are trying to delete. This threshhold is somewhat arbitrary; - * we should really take some measurements to determine an optimal number. - */ -#define SLAPD_MODUTIL_TREE_THRESHHOLD 5 - -/* - * Add a value array to an attribute. If SLAPD_MODUTIL_TREE_THRESHHOLD or - * more values are being added, we build an AVL tree of any existing + * Add a value array to an attribute. + * If more than one values are being added, we build an AVL tree of any existing * values and then update that in parallel with the existing values. This - * is done so that we do not waste a lot of CPU time searching for duplicate - * values. The AVL tree is created and destroyed all within this function. + * AVL tree is used to detect the duplicates not only between the existing + * values and to-be-added values but also among the to-be-added values. + * The AVL tree is created and destroyed all within this function. * * Returns * LDAP_SUCCESS - OK @@ -733,28 +726,28 @@ attr_add_valuearray(Slapi_Attr *a, Slapi_Value **vals, const char *dn) { int i = 0; - int duplicate_index = -1; - int was_present_null = 0; - int rc = LDAP_SUCCESS; + int numofvals = 0; + int duplicate_index = -1; + int was_present_null = 0; + int rc = LDAP_SUCCESS; if (valuearray_isempty(vals)) { /* * No values to add (unexpected but acceptable). */ return rc; - } + } /* * determine whether we should use an AVL tree of values or not */ - while ( i < SLAPD_MODUTIL_TREE_THRESHHOLD - 1 && vals[i] != NULL ) { - i++; - } + for ( i = 0; vals[i] != NULL; i++ ) ; + numofvals = i; /* * detect duplicate values */ - if ( i >= SLAPD_MODUTIL_TREE_THRESHHOLD - 1 ) { + if ( numofvals > 1 ) { /* * Several values to add: use an AVL tree to detect duplicates. */ @@ -763,82 +756,85 @@ "detect duplicate values\n", 0, 0, 0 ); if (valueset_isempty(&a->a_present_values)) { - /* if the attribute contains no values yet, just check the - * input vals array for duplicates - */ + /* if the attribute contains no values yet, just check the + * input vals array for duplicates + */ Avlnode *vtree = NULL; rc= valuetree_add_valuearray(a->a_type, a->a_plugin, vals, &vtree, &duplicate_index); valuetree_free(&vtree); - was_present_null = 1; + was_present_null = 1; } else { - /* the attr and vals both contain values, check intersection */ + /* the attr and vals both contain values, check intersection */ rc= valueset_intersectswith_valuearray(&a->a_present_values, a, vals, &duplicate_index); } } else if ( !valueset_isempty(&a->a_present_values) ) { /* - * Small number of values to add: don't bother constructing + * One or no value to add: don't bother constructing * an AVL tree, etc. since it probably isn't worth the time. */ for ( i = 0; vals[i] != NULL; ++i ) { if ( slapi_attr_value_find( a, slapi_value_get_berval(vals[i]) ) == 0 ) { - duplicate_index = i; - rc = LDAP_TYPE_OR_VALUE_EXISTS; - break; + duplicate_index = i; + rc = LDAP_TYPE_OR_VALUE_EXISTS; + break; } - } + } } - /* - * add values if no duplicates detected - */ + /* + * add values if no duplicates detected + */ if(rc==LDAP_SUCCESS) { - valueset_add_valuearray( &a->a_present_values, vals ); - } + valueset_add_valuearray( &a->a_present_values, vals ); + } - /* In the case of duplicate value, rc == LDAP_TYPE_OR_VALUE_EXISTS or - * LDAP_OPERATIONS_ERROR - */ - else if ( duplicate_index >= 0 ) { - char avdbuf[BUFSIZ]; - char bvvalcopy[BUFSIZ]; - char *duplicate_string = "null or non-ASCII"; - - i = 0; - while ( (unsigned int)i < vals[duplicate_index]->bv.bv_len && - i < BUFSIZ - 1 && - vals[duplicate_index]->bv.bv_val[i] && - isascii ( vals[duplicate_index]->bv.bv_val[i] )) { - i++; - } - - if ( i ) { - if ( vals[duplicate_index]->bv.bv_val[i] == 0 ) { - duplicate_string = vals[duplicate_index]->bv.bv_val; - } - else { - strncpy ( &bvvalcopy[0], vals[duplicate_index]->bv.bv_val, i ); - bvvalcopy[i] = '\0'; - duplicate_string = bvvalcopy; - } - } - - slapi_log_error( SLAPI_LOG_FATAL, NULL, "add value \"%s\" to " - "attribute type \"%s\" in entry \"%s\" failed: %s\n", - duplicate_string, - a->a_type, - dn ? escape_string(dn,avdbuf) : "", - (was_present_null ? "duplicate new value" : "value exists")); - } + /* In the case of duplicate value, rc == LDAP_TYPE_OR_VALUE_EXISTS or + * LDAP_OPERATIONS_ERROR + */ + else if ( duplicate_index >= 0 ) { + char avdbuf[BUFSIZ]; + char bvvalcopy[BUFSIZ]; + char *duplicate_string = "null or non-ASCII"; + + i = 0; + while ( (unsigned int)i < vals[duplicate_index]->bv.bv_len && + i < BUFSIZ - 1 && + vals[duplicate_index]->bv.bv_val[i] && + isascii ( vals[duplicate_index]->bv.bv_val[i] )) { + i++; + } + + if ( i ) { + if ( vals[duplicate_index]->bv.bv_val[i] == 0 ) { + duplicate_string = vals[duplicate_index]->bv.bv_val; + } + else { + strncpy ( &bvvalcopy[0], vals[duplicate_index]->bv.bv_val, i ); + bvvalcopy[i] = '\0'; + duplicate_string = bvvalcopy; + } + } + + slapi_log_error( SLAPI_LOG_FATAL, NULL, "add value \"%s\" to " + "attribute type \"%s\" in entry \"%s\" failed: %s\n", + duplicate_string, + a->a_type, + dn ? escape_string(dn,avdbuf) : "", + (was_present_null ? "duplicate new value" : "value exists")); + } return( rc ); } /* quickly toss an attribute's values and replace them with new ones * (used by attrlist_replace_fast) + * Returns + * LDAP_SUCCESS - OK + * LDAP_OPERATIONS_ERROR - Existing duplicates in attribute. */ -void attr_replace(Slapi_Attr *a, Slapi_Value **vals) +int attr_replace(Slapi_Attr *a, Slapi_Value **vals) { - valueset_replace(&a->a_present_values, vals); + return valueset_replace(a, &a->a_present_values, vals); } int Index: attrlist.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/attrlist.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- attrlist.c 19 Apr 2005 22:07:36 -0000 1.4 +++ attrlist.c 25 Aug 2005 18:25:08 -0000 1.4.2.1 @@ -268,18 +268,24 @@ /* * attrlist_replace - replace the attribute value(s) with this value(s) + * + * Returns + * LDAP_SUCCESS - OK (including the attr not found) + * LDAP_OPERATIONS_ERROR - Existing duplicates in attribute. */ -void attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals) +int attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals) { Slapi_Attr **a = NULL; Slapi_Value **values = NULL; + int rc = LDAP_SUCCESS; if (vals == NULL || vals[0] == NULL) { (void)attrlist_delete(alist, type); } else { attrlist_find_or_create(alist, type, &a); valuearray_init_bervalarray(vals, &values); - attr_replace(*a, values); + rc = attr_replace(*a, values); } + return rc; } Index: entry.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/entry.c,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -r1.8.2.1 -r1.8.2.2 --- entry.c 1 Jun 2005 17:50:39 -0000 1.8.2.1 +++ entry.c 25 Aug 2005 18:25:08 -0000 1.8.2.2 @@ -2792,8 +2792,7 @@ struct berval **vals ) { - attrlist_replace( &e->e_attrs, type, vals ); - return 0; + return attrlist_replace( &e->e_attrs, type, vals ); } int Index: proto-slap.h =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/proto-slap.h,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -r1.10 -r1.10.2.1 --- proto-slap.h 19 Apr 2005 22:07:36 -0000 1.10 +++ proto-slap.h 25 Aug 2005 18:25:08 -0000 1.10.2.1 @@ -61,7 +61,7 @@ */ void attr_done(Slapi_Attr *a); int attr_add_valuearray(Slapi_Attr *a, Slapi_Value **vals, const char *dn); -void attr_replace(Slapi_Attr *a, Slapi_Value **vals); +int attr_replace(Slapi_Attr *a, Slapi_Value **vals); int attr_check_onoff ( const char *attr_name, char *value, long minval, long maxval, char *errorbuf ); int attr_check_minmax ( const char *attr_name, char *value, long minval, long maxval, char *errorbuf ); @@ -80,7 +80,7 @@ void attrlist_add(Slapi_Attr **attrs, Slapi_Attr *a); int attrlist_count_subtypes(Slapi_Attr *a, const char *type); Slapi_Attr *attrlist_find_ex( Slapi_Attr *a, const char *type, int *type_name_disposition, char** actual_type_name, void **hint ); -void attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals); +int attrlist_replace(Slapi_Attr **alist, const char *type, struct berval **vals); /* * attrsyntax.c @@ -158,7 +158,7 @@ int valueset_intersectswith_valuearray(Slapi_ValueSet *vs, const Slapi_Attr *a, Slapi_Value **values, int *duplicate_index); Slapi_ValueSet *valueset_dup(const Slapi_ValueSet *dupee); void valueset_remove_string(const Slapi_Attr *a, Slapi_ValueSet *vs, const char *s); -void valueset_replace(Slapi_ValueSet *vs, Slapi_Value **vals); +int valueset_replace(Slapi_Attr *a, Slapi_ValueSet *vs, Slapi_Value **vals); void valueset_update_csn_for_valuearray(Slapi_ValueSet *vs, const Slapi_Attr *a, Slapi_Value **valuestoupdate, CSNType t, const CSN *csn, Slapi_Value ***valuesupdated); void valueset_set_valuearray_byval(Slapi_ValueSet *vs, Slapi_Value **addvals); void valueset_set_valuearray_passin(Slapi_ValueSet *vs, Slapi_Value **addvals); Index: valueset.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/valueset.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- valueset.c 19 Apr 2005 22:07:37 -0000 1.4 +++ valueset.c 25 Aug 2005 18:25:08 -0000 1.4.2.1 @@ -1015,13 +1015,6 @@ } /* - * If we are adding or deleting SLAPD_MODUTIL_TREE_THRESHHOLD or more - * entries, we use an AVL tree to speed up searching for duplicates or - * values we are trying to delete. This threshhold is somewhat arbitrary; - * we should really take some measurements to determine an optimal number. - */ -#define SLAPD_MODUTIL_TREE_THRESHHOLD 5 -/* * Remove an array of values from a value set. * The removed values are passed back in an array. * @@ -1044,9 +1037,10 @@ } /* - * determine whether we should use an AVL tree of values or not + * If there are more then one values, build an AVL tree to check + * the duplicated values. */ - if ( numberofvaluestodelete >= SLAPD_MODUTIL_TREE_THRESHHOLD) + if ( numberofvaluestodelete > 1 ) { /* * Several values to delete: first build an AVL tree that @@ -1132,7 +1126,7 @@ } else { - /* We don't have to delete very many values, so we use brute force. */ + /* We delete one or no value, so we use brute force. */ int i; for ( i = 0; rc==LDAP_SUCCESS && valuestodelete[i] != NULL; ++i ) { @@ -1210,7 +1204,7 @@ { /* No intersection */ } - else if ( numberofvalues >= SLAPD_MODUTIL_TREE_THRESHHOLD) + else if ( numberofvalues > 1 ) { /* * Several values to add: use an AVL tree to detect duplicates. @@ -1234,7 +1228,7 @@ else { /* - * Small number of values to add: don't bother constructing + * One value to add: don't bother constructing * an AVL tree, etc. since it probably isn't worth the time. * * JCM - This is actually quite slow because the comparison function is looked up many times. @@ -1267,15 +1261,39 @@ /* quickly throw away any old contents of this valueset, and stick in the * new ones. + * + * return value: LDAP_SUCCESS - OK + * : LDAP_OPERATIONS_ERROR - duplicated values given */ -void -valueset_replace(Slapi_ValueSet *vs, Slapi_Value **vals) +int +valueset_replace(Slapi_Attr *a, Slapi_ValueSet *vs, Slapi_Value **valstoreplace) { + int rc = LDAP_SUCCESS; + int numberofvalstoreplace= valuearray_count(valstoreplace); if(!valuearray_isempty(vs->va)) - { + { slapi_valueset_done(vs); - } - vs->va = vals; + } + /* verify the given values are not duplicated. + if replacing with one value, no need to check. just replace it. + */ + if (numberofvalstoreplace > 1) + { + Avlnode *vtree = NULL; + rc = valuetree_add_valuearray( a->a_type, a->a_plugin, valstoreplace, &vtree, NULL ); + valuetree_free(&vtree); + if ( LDAP_SUCCESS != rc ) + { + /* There were already duplicate values in the value set */ + rc = LDAP_OPERATIONS_ERROR; + } + } + + if ( rc == LDAP_SUCCESS ) + { + vs->va = valstoreplace; + } + return rc; } /* @@ -1296,7 +1314,7 @@ struct valuearrayfast vaf_valuesupdated; int numberofvaluestoupdate= valuearray_count(valuestoupdate); valuearrayfast_init(&vaf_valuesupdated,*valuesupdated); - if (numberofvaluestoupdate>=SLAPD_MODUTIL_TREE_THRESHHOLD) + if (numberofvaluestoupdate > 1) /* multiple values to update */ { int i; Avlnode *vtree = NULL; From fedora-directory-commits at redhat.com Thu Aug 25 21:17:51 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Thu, 25 Aug 2005 17:17:51 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/admin/src/scripts template-db2index.pl, 1.4, 1.5 Message-ID: <200508252117.j7PLHpeN008499@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8477 Modified Files: template-db2index.pl Log Message: [160003] db2index.pl cannot find libldap50.so if only certain parameters are used In the perl script db2index.pl, before executing any ldap client command line tools, should have chdir to the /shared/bin, where the rpath is set from. Index: template-db2index.pl =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-db2index.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- template-db2index.pl 19 Apr 2005 22:07:00 -0000 1.4 +++ template-db2index.pl 25 Aug 2005 21:17:48 -0000 1.5 @@ -40,21 +40,21 @@ # sub usage { - print(STDERR "Usage: $0 [-v] -D rootdn { -w password | -w - | -j filename } \n"); - print(STDERR " -n instance [-t attributeName[:indextypes[:matchingrules]]]\n"); - print(STDERR " Opts: -D rootdn - Directory Manager\n"); - print(STDERR " : -w password - Directory Manager's password\n"); - print(STDERR " : -w - - Prompt for Directory Manager's password\n"); - print(STDERR " : -j filename - Read Directory Manager's password from file\n"); - print(STDERR " : -n instance - instance to be indexed\n"); - print(STDERR " : -t attributeName[:indextypes[:matchingrules]]\n"); - print(STDERR " - attribute: name of the attribute to be indexed\n"); - print(STDERR " If omitted, all the indexes defined \n"); - print(STDERR " for that instance are generated.\n"); - print(STDERR " - indextypes: comma separated index types\n"); - print(STDERR " - matchingrules: comma separated matrules\n"); - print(STDERR " Example: -t foo:eq,pres\n"); - print(STDERR " : -v - version\n"); + print(STDERR "Usage: $0 [-v] -D rootdn { -w password | -w - | -j filename } \n"); + print(STDERR " -n instance [-t attributeName[:indextypes[:matchingrules]]]\n"); + print(STDERR " Opts: -D rootdn - Directory Manager\n"); + print(STDERR " : -w password - Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for Directory Manager's password\n"); + print(STDERR " : -j filename - Read Directory Manager's password from file\n"); + print(STDERR " : -n instance - instance to be indexed\n"); + print(STDERR " : -t attributeName[:indextypes[:matchingrules]]\n"); + print(STDERR " - attribute: name of the attribute to be indexed\n"); + print(STDERR " If omitted, all the indexes defined \n"); + print(STDERR " for that instance are generated.\n"); + print(STDERR " - indextypes: comma separated index types\n"); + print(STDERR " - matchingrules: comma separated matrules\n"); + print(STDERR " Example: -t foo:eq,pres\n"); + print(STDERR " : -v - verbose\n"); } $instance = ""; @@ -71,81 +71,81 @@ $i = 0; while ($i <= $#ARGV) { - if ("$ARGV[$i]" eq "-n") - { - # instance - $i++; $instance = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-D") - { - # Directory Manager - $i++; $rootdn = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-w") - { - # Directory Manager's password - $i++; $passwd = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-j") - { - # Read Directory Manager's password from a file - $i++; $passwdfile = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-t") - { - # Attribute to index - $i++; $attribute_arg = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-T") - { - # Vlvattribute to index - $i++; $vlvattribute_arg = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-v") - { - # verbose - $verbose = 1; - } - else - { - &usage; exit(1); - } - $i++; + if ("$ARGV[$i]" eq "-n") + { + # instance + $i++; $instance = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-D") + { + # Directory Manager + $i++; $rootdn = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-w") + { + # Directory Manager's password + $i++; $passwd = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-j") + { + # Read Directory Manager's password from a file + $i++; $passwdfile = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-t") + { + # Attribute to index + $i++; $attribute_arg = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-T") + { + # Vlvattribute to index + $i++; $vlvattribute_arg = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-v") + { + # verbose + $verbose = 1; + } + else + { + &usage; exit(1); + } + $i++; } if ($passwdfile ne ""){ # Open file and get the password - unless (open (RPASS, $passwdfile)) { - die "Error, cannot open password file $passwdfile\n"; - } - $passwd = ; - chomp($passwd); - close(RPASS); + unless (open (RPASS, $passwdfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $passwd = ; + chomp($passwd); + close(RPASS); } elsif ($passwd eq "-"){ # Read the password from terminal - die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", - "part of the standard perl distribution. If you want to use it, you must\n", - "download and install the module. You can find it at\n", - "http://www.perl.com/CPAN/CPAN.html\n"; + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. # use Term::ReadKey; -# print "Bind Password: "; -# ReadMode('noecho'); -# $passwd = ReadLine(0); -# chomp($passwd); -# ReadMode('normal'); +# print "Bind Password: "; +# ReadMode('noecho'); +# $passwd = ReadLine(0); +# chomp($passwd); +# ReadMode('normal'); } if ( $rootdn eq "" || $passwd eq "" ) { - &usage; - exit(1); + &usage; + exit(1); } $vstr = ""; if ($verbose != 0) { - $vstr = "-v"; + $vstr = "-v"; } ($s, $m, $h, $dy, $mn, $yr, $wdy, $ydy, $r) = localtime(time); @@ -154,74 +154,72 @@ if ( $instance eq "" ) { - &usage; - exit(1); + &usage; + exit(1); } -else + +# No attribute name has been specified: let's get them from the configuration +$attribute=""; +$indexes_list=""; +$vlvattribute=""; +$vlvindexes_list=""; +chdir("$dsroot{{SEP}}shared{{SEP}}bin"); +if ( $attribute_arg eq "" && $vlvattribute_arg eq "" ) { - # No attribute name has been specified: let's get them from the configuration - $attribute=""; - $indexes_list=""; - $vlvattribute=""; - $vlvindexes_list=""; - if ( $attribute_arg eq "" && $vlvattribute_arg eq "" ) - { - # Get the list of indexes from the entry - $indexes_list="$dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s one " . - "-b \"cn=index,cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"(&(objectclass=*)(nsSystemIndex=false))\" cn"; - - # build the values of the attribute nsIndexAttribute - open(LDAP1, "$indexes_list |"); - while () { - s/\n //g; - if (/^cn: (.*)\n/) { - $IndexAttribute="nsIndexAttribute"; - $attribute="$attribute$IndexAttribute: $1\n"; - } - } - close(LDAP1); - if ( $attribute eq "" ) - { - # No attribute to index, just exit - exit(0); + # Get the list of indexes from the entry + $indexes_list="$dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s one " . + "-b \"cn=index,cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"(&(objectclass=*)(nsSystemIndex=false))\" cn"; + + # build the values of the attribute nsIndexAttribute + open(LDAP1, "$indexes_list |"); + while () { + s/\n //g; + if (/^cn: (.*)\n/) { + $IndexAttribute="nsIndexAttribute"; + $attribute="$attribute$IndexAttribute: $1\n"; } + } + close(LDAP1); + if ( $attribute eq "" ) + { + # No attribute to index, just exit + exit(0); + } + + # Get the list of indexes from the entry + $vlvindexes_list="$dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s sub -b \"cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"objectclass=vlvIndex\" cn"; - # Get the list of indexes from the entry - $vlvindexes_list="$dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s sub -b \"cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"objectclass=vlvIndex\" cn"; - - # build the values of the attribute nsIndexVlvAttribute - open(LDAP1, "$vlvindexes_list |"); - while () { - s/\n //g; - if (/^cn: (.*)\n/) { - $vlvIndexAttribute="nsIndexVlvAttribute"; - $vlvattribute="$vlvattribute$vlvIndexAttribute: $1\n"; - } + # build the values of the attribute nsIndexVlvAttribute + open(LDAP1, "$vlvindexes_list |"); + while () { + s/\n //g; + if (/^cn: (.*)\n/) { + $vlvIndexAttribute="nsIndexVlvAttribute"; + $vlvattribute="$vlvattribute$vlvIndexAttribute: $1\n"; } - close(LDAP1); } - else + close(LDAP1); +} +else +{ + if ( $attribute_arg ne "" ) { - if ( $attribute_arg ne "" ) - { - $attribute="nsIndexAttribute: $attribute_arg\n"; - } - if ( $vlvattribute_arg ne "" ) - { - $vlvattribute="nsIndexVlvAttribute: $vlvattribute_arg\n"; - } + $attribute="nsIndexAttribute: $attribute_arg\n"; + } + if ( $vlvattribute_arg ne "" ) + { + $vlvattribute="nsIndexVlvAttribute: $vlvattribute_arg\n"; } - - # Build the task entry to add - - $dn = "dn: cn=$taskname, cn=index, cn=tasks, cn=config\n"; - $misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n"; - $cn = "cn: $taskname\n"; - $nsinstance = "nsInstance: ${instance}\n"; - - $entry = "${dn}${misc}${cn}${nsinstance}${attribute}${vlvattribute}"; } -chdir("$dsroot{{SEP}}shared{{SEP}}bin"); + +# Build the task entry to add + +$dn = "dn: cn=$taskname, cn=index, cn=tasks, cn=config\n"; +$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n"; +$cn = "cn: $taskname\n"; +$nsinstance = "nsInstance: ${instance}\n"; + +$entry = "${dn}${misc}${cn}${nsinstance}${attribute}${vlvattribute}"; open(FOO, "| $dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" ); print(FOO "$entry"); close(FOO); From fedora-directory-commits at redhat.com Thu Aug 25 21:20:06 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Thu, 25 Aug 2005 17:20:06 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/admin/src/scripts template-db2index.pl, 1.4, 1.4.2.1 Message-ID: <200508252120.j7PLK6wf008537@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8521 Modified Files: Tag: Directory71RtmBranch template-db2index.pl Log Message: [160003] db2index.pl cannot find libldap50.so if only certain parameters are used In the perl script db2index.pl, before executing any ldap client command line tools, should have chdir to the /shared/bin, where the rpath is set from. Index: template-db2index.pl =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-db2index.pl,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- template-db2index.pl 19 Apr 2005 22:07:00 -0000 1.4 +++ template-db2index.pl 25 Aug 2005 21:20:03 -0000 1.4.2.1 @@ -40,21 +40,21 @@ # sub usage { - print(STDERR "Usage: $0 [-v] -D rootdn { -w password | -w - | -j filename } \n"); - print(STDERR " -n instance [-t attributeName[:indextypes[:matchingrules]]]\n"); - print(STDERR " Opts: -D rootdn - Directory Manager\n"); - print(STDERR " : -w password - Directory Manager's password\n"); - print(STDERR " : -w - - Prompt for Directory Manager's password\n"); - print(STDERR " : -j filename - Read Directory Manager's password from file\n"); - print(STDERR " : -n instance - instance to be indexed\n"); - print(STDERR " : -t attributeName[:indextypes[:matchingrules]]\n"); - print(STDERR " - attribute: name of the attribute to be indexed\n"); - print(STDERR " If omitted, all the indexes defined \n"); - print(STDERR " for that instance are generated.\n"); - print(STDERR " - indextypes: comma separated index types\n"); - print(STDERR " - matchingrules: comma separated matrules\n"); - print(STDERR " Example: -t foo:eq,pres\n"); - print(STDERR " : -v - version\n"); + print(STDERR "Usage: $0 [-v] -D rootdn { -w password | -w - | -j filename } \n"); + print(STDERR " -n instance [-t attributeName[:indextypes[:matchingrules]]]\n"); + print(STDERR " Opts: -D rootdn - Directory Manager\n"); + print(STDERR " : -w password - Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for Directory Manager's password\n"); + print(STDERR " : -j filename - Read Directory Manager's password from file\n"); + print(STDERR " : -n instance - instance to be indexed\n"); + print(STDERR " : -t attributeName[:indextypes[:matchingrules]]\n"); + print(STDERR " - attribute: name of the attribute to be indexed\n"); + print(STDERR " If omitted, all the indexes defined \n"); + print(STDERR " for that instance are generated.\n"); + print(STDERR " - indextypes: comma separated index types\n"); + print(STDERR " - matchingrules: comma separated matrules\n"); + print(STDERR " Example: -t foo:eq,pres\n"); + print(STDERR " : -v - verbose\n"); } $instance = ""; @@ -71,81 +71,81 @@ $i = 0; while ($i <= $#ARGV) { - if ("$ARGV[$i]" eq "-n") - { - # instance - $i++; $instance = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-D") - { - # Directory Manager - $i++; $rootdn = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-w") - { - # Directory Manager's password - $i++; $passwd = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-j") - { - # Read Directory Manager's password from a file - $i++; $passwdfile = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-t") - { - # Attribute to index - $i++; $attribute_arg = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-T") - { - # Vlvattribute to index - $i++; $vlvattribute_arg = $ARGV[$i]; - } - elsif ("$ARGV[$i]" eq "-v") - { - # verbose - $verbose = 1; - } - else - { - &usage; exit(1); - } - $i++; + if ("$ARGV[$i]" eq "-n") + { + # instance + $i++; $instance = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-D") + { + # Directory Manager + $i++; $rootdn = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-w") + { + # Directory Manager's password + $i++; $passwd = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-j") + { + # Read Directory Manager's password from a file + $i++; $passwdfile = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-t") + { + # Attribute to index + $i++; $attribute_arg = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-T") + { + # Vlvattribute to index + $i++; $vlvattribute_arg = $ARGV[$i]; + } + elsif ("$ARGV[$i]" eq "-v") + { + # verbose + $verbose = 1; + } + else + { + &usage; exit(1); + } + $i++; } if ($passwdfile ne ""){ # Open file and get the password - unless (open (RPASS, $passwdfile)) { - die "Error, cannot open password file $passwdfile\n"; - } - $passwd = ; - chomp($passwd); - close(RPASS); + unless (open (RPASS, $passwdfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $passwd = ; + chomp($passwd); + close(RPASS); } elsif ($passwd eq "-"){ # Read the password from terminal - die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", - "part of the standard perl distribution. If you want to use it, you must\n", - "download and install the module. You can find it at\n", - "http://www.perl.com/CPAN/CPAN.html\n"; + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. # use Term::ReadKey; -# print "Bind Password: "; -# ReadMode('noecho'); -# $passwd = ReadLine(0); -# chomp($passwd); -# ReadMode('normal'); +# print "Bind Password: "; +# ReadMode('noecho'); +# $passwd = ReadLine(0); +# chomp($passwd); +# ReadMode('normal'); } if ( $rootdn eq "" || $passwd eq "" ) { - &usage; - exit(1); + &usage; + exit(1); } $vstr = ""; if ($verbose != 0) { - $vstr = "-v"; + $vstr = "-v"; } ($s, $m, $h, $dy, $mn, $yr, $wdy, $ydy, $r) = localtime(time); @@ -154,74 +154,72 @@ if ( $instance eq "" ) { - &usage; - exit(1); + &usage; + exit(1); } -else + +# No attribute name has been specified: let's get them from the configuration +$attribute=""; +$indexes_list=""; +$vlvattribute=""; +$vlvindexes_list=""; +chdir("$dsroot{{SEP}}shared{{SEP}}bin"); +if ( $attribute_arg eq "" && $vlvattribute_arg eq "" ) { - # No attribute name has been specified: let's get them from the configuration - $attribute=""; - $indexes_list=""; - $vlvattribute=""; - $vlvindexes_list=""; - if ( $attribute_arg eq "" && $vlvattribute_arg eq "" ) - { - # Get the list of indexes from the entry - $indexes_list="$dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s one " . - "-b \"cn=index,cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"(&(objectclass=*)(nsSystemIndex=false))\" cn"; - - # build the values of the attribute nsIndexAttribute - open(LDAP1, "$indexes_list |"); - while () { - s/\n //g; - if (/^cn: (.*)\n/) { - $IndexAttribute="nsIndexAttribute"; - $attribute="$attribute$IndexAttribute: $1\n"; - } - } - close(LDAP1); - if ( $attribute eq "" ) - { - # No attribute to index, just exit - exit(0); + # Get the list of indexes from the entry + $indexes_list="$dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s one " . + "-b \"cn=index,cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"(&(objectclass=*)(nsSystemIndex=false))\" cn"; + + # build the values of the attribute nsIndexAttribute + open(LDAP1, "$indexes_list |"); + while () { + s/\n //g; + if (/^cn: (.*)\n/) { + $IndexAttribute="nsIndexAttribute"; + $attribute="$attribute$IndexAttribute: $1\n"; } + } + close(LDAP1); + if ( $attribute eq "" ) + { + # No attribute to index, just exit + exit(0); + } + + # Get the list of indexes from the entry + $vlvindexes_list="$dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s sub -b \"cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"objectclass=vlvIndex\" cn"; - # Get the list of indexes from the entry - $vlvindexes_list="$dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s sub -b \"cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"objectclass=vlvIndex\" cn"; - - # build the values of the attribute nsIndexVlvAttribute - open(LDAP1, "$vlvindexes_list |"); - while () { - s/\n //g; - if (/^cn: (.*)\n/) { - $vlvIndexAttribute="nsIndexVlvAttribute"; - $vlvattribute="$vlvattribute$vlvIndexAttribute: $1\n"; - } + # build the values of the attribute nsIndexVlvAttribute + open(LDAP1, "$vlvindexes_list |"); + while () { + s/\n //g; + if (/^cn: (.*)\n/) { + $vlvIndexAttribute="nsIndexVlvAttribute"; + $vlvattribute="$vlvattribute$vlvIndexAttribute: $1\n"; } - close(LDAP1); } - else + close(LDAP1); +} +else +{ + if ( $attribute_arg ne "" ) { - if ( $attribute_arg ne "" ) - { - $attribute="nsIndexAttribute: $attribute_arg\n"; - } - if ( $vlvattribute_arg ne "" ) - { - $vlvattribute="nsIndexVlvAttribute: $vlvattribute_arg\n"; - } + $attribute="nsIndexAttribute: $attribute_arg\n"; + } + if ( $vlvattribute_arg ne "" ) + { + $vlvattribute="nsIndexVlvAttribute: $vlvattribute_arg\n"; } - - # Build the task entry to add - - $dn = "dn: cn=$taskname, cn=index, cn=tasks, cn=config\n"; - $misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n"; - $cn = "cn: $taskname\n"; - $nsinstance = "nsInstance: ${instance}\n"; - - $entry = "${dn}${misc}${cn}${nsinstance}${attribute}${vlvattribute}"; } -chdir("$dsroot{{SEP}}shared{{SEP}}bin"); + +# Build the task entry to add + +$dn = "dn: cn=$taskname, cn=index, cn=tasks, cn=config\n"; +$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n"; +$cn = "cn: $taskname\n"; +$nsinstance = "nsInstance: ${instance}\n"; + +$entry = "${dn}${misc}${cn}${nsinstance}${attribute}${vlvattribute}"; open(FOO, "| $dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" ); print(FOO "$entry"); close(FOO); From fedora-directory-commits at redhat.com Thu Aug 25 21:49:50 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Thu, 25 Aug 2005 17:49:50 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/uiduniq 7bit.c, 1.5, 1.5.2.1 Message-ID: <200508252149.j7PLnoiU009217@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9201 Modified Files: Tag: Directory71RtmBranch 7bit.c Log Message: Bug(s) fixed: 165600 Bug Description: Adding multiple attributes using a single ldapmodify crashes ns-slapd Branch: Directory71RtmBranch Reviewed by: Nathan (Thanks!) Fix Description: In C, the array '[]' dereference operator takes precedence over the '*' deref operator. In this case, I needed to put parentheses around the pointer dereference to avoid having array dereferenced first. modary is a pointer to an array, not an array, so I can't dereference it with the array operator until I first dereference the pointer. Platforms tested: RHEL3 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: 7bit.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq/7bit.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- 7bit.c 19 Apr 2005 22:07:35 -0000 1.5 +++ 7bit.c 25 Aug 2005 21:49:47 -0000 1.5.2.1 @@ -344,7 +344,7 @@ *modary = (LDAPMod **)slapi_ch_malloc(*capacity * sizeof(LDAPMod *)); } } - *modary[*nmods] = toadd; + (*modary)[*nmods] = toadd; (*nmods)++; } From fedora-directory-commits at redhat.com Thu Aug 25 22:38:42 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Thu, 25 Aug 2005 18:38:42 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/views views.c, 1.5, 1.5.2.1 Message-ID: <200508252238.j7PMcgiN010565@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/views In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10467 Modified Files: Tag: Directory71RtmBranch views.c Log Message: Bug(s) fixed: 165640 Bug Description: Directory Server crashes when deleting a view Branch: Directory71RtmBranch Reviewed by: Nathan (Thanks!) Fix Description: Needed to pass in the _address_ of theCache.pCacheViews to views_cache_add_ll_entry. Yet another lesson in using the compiler to catch type errors rather than casting to void*. Platforms tested: RHEL3 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: views.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/views/views.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- views.c 19 Apr 2005 22:07:36 -0000 1.5 +++ views.c 25 Aug 2005 22:38:40 -0000 1.5.2.1 @@ -1529,7 +1529,7 @@ theView->parentid = 0; /* add view to the cache */ - views_cache_add_ll_entry((void**)theCache.pCacheViews, (void *)theView); + views_cache_add_ll_entry((void**)&theCache.pCacheViews, (void *)theView); views_cache_discover_parent(theView); if(theView->pParent) From fedora-directory-commits at redhat.com Thu Aug 25 23:05:44 2005 From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder)) Date: Thu, 25 Aug 2005 19:05:44 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/uiduniq uid.c, 1.6, 1.6.2.1 Message-ID: <200508252306.j7PN6CF3011848@cvs-int.fedora.redhat.com> Author: nkinder Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11833 Modified Files: Tag: Directory71RtmBranch uid.c Log Message: 164836 - Attribute uniqueness needs to check if the target DN for the incoming operation applies to a subtree before searchnig for a conflict within it. Index: uid.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq/uid.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- uid.c 19 Apr 2005 22:07:35 -0000 1.6 +++ uid.c 25 Aug 2005 23:05:20 -0000 1.6.2.1 @@ -383,8 +383,14 @@ */ for(;argc > 0;argc--,argv++) { - result = search(*argv, attrName, attr, values, dn); - if (result) break; + /* + * The DN should already be normalized, so we don't have to + * worry about that here. + */ + if (slapi_dn_issuffix(dn, *argv)) { + result = search(*argv, attrName, attr, values, dn); + if (result) break; + } } return result; } From fedora-directory-commits at redhat.com Fri Aug 26 15:44:38 2005 From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder)) Date: Fri, 26 Aug 2005 11:44:38 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd libslapd.def, 1.11, 1.11.2.1 slapi-private.h, 1.8, 1.8.2.1 Message-ID: <200508261544.j7QFic0N015071@cvs-int.fedora.redhat.com> Author: nkinder Update of /cvs/dirsec/ldapserver/ldap/servers/slapd In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15039 Modified Files: Tag: Directory71RtmBranch libslapd.def slapi-private.h Log Message: 164843, 166012, 165827 - Indexing code now deals with attribute subtypes correctly. Index: libslapd.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/libslapd.def,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -r1.11 -r1.11.2.1 --- libslapd.def 19 Apr 2005 22:07:36 -0000 1.11 +++ libslapd.def 26 Aug 2005 15:44:35 -0000 1.11.2.1 @@ -1056,6 +1056,7 @@ slapi_entry_delete_values_sv @1058 slapi_entry_attr_replace_sv @1059 + valuearray_find @1060 valuearray_free @1061 slapd_Client_auth @1062 slapi_rand_r @1063 Index: slapi-private.h =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slapi-private.h,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -r1.8 -r1.8.2.1 --- slapi-private.h 19 Apr 2005 22:07:37 -0000 1.8 +++ slapi-private.h 26 Aug 2005 15:44:35 -0000 1.8.2.1 @@ -778,6 +778,7 @@ void valuearray_add_value_fast(Slapi_Value ***vals, Slapi_Value *addval, int nvals, int *maxvals, int exact, int passin); void valuearray_add_valuearray( Slapi_Value ***vals, Slapi_Value **addvals, PRUint32 flags ); void valuearray_add_valuearray_fast( Slapi_Value ***vals, Slapi_Value **addvals, int nvals, int naddvals, int *maxvals, int exact, int passin ); +int valuearray_find(const Slapi_Attr *a, Slapi_Value **va, const Slapi_Value *v); /****************************************************************************** From fedora-directory-commits at redhat.com Fri Aug 26 15:44:38 2005 From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder)) Date: Fri, 26 Aug 2005 11:44:38 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm back-ldbm.h, 1.5, 1.5.2.1 index.c, 1.5, 1.5.2.1 Message-ID: <200508261544.j7QFichv015078@cvs-int.fedora.redhat.com> Author: nkinder Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15039/back-ldbm Modified Files: Tag: Directory71RtmBranch back-ldbm.h index.c Log Message: 164843, 166012, 165827 - Indexing code now deals with attribute subtypes correctly. Index: back-ldbm.h =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/back-ldbm.h,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- back-ldbm.h 25 Apr 2005 16:24:23 -0000 1.5 +++ back-ldbm.h 26 Aug 2005 15:44:36 -0000 1.5.2.1 @@ -637,6 +637,7 @@ #define BE_INDEX_PRESENCE 4 /* (w/DEL) remove the presence index */ #define BE_INDEX_TOMBSTONE 8 /* Index entry as a tombstone */ #define BE_INDEX_DONT_ENCRYPT 16 /* Disable any encryption if this flag is set */ +#define BE_INDEX_EQUALITY 32 /* (w/DEL) remove the equality index */ /* Name of attribute type used for binder-based look through limit */ #define LDBM_LOOKTHROUGHLIMIT_AT "nsLookThroughLimit" Index: index.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/index.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- index.c 19 Apr 2005 22:07:38 -0000 1.5 +++ index.c 26 Aug 2005 15:44:36 -0000 1.5.2.1 @@ -453,35 +453,120 @@ ) { int rc = 0; - int i; - Slapi_Attr *attr; + int i, j; ID id = olde->ep_id; - Slapi_Value **svals = NULL; + int flags = 0; + char buf[SLAPD_TYPICAL_ATTRIBUTE_NAME_MAX_LENGTH]; + char *basetype = NULL; + char *tmp = NULL; + Slapi_Attr *curr_attr = NULL; + Slapi_ValueSet *all_vals = NULL; + Slapi_ValueSet *mod_vals = NULL; + Slapi_Value **evals = NULL; /* values that still exist after a + * delete. + */ + Slapi_Value **mods_valueArray = NULL; /* values that are specified in this + * operation. + */ + Slapi_Value **deleted_valueArray = NULL; /* values whose index entries + * should be deleted. + */ for ( i = 0; mods[i] != NULL; i++ ) { + /* Get base attribute type */ + basetype = buf; + tmp = slapi_attr_basetype(mods[i]->mod_type, buf, sizeof(buf)); + if(tmp != NULL) { + basetype = tmp; /* basetype was malloc'd */ + } + + /* Get a list of all remaining values for the base type + * and any present subtypes. + */ + all_vals = slapi_valueset_new(); + + for (curr_attr = newe->ep_entry->e_attrs; curr_attr != NULL; curr_attr = curr_attr->a_next) { + if (slapi_attr_type_cmp( basetype, curr_attr->a_type, SLAPI_TYPE_CMP_BASE ) == 0) { + valueset_add_valuearray(all_vals, attr_get_present_values(curr_attr)); + } + } + + evals = valueset_get_valuearray(all_vals); + + /* Get a list of all values specified in the operation. + */ + if ( mods[i]->mod_bvalues != NULL ) { + valuearray_init_bervalarray(mods[i]->mod_bvalues, + &mods_valueArray); + } + switch ( mods[i]->mod_op & ~LDAP_MOD_BVALUES ) { case LDAP_MOD_REPLACE: + flags = BE_INDEX_DEL; + /* Get a list of all values being deleted. + */ + mod_vals = slapi_valueset_new(); + + for (curr_attr = olde->ep_entry->e_attrs; curr_attr != NULL; curr_attr = curr_attr->a_next) { + if (slapi_attr_type_cmp( mods[i]->mod_type, curr_attr->a_type, SLAPI_TYPE_CMP_EXACT ) == 0) { + valueset_add_valuearray(mod_vals, attr_get_present_values(curr_attr)); + } + } + + deleted_valueArray = valueset_get_valuearray(mod_vals); + + /* If subtypes exist, don't remove the presence + * index. + */ + if ( evals != NULL && deleted_valueArray != NULL) { + /* evals will contain the new value that is being + * added as part of the replace operation if one + * was specified. We must remove this value from + * evals to know if any subtypes are present. + */ + slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &curr_attr ); + if ( mods_valueArray != NULL ) { + for ( j = 0; mods_valueArray[j] != NULL; j++ ) { + valuearray_remove_value(curr_attr, evals, mods_valueArray[j]); + } + } + + /* Search evals for the values being deleted. If + * they don't exist, delete the equality index. + */ + for ( j = 0; deleted_valueArray[j] != NULL; j++ ) { + if (valuearray_find(curr_attr, evals, deleted_valueArray[j]) == -1) { + if (!(flags & BE_INDEX_EQUALITY)) { + flags |= BE_INDEX_EQUALITY; + } + } else { + /* Remove duplicate value from deleted value array */ + valuearray_remove_value(curr_attr, deleted_valueArray, deleted_valueArray[j]); + j--; + } + } + } else { + flags |= BE_INDEX_PRESENCE|BE_INDEX_EQUALITY; + } + /* We need to first remove the old values from the - * index. */ - if ( slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &attr ) == 0 && - (svals = attr_get_present_values(attr)) != NULL ) { + * index, if any. */ + if (deleted_valueArray) { index_addordel_values_sv( be, mods[i]->mod_type, - svals, NULL, id, - BE_INDEX_DEL|BE_INDEX_PRESENCE, - txn ); + deleted_valueArray, evals, id, + flags, txn ); } + + /* Free valuearray */ + slapi_valueset_free(mod_vals); case LDAP_MOD_ADD: - if ( mods[i]->mod_bvalues == NULL ) { + if ( mods_valueArray == NULL ) { rc = 0; } else { - Slapi_Value **mods_valueArray = NULL; - valuearray_init_bervalarray(mods[i]->mod_bvalues, - &mods_valueArray); rc = index_addordel_values_sv( be, mods[i]->mod_type, mods_valueArray, NULL, id, BE_INDEX_ADD, txn ); - valuearray_free(&mods_valueArray); } break; @@ -489,44 +574,92 @@ if ( (mods[i]->mod_bvalues == NULL) || (mods[i]->mod_bvalues[0] == NULL) ) { rc = 0; - /* if no value are specified all the values will - * be suppressed -> remove the presence index + flags = BE_INDEX_DEL; + + /* Get a list of all values that are being + * deleted. + */ + mod_vals = slapi_valueset_new(); + + for (curr_attr = olde->ep_entry->e_attrs; curr_attr != NULL; curr_attr = curr_attr->a_next) { + if (slapi_attr_type_cmp( mods[i]->mod_type, curr_attr->a_type, SLAPI_TYPE_CMP_EXACT ) == 0) { + valueset_add_valuearray(mod_vals, attr_get_present_values(curr_attr)); + } + } + + deleted_valueArray = valueset_get_valuearray(mod_vals); + + /* If subtypes exist, don't remove the + * presence index. */ - if ( slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &attr ) == 0 && - (svals = attr_get_present_values(attr)) != NULL ) { - index_addordel_values_sv( be, mods[i]->mod_type, - svals, NULL, id, BE_INDEX_DEL|BE_INDEX_PRESENCE, txn); + if (evals != NULL) { + for (curr_attr = newe->ep_entry->e_attrs; (curr_attr != NULL); + curr_attr = curr_attr->a_next) { + if (slapi_attr_type_cmp( basetype, curr_attr->a_type, SLAPI_TYPE_CMP_BASE ) == 0) { + /* Check if the any values being deleted + * also exist in a subtype. + */ + for ( j=0; deleted_valueArray[j] != NULL; j++) { + if ( valuearray_find(curr_attr, evals, deleted_valueArray[j]) == -1 ) { + /* If the equality flag isn't already set, set it */ + if (!(flags & BE_INDEX_EQUALITY)) { + flags |= BE_INDEX_EQUALITY; + } + } else { + /* Remove duplicate value from the mod list */ + valuearray_remove_value(curr_attr, deleted_valueArray, deleted_valueArray[j]); + j--; + } + } + } + } + } else { + flags = BE_INDEX_DEL|BE_INDEX_PRESENCE|BE_INDEX_EQUALITY; } + + /* Update the index */ + index_addordel_values_sv( be, mods[i]->mod_type, + deleted_valueArray, evals, id, flags, txn); + + slapi_valueset_free(mod_vals); } else { + /* determine if the presence key should be * removed (are we removing the last value * for this attribute?) */ - int flags = BE_INDEX_DEL; - Slapi_Value ** svals = NULL; - Slapi_Value **mods_valueArray = NULL; - - valuearray_init_bervalarray(mods[i]->mod_bvalues, - &mods_valueArray); - - if (slapi_entry_attr_find(newe->ep_entry, - mods[i]->mod_type, &attr) == 0) { - svals = attr_get_present_values(attr); + if (evals == NULL || evals[0] == NULL) { + flags = BE_INDEX_DEL|BE_INDEX_PRESENCE; + } else { + flags = BE_INDEX_DEL; } - if (svals == NULL || svals[0] == NULL) { - flags |= BE_INDEX_PRESENCE; - } + /* If the same value doesn't exist in a subtype, set + * BE_INDEX_EQUALITY flag so the equality index is + * removed. + */ + slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &curr_attr); + for (j = 0; mods_valueArray[j] != NULL; j++ ) { + if ( valuearray_find(curr_attr, evals, mods_valueArray[j]) == -1 ) { + if (!(flags & BE_INDEX_EQUALITY)) { + flags |= BE_INDEX_EQUALITY; + } + } + } - rc = index_addordel_values_sv( be, mods[i]->mod_type, + rc = index_addordel_values_sv( be, basetype, mods_valueArray, - svals, id, flags, txn ); - valuearray_free(&mods_valueArray); + evals, id, flags, txn ); } rc = 0; break; } + /* free memory */ + slapi_ch_free((void **)&tmp); + valuearray_free(&mods_valueArray); + slapi_valueset_free(all_vals); + if ( rc != 0 ) { ldbm_nasty(errmsg, 1040, rc); return( rc ); @@ -1595,7 +1728,11 @@ /* * equality index entry */ - if ( ai->ai_indexmask & INDEX_EQUALITY ) { + if (( ai->ai_indexmask & INDEX_EQUALITY ) && + (flags & (BE_INDEX_ADD|BE_INDEX_EQUALITY))) { + /* on delete, only remove the equality index if the + * BE_INDEX_EQUALITY flag is set. + */ slapi_call_syntax_values2keys_sv( ai->ai_plugin, vals, &ivals, LDAP_FILTER_EQUALITY ); From fedora-directory-commits at redhat.com Fri Aug 26 15:52:06 2005 From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder)) Date: Fri, 26 Aug 2005 11:52:06 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm ldbm_delete.c, 1.4, 1.4.2.1 Message-ID: <200508261552.j7QFq6R6015145@cvs-int.fedora.redhat.com> Author: nkinder Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15129 Modified Files: Tag: Directory71RtmBranch ldbm_delete.c Log Message: 165862 - Deleting an entry needs to set BE_INDEX_EQUALITY to remove the entrydn index Index: ldbm_delete.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_delete.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- ldbm_delete.c 19 Apr 2005 22:07:38 -0000 1.4 +++ ldbm_delete.c 26 Aug 2005 15:52:04 -0000 1.4.2.1 @@ -401,7 +401,7 @@ } } /* delete from attribute indexes */ - addordel_flags = BE_INDEX_DEL|BE_INDEX_PRESENCE; + addordel_flags = BE_INDEX_DEL|BE_INDEX_PRESENCE|BE_INDEX_EQUALITY; if (delete_tombstone_entry) { addordel_flags |= BE_INDEX_TOMBSTONE; /* tell index code we are deleting a tombstone */ From fedora-directory-commits at redhat.com Fri Aug 26 18:51:53 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Fri, 26 Aug 2005 14:51:53 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/admin/src create_instance.c, 1.18, 1.18.2.1 Message-ID: <200508261851.j7QIprgC020095@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/admin/src In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20066 Modified Files: Tag: Directory71RtmBranch create_instance.c Log Message: Bug(s) fixed: 151678 Bug Description: new instance creation creates error aci (2 types in RDN) Reviewed by: Nathan (Thanks!) Fix Description: This only seems to occur when logging in to the console as a user other than the Console Admin user (e.g. as Directory Manager in my tests). We need the Console Admin DN or user id to construct the ACIs. This value is held in the suitespot3x_uid form parameter. I had removed it while working on this bug or a related bug earlier, but now that I've added it back, everything seems to be working again. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: create_instance.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/create_instance.c,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -u -r1.18 -r1.18.2.1 --- create_instance.c 17 May 2005 23:07:12 -0000 1.18 +++ create_instance.c 26 Aug 2005 18:51:50 -0000 1.18.2.1 @@ -4662,6 +4662,7 @@ return 1; } + cf->suitespot3x_uid = ds_a_get_cgi_var("suitespot3x_uid", NULL, NULL); cf->cfg_sspt = ds_a_get_cgi_var("cfg_sspt", NULL, NULL); cf->cfg_sspt_uid = ds_a_get_cgi_var("cfg_sspt_uid", NULL, NULL); if (cf->cfg_sspt_uid && *(cf->cfg_sspt_uid) && From fedora-directory-commits at redhat.com Fri Aug 26 19:11:43 2005 From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder)) Date: Fri, 26 Aug 2005 15:11:43 -0400 Subject: [Fedora-directory-commits] console build.properties, 1.1.1.1, 1.2 build.xml, 1.1.1.1, 1.2 Message-ID: <200508261911.j7QJBhmu021509@cvs-int.fedora.redhat.com> Author: nkinder Update of /cvs/dirsec/console In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21491 Modified Files: build.properties build.xml Log Message: 166877 - Changed console version to 7.1 and changed consolesdk naming to plain console in the Ant build files. Index: build.properties =================================================================== RCS file: /cvs/dirsec/console/build.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- build.properties 18 Jul 2005 00:34:05 -0000 1.1.1.1 +++ build.properties 26 Aug 2005 19:11:40 -0000 1.2 @@ -21,8 +21,8 @@ lang=en -consolesdk.root=.. -consolesdk.version=70 +console.root=.. +console.version=71 mcc.core=mcc mcc.name=${mcc.core}${consolesdk.version} Index: build.xml =================================================================== RCS file: /cvs/dirsec/console/build.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- build.xml 18 Jul 2005 00:34:05 -0000 1.1.1.1 +++ build.xml 26 Aug 2005 19:11:40 -0000 1.2 @@ -19,12 +19,12 @@ END COPYRIGHT BLOCK --> - + - + @@ -32,7 +32,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -125,7 +125,7 @@ optimize="${compile.optimize}" verbose="no" excludes="**/CVS/**"> - + @@ -238,15 +238,15 @@ - + prefix="console${console.version}"> From fedora-directory-commits at redhat.com Fri Aug 26 19:41:43 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Fri, 26 Aug 2005 15:41:43 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/admin/src create_instance.c, 1.19, 1.20 Message-ID: <200508261941.j7QJfhIV022218@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/admin/src In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22201 Modified Files: create_instance.c Log Message: Bug(s) fixed: 151678 Bug Description: new instance creation creates error aci (2 types in RDN) Reviewed by: Nathan (Thanks!) Fix Description: This only seems to occur when logging in to the console as a user other than the Console Admin user (e.g. as Directory Manager in my tests). We need the Console Admin DN or user id to construct the ACIs. This value is held in the suitespot3x_uid form parameter. I had removed it while working on this bug or a related bug earlier, but now that I've added it back, everything seems to be working again. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: create_instance.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/create_instance.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- create_instance.c 14 Jun 2005 15:44:18 -0000 1.19 +++ create_instance.c 26 Aug 2005 19:41:40 -0000 1.20 @@ -4672,6 +4672,7 @@ return 1; } + cf->suitespot3x_uid = ds_a_get_cgi_var("suitespot3x_uid", NULL, NULL); cf->cfg_sspt = ds_a_get_cgi_var("cfg_sspt", NULL, NULL); cf->cfg_sspt_uid = ds_a_get_cgi_var("cfg_sspt_uid", NULL, NULL); if (cf->cfg_sspt_uid && *(cf->cfg_sspt_uid) && From fedora-directory-commits at redhat.com Mon Aug 29 22:06:50 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 29 Aug 2005 18:06:50 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd saslbind.c, 1.9, 1.9.2.1 Message-ID: <200508292206.j7TM6o5w012011@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/slapd In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11994/ldapserver/ldap/servers/slapd Modified Files: Tag: Directory71RtmBranch saslbind.c Log Message: Bug(s) fixed: 166229 Bug Description: slapd crashes during SASL authentication Reviewed by: Noriko (Thanks!) Branch: Directory71RtmBranch Fix Description: I could not reproduce the crash. I tried several different ways - no password in entry, empty password in entry, SSHA hashed password in entry - no crashes. No useful information from the FDS bug reporter either. In fact I found that SASL Digest-MD5 was not working at all. We needed to use the SASL_AUX_PASSWORD_PROP define instead of hardcoding "userpassword" - I guess sasl is case sensitive. I also fixed some missing new lines in log messages. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: saslbind.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/saslbind.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -r1.9 -r1.9.2.1 --- saslbind.c 19 Apr 2005 22:07:37 -0000 1.9 +++ saslbind.c 29 Aug 2005 22:06:25 -0000 1.9.2.1 @@ -136,7 +136,7 @@ { switch (level) { case SASL_LOG_ERR: /* log unusual errors (default) */ - slapi_log_error(SLAPI_LOG_FATAL, "sasl", "%s", message); + slapi_log_error(SLAPI_LOG_FATAL, "sasl", "%s\n", message); break; case SASL_LOG_FAIL: /* log all authentication failures */ @@ -146,7 +146,7 @@ case SASL_LOG_TRACE: /* traces of internal protocols */ case SASL_LOG_PASS: /* traces of internal protocols, including * passwords */ - LDAPDebug(LDAP_DEBUG_ANY, "sasl(%d): %s", level, message, 0); + LDAPDebug(LDAP_DEBUG_ANY, "sasl(%d): %s\n", level, message, 0); break; case SASL_LOG_NONE: /* don't log anything */ @@ -446,7 +446,12 @@ clear = pw; if (clear) { - if (prop_set(propctx, "userpassword", clear, -1) != 0) { + if (prop_set(propctx, SASL_AUX_PASSWORD_PROP, clear, -1) != 0) { + /* Failure is benign here because some mechanisms don't support this property */ + /*LDAPDebug(LDAP_DEBUG_TRACE, "prop_set(userpassword) failed\n", 0, 0, 0); + goto fail */ ; + } + if (prop_set(propctx, SASL_AUX_PASSWORD, clear, -1) != 0) { /* Failure is benign here because some mechanisms don't support this property */ /*LDAPDebug(LDAP_DEBUG_TRACE, "prop_set(userpassword) failed\n", 0, 0, 0); goto fail */ ; From fedora-directory-commits at redhat.com Mon Aug 29 22:11:08 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 29 Aug 2005 18:11:08 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd saslbind.c, 1.9, 1.10 Message-ID: <200508292211.j7TMB8ct012093@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/slapd In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12077 Modified Files: saslbind.c Log Message: Bug(s) fixed: 166229 Bug Description: slapd crashes during SASL authentication Reviewed by: Noriko (Thanks!) Branch: HEAD Fix Description: I could not reproduce the crash. I tried several different ways - no password in entry, empty password in entry, SSHA hashed password in entry - no crashes. No useful information from the FDS bug reporter either. In fact I found that SASL Digest-MD5 was not working at all. We needed to use the SASL_AUX_PASSWORD_PROP define instead of hardcoding "userpassword" - I guess sasl is case sensitive. I also fixed some missing new lines in log messages. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: saslbind.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/saslbind.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- saslbind.c 19 Apr 2005 22:07:37 -0000 1.9 +++ saslbind.c 29 Aug 2005 22:11:05 -0000 1.10 @@ -136,7 +136,7 @@ { switch (level) { case SASL_LOG_ERR: /* log unusual errors (default) */ - slapi_log_error(SLAPI_LOG_FATAL, "sasl", "%s", message); + slapi_log_error(SLAPI_LOG_FATAL, "sasl", "%s\n", message); break; case SASL_LOG_FAIL: /* log all authentication failures */ @@ -146,7 +146,7 @@ case SASL_LOG_TRACE: /* traces of internal protocols */ case SASL_LOG_PASS: /* traces of internal protocols, including * passwords */ - LDAPDebug(LDAP_DEBUG_ANY, "sasl(%d): %s", level, message, 0); + LDAPDebug(LDAP_DEBUG_ANY, "sasl(%d): %s\n", level, message, 0); break; case SASL_LOG_NONE: /* don't log anything */ @@ -446,7 +446,12 @@ clear = pw; if (clear) { - if (prop_set(propctx, "userpassword", clear, -1) != 0) { + if (prop_set(propctx, SASL_AUX_PASSWORD_PROP, clear, -1) != 0) { + /* Failure is benign here because some mechanisms don't support this property */ + /*LDAPDebug(LDAP_DEBUG_TRACE, "prop_set(userpassword) failed\n", 0, 0, 0); + goto fail */ ; + } + if (prop_set(propctx, SASL_AUX_PASSWORD, clear, -1) != 0) { /* Failure is benign here because some mechanisms don't support this property */ /*LDAPDebug(LDAP_DEBUG_TRACE, "prop_set(userpassword) failed\n", 0, 0, 0); goto fail */ ; From fedora-directory-commits at redhat.com Tue Aug 30 21:16:16 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Tue, 30 Aug 2005 17:16:16 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd filtercmp.c, 1.4, 1.4.2.1 Message-ID: <200508302116.j7ULGGsX015793@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/slapd In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15763/ldapserver/ldap/servers/slapd Modified Files: Tag: Directory71RtmBranch filtercmp.c Log Message: Bug(s) fixed: 165641 Bug Description: ./ns-slapd crashes on bind containing invalid dn and password Reviewed by: Noriko (Thanks!) Branch: Directory71RtmBranch Fix Description: It's really crashing on the search request. The problem is that the server assumes all strings are encoded in utf8 format, since that is the only encoding allowed by the LDAP standards. Non-utf8 works in most places except the function slapi_utf8StrToLower(), which returns NULL given a string of non-utf8 bytes. The fix for this particular problem is to check for a NULL return value and handle accordingly. The real solution to this problem would be for the server to check for valid utf8 strings in _all_ LDAP data, according to the syntax of the attribute (e.g. for binary or octet string syntax data, and other binary formats, all bets are off, but then we shouldn't be doing strtolower on these blobs either). And, while we're at it, add data validation based on syntax for _all_ attributes e.g. in a pre-op. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: filtercmp.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/filtercmp.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- filtercmp.c 19 Apr 2005 22:07:36 -0000 1.4 +++ filtercmp.c 30 Aug 2005 21:16:13 -0000 1.4.2.1 @@ -64,7 +64,8 @@ unsigned char *normstr; normstr = slapi_utf8StrToLower((unsigned char *)data); - hash = addhash(hash, normstr, strlen((char *)normstr)); + hash = addhash(hash, normstr, + normstr ? strlen((char *)normstr) : 0); if ((char *)normstr != data) slapi_ch_free((void **)&normstr); return hash; From fedora-directory-commits at redhat.com Tue Aug 30 21:16:17 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Tue, 30 Aug 2005 17:16:17 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm ldbm_attr.c, 1.5, 1.5.2.1 Message-ID: <200508302116.j7ULGHpQ015799@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15763/ldapserver/ldap/servers/slapd/back-ldbm Modified Files: Tag: Directory71RtmBranch ldbm_attr.c Log Message: Bug(s) fixed: 165641 Bug Description: ./ns-slapd crashes on bind containing invalid dn and password Reviewed by: Noriko (Thanks!) Branch: Directory71RtmBranch Fix Description: It's really crashing on the search request. The problem is that the server assumes all strings are encoded in utf8 format, since that is the only encoding allowed by the LDAP standards. Non-utf8 works in most places except the function slapi_utf8StrToLower(), which returns NULL given a string of non-utf8 bytes. The fix for this particular problem is to check for a NULL return value and handle accordingly. The real solution to this problem would be for the server to check for valid utf8 strings in _all_ LDAP data, according to the syntax of the attribute (e.g. for binary or octet string syntax data, and other binary formats, all bets are off, but then we shouldn't be doing strtolower on these blobs either). And, while we're at it, add data validation based on syntax for _all_ attributes e.g. in a pre-op. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: ldbm_attr.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_attr.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- ldbm_attr.c 19 Apr 2005 22:07:38 -0000 1.5 +++ ldbm_attr.c 30 Aug 2005 21:16:14 -0000 1.5.2.1 @@ -632,7 +632,7 @@ if ( NULL != fstr ) { char *lc_fstr = (char *)slapi_utf8StrToLower( (unsigned char *)fstr ); - if (string_find(lc_fstr,"subordinates")) { + if (lc_fstr && string_find(lc_fstr,"subordinates")) { Slapi_Filter *f = NULL; /* Look for special filters we want to leave alone */ if (0 == strcmp(lc_fstr, "(&(numsubordinates=*)(numsubordinates>=1))" )) { From fedora-directory-commits at redhat.com Tue Aug 30 21:21:22 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Tue, 30 Aug 2005 17:21:22 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd filtercmp.c, 1.4, 1.5 Message-ID: <200508302121.j7ULLMtO015861@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/slapd In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15834 Modified Files: filtercmp.c Log Message: Bug(s) fixed: 165641 Bug Description: ./ns-slapd crashes on bind containing invalid dn and password Reviewed by: Noriko (Thanks!) Branch: HEAD Fix Description: It's really crashing on the search request. The problem is that the server assumes all strings are encoded in utf8 format, since that is the only encoding allowed by the LDAP standards. Non-utf8 works in most places except the function slapi_utf8StrToLower(), which returns NULL given a string of non-utf8 bytes. The fix for this particular problem is to check for a NULL return value and handle accordingly. The real solution to this problem would be for the server to check for valid utf8 strings in _all_ LDAP data, according to the syntax of the attribute (e.g. for binary or octet string syntax data, and other binary formats, all bets are off, but then we shouldn't be doing strtolower on these blobs either). And, while we're at it, add data validation based on syntax for _all_ attributes e.g. in a pre-op. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: filtercmp.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/filtercmp.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- filtercmp.c 19 Apr 2005 22:07:36 -0000 1.4 +++ filtercmp.c 30 Aug 2005 21:21:19 -0000 1.5 @@ -64,7 +64,8 @@ unsigned char *normstr; normstr = slapi_utf8StrToLower((unsigned char *)data); - hash = addhash(hash, normstr, strlen((char *)normstr)); + hash = addhash(hash, normstr, + normstr ? strlen((char *)normstr) : 0); if ((char *)normstr != data) slapi_ch_free((void **)&normstr); return hash; From fedora-directory-commits at redhat.com Tue Aug 30 21:21:23 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Tue, 30 Aug 2005 17:21:23 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm ldbm_attr.c, 1.5, 1.6 Message-ID: <200508302121.j7ULLNXv015867@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15834/back-ldbm Modified Files: ldbm_attr.c Log Message: Bug(s) fixed: 165641 Bug Description: ./ns-slapd crashes on bind containing invalid dn and password Reviewed by: Noriko (Thanks!) Branch: HEAD Fix Description: It's really crashing on the search request. The problem is that the server assumes all strings are encoded in utf8 format, since that is the only encoding allowed by the LDAP standards. Non-utf8 works in most places except the function slapi_utf8StrToLower(), which returns NULL given a string of non-utf8 bytes. The fix for this particular problem is to check for a NULL return value and handle accordingly. The real solution to this problem would be for the server to check for valid utf8 strings in _all_ LDAP data, according to the syntax of the attribute (e.g. for binary or octet string syntax data, and other binary formats, all bets are off, but then we shouldn't be doing strtolower on these blobs either). And, while we're at it, add data validation based on syntax for _all_ attributes e.g. in a pre-op. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none Index: ldbm_attr.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_attr.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ldbm_attr.c 19 Apr 2005 22:07:38 -0000 1.5 +++ ldbm_attr.c 30 Aug 2005 21:21:20 -0000 1.6 @@ -632,7 +632,7 @@ if ( NULL != fstr ) { char *lc_fstr = (char *)slapi_utf8StrToLower( (unsigned char *)fstr ); - if (string_find(lc_fstr,"subordinates")) { + if (lc_fstr && string_find(lc_fstr,"subordinates")) { Slapi_Filter *f = NULL; /* Look for special filters we want to leave alone */ if (0 == strcmp(lc_fstr, "(&(numsubordinates=*)(numsubordinates>=1))" )) { From fedora-directory-commits at redhat.com Wed Aug 31 17:05:28 2005 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Wed, 31 Aug 2005 13:05:28 -0400 Subject: [Fedora-directory-commits] console build.properties, 1.2, 1.3 build.xml, 1.2, 1.3 Message-ID: <200508311705.j7VH5SbH014201@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/console In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14186 Modified Files: build.properties build.xml Log Message: finish renaming console sdk to just console Index: build.properties =================================================================== RCS file: /cvs/dirsec/console/build.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- build.properties 26 Aug 2005 19:11:40 -0000 1.2 +++ build.properties 31 Aug 2005 17:04:59 -0000 1.3 @@ -25,7 +25,7 @@ console.version=71 mcc.core=mcc -mcc.name=${mcc.core}${consolesdk.version} +mcc.name=${mcc.core}${console.version} nmclf.core=nmclf -nmclf.name=${nmclf.core}${consolesdk.version} +nmclf.name=${nmclf.core}${console.version} Index: build.xml =================================================================== RCS file: /cvs/dirsec/console/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- build.xml 26 Aug 2005 19:11:40 -0000 1.2 +++ build.xml 31 Aug 2005 17:05:22 -0000 1.3 @@ -262,8 +262,8 @@ author="true" version="true" use="true" - windowtitle="Console SDK API" - doctitle="Console SDK API" /> + windowtitle="Console API" + doctitle="Console API" /> From fedora-directory-commits at redhat.com Wed Aug 31 21:40:55 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:40:55 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/docs README.txt, 1.2, 1.2.2.1 Message-ID: <200508312141.j7VLfP4Q021338@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/docs In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/docs Modified Files: Tag: Directory71RtmBranch README.txt Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: README.txt =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/docs/README.txt,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- README.txt 5 Apr 2005 00:35:09 -0000 1.2 +++ README.txt 31 Aug 2005 21:40:52 -0000 1.2.2.1 @@ -8,4 +8,4 @@ Late-breaking news and information on the Fedora Directory Server is available at the following location: - http://fedora.redhat.com/ + http://www.redhat.com/docs/manuals/ From fedora-directory-commits at redhat.com Wed Aug 31 21:41:26 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:26 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/syntaxes libsyntax.def, 1.6, 1.6.2.1 Message-ID: <200508312141.j7VLfQcm021344@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/syntaxes In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/plugins/syntaxes Modified Files: Tag: Directory71RtmBranch libsyntax.def Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: libsyntax.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/syntaxes/libsyntax.def,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- libsyntax.def 19 Apr 2005 22:07:35 -0000 1.6 +++ libsyntax.def 31 Aug 2005 21:41:12 -0000 1.6.2.1 @@ -36,7 +36,7 @@ ; All rights reserved. ; END COPYRIGHT BLOCK ; -DESCRIPTION 'Fedora Directory Server 7 syntaxes Plugin' +DESCRIPTION 'Fedora Directory Server 7.1 syntaxes Plugin' EXPORTS cis_init @2 ces_init @3 From fedora-directory-commits at redhat.com Wed Aug 31 21:41:26 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:26 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/uiduniq libuiduniq.def, 1.6, 1.6.2.1 Message-ID: <200508312141.j7VLfQIu021350@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/plugins/uiduniq Modified Files: Tag: Directory71RtmBranch libuiduniq.def Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: libuiduniq.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq/libuiduniq.def,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- libuiduniq.def 19 Apr 2005 22:07:35 -0000 1.6 +++ libuiduniq.def 31 Aug 2005 21:41:24 -0000 1.6.2.1 @@ -38,7 +38,7 @@ ; ; ; -DESCRIPTION 'Fedora Directory Server 7 Unique Attribute Checking Plugin' +DESCRIPTION 'Fedora Directory Server 7.1 Unique Attribute Checking Plugin' ;CODE SHARED READ EXECUTE ;DATA SHARED READ WRITE EXPORTS From fedora-directory-commits at redhat.com Wed Aug 31 21:41:27 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:27 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/test-plugins testbind.c, 1.4.2.1, 1.4.2.2 testdatainterop.c, 1.4.2.1, 1.4.2.2 testentry.c, 1.4.2.1, 1.4.2.2 testextendedop.c, 1.4.2.1, 1.4.2.2 testgetip.c, 1.4.2.1, 1.4.2.2 testpostop.c, 1.4.2.1, 1.4.2.2 testpreop.c, 1.4.2.2, 1.4.2.3 testsaslbind.c, 1.6.2.1, 1.6.2.2 Message-ID: <200508312141.j7VLfRRh021361@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/slapd/test-plugins Modified Files: Tag: Directory71RtmBranch testbind.c testdatainterop.c testentry.c testextendedop.c testgetip.c testpostop.c testpreop.c testsaslbind.c Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: testbind.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testbind.c,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- testbind.c 9 Jun 2005 18:35:02 -0000 1.4.2.1 +++ testbind.c 31 Aug 2005 21:41:24 -0000 1.4.2.2 @@ -69,7 +69,7 @@ #include #include "slapi-plugin.h" -Slapi_PluginDesc bindpdesc = { "test-bind", "Fedora Project", "7.1", +Slapi_PluginDesc bindpdesc = { "test-bind", "Fedora Project", "7.1 SP1", "sample bind pre-operation plugin" }; static Slapi_ComponentId *plugin_id = NULL; Index: testdatainterop.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testdatainterop.c,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- testdatainterop.c 9 Jun 2005 18:35:02 -0000 1.4.2.1 +++ testdatainterop.c 31 Aug 2005 21:41:24 -0000 1.4.2.2 @@ -113,7 +113,7 @@ /* * Static variables. */ -static Slapi_PluginDesc plugindesc = { PLUGIN_NAME, "Fedora Project", "7.1", +static Slapi_PluginDesc plugindesc = { PLUGIN_NAME, "Fedora Project", "7.1 SP1", "sample pre-operation null suffix plugin" }; static Slapi_ComponentId *plugin_id = NULL; Index: testentry.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testentry.c,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- testentry.c 9 Jun 2005 18:35:02 -0000 1.4.2.1 +++ testentry.c 31 Aug 2005 21:41:24 -0000 1.4.2.2 @@ -90,7 +90,7 @@ #include #include "slapi-plugin.h" -Slapi_PluginDesc entrypdesc = { "test-entry", "Fedora Project", "7.1", +Slapi_PluginDesc entrypdesc = { "test-entry", "Fedora Project", "7.1 SP1", "sample entry modification plugin" }; /* Entry store plug-in function */ Index: testextendedop.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testextendedop.c,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- testextendedop.c 9 Jun 2005 18:35:02 -0000 1.4.2.1 +++ testextendedop.c 31 Aug 2005 21:41:24 -0000 1.4.2.2 @@ -83,7 +83,7 @@ /* OID of the extended operation handled by this plug-in */ #define MY_OID "1.2.3.4" -Slapi_PluginDesc expdesc = { "test-extendedop", "Fedora Project", "7.1", +Slapi_PluginDesc expdesc = { "test-extendedop", "Fedora Project", "7.1 SP1", "sample extended operation plugin" }; Index: testgetip.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testgetip.c,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- testgetip.c 9 Jun 2005 18:35:02 -0000 1.4.2.1 +++ testgetip.c 31 Aug 2005 21:41:24 -0000 1.4.2.2 @@ -74,7 +74,7 @@ #include "slapi-plugin.h" #include "nspr.h" -Slapi_PluginDesc getippdesc = { "test-getip", "Fedora Project", "7.1", +Slapi_PluginDesc getippdesc = { "test-getip", "Fedora Project", "7.1 SP1", "sample pre-operation plugin" }; static char *netaddr2str( PRNetAddr *addrp, char *buf, size_t buflen ); Index: testpostop.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testpostop.c,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- testpostop.c 9 Jun 2005 18:35:02 -0000 1.4.2.1 +++ testpostop.c 31 Aug 2005 21:41:24 -0000 1.4.2.2 @@ -93,7 +93,7 @@ static char *changelogfile = "/tmp/changelog"; #endif -Slapi_PluginDesc postoppdesc = { "test-postop", "Fedora Project", "7.1", +Slapi_PluginDesc postoppdesc = { "test-postop", "Fedora Project", "7.1 SP1", "sample post-operation plugin" }; static void write_changelog( int optype, char *dn, void *change, int flag ); Index: testpreop.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testpreop.c,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -u -r1.4.2.2 -r1.4.2.3 --- testpreop.c 24 Jun 2005 01:26:39 -0000 1.4.2.2 +++ testpreop.c 31 Aug 2005 21:41:24 -0000 1.4.2.3 @@ -79,7 +79,7 @@ #include #include "slapi-plugin.h" -Slapi_PluginDesc preoppdesc = { "test-preop", "Fedora Project", "7.1", +Slapi_PluginDesc preoppdesc = { "test-preop", "Fedora Project", "7.1 SP1", "sample pre-operation plugin" }; /* Pre-operation plug-in function */ Index: testsaslbind.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testsaslbind.c,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -u -r1.6.2.1 -r1.6.2.2 --- testsaslbind.c 9 Jun 2005 18:35:02 -0000 1.6.2.1 +++ testsaslbind.c 31 Aug 2005 21:41:24 -0000 1.6.2.2 @@ -80,7 +80,7 @@ #include #include "slapi-plugin.h" -Slapi_PluginDesc saslpdesc = { "test-saslbind", "Fedora Project", "7.1", +Slapi_PluginDesc saslpdesc = { "test-saslbind", "Fedora Project", "7.1 SP1", "sample SASL bind pre-operation plugin" }; From fedora-directory-commits at redhat.com Wed Aug 31 21:41:05 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:05 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/chainingdb libcb.def, 1.6, 1.6.2.1 Message-ID: <200508312141.j7VLfaHv021367@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/chainingdb In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/plugins/chainingdb Modified Files: Tag: Directory71RtmBranch libcb.def Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: libcb.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/chainingdb/libcb.def,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- libcb.def 19 Apr 2005 22:07:29 -0000 1.6 +++ libcb.def 31 Aug 2005 21:41:00 -0000 1.6.2.1 @@ -38,7 +38,7 @@ ; ; ; -DESCRIPTION 'Fedora Directory Server 7 Chaining Database Plugin' +DESCRIPTION 'Fedora Directory Server 7.1 Chaining Database Plugin' ;CODE SHARED READ EXECUTE ;DATA SHARED READ WRITE EXPORTS From fedora-directory-commits at redhat.com Wed Aug 31 21:41:08 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:08 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/collation collation.def, 1.6, 1.6.2.1 Message-ID: <200508312141.j7VLfcgw021371@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/collation In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/plugins/collation Modified Files: Tag: Directory71RtmBranch collation.def Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: collation.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/collation/collation.def,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- collation.def 19 Apr 2005 22:07:29 -0000 1.6 +++ collation.def 31 Aug 2005 21:41:01 -0000 1.6.2.1 @@ -36,7 +36,7 @@ ; All rights reserved. ; END COPYRIGHT BLOCK ; -DESCRIPTION 'Fedora Directory Server 7 Collation Plugin' +DESCRIPTION 'Fedora Directory Server 7.1 Collation Plugin' EXPORTS orderingRule_init @2 plugin_init_debug_level @3 From fedora-directory-commits at redhat.com Wed Aug 31 21:41:11 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:11 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/distrib libdistrib.def, 1.6, 1.6.2.1 Message-ID: <200508312141.j7VLffB1021379@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/distrib In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/plugins/distrib Modified Files: Tag: Directory71RtmBranch libdistrib.def Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: libdistrib.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/distrib/libdistrib.def,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- libdistrib.def 19 Apr 2005 22:07:30 -0000 1.6 +++ libdistrib.def 31 Aug 2005 21:41:07 -0000 1.6.2.1 @@ -35,7 +35,7 @@ ; Copyright (C) 2005 Red Hat, Inc. ; All rights reserved. ; --- END COPYRIGHT BLOCK --- -DESCRIPTION 'Fedora Directory Server 7 distribution logic example' +DESCRIPTION 'Fedora Directory Server 7.1 distribution logic example' EXPORTS alpha_distribution @1 hash_distribution @2 From fedora-directory-commits at redhat.com Wed Aug 31 21:41:09 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:09 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/cm/newinstnt Makefile, 1.6, 1.6.2.1 dsinst.rc, 1.6, 1.6.2.1 Message-ID: <200508312141.j7VLfdsK021375@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/cm/newinstnt In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/cm/newinstnt Modified Files: Tag: Directory71RtmBranch Makefile dsinst.rc Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: Makefile =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/cm/newinstnt/Makefile,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- Makefile 19 Apr 2005 22:07:21 -0000 1.6 +++ Makefile 31 Aug 2005 21:40:51 -0000 1.6.2.1 @@ -117,7 +117,7 @@ $(CC) $(CFLAGS) $< $(OUTDIR)/%.inf: %.inf - $(PERL) $(FIXINF) $(BUILD_MODULE) $(DIR_VERSION) $(BUILD_ROOT)/$(BUILD_ARCH)/buildnum.dat $< $(SECURITY) "DoesntOnNT" $(IS_DIR_LITE) '$(INSTANCE_NAME_PREFIX)' $@ $(BUILD_BOMB) + $(PERL) $(FIXINF) $(BUILD_MODULE) $(NOSP_DIR_VERSION) $(BUILD_ROOT)/$(BUILD_ARCH)/buildnum.dat $< $(SECURITY) "DoesntOnNT" $(IS_DIR_LITE) '$(INSTANCE_NAME_PREFIX)' $@ $(BUILD_BOMB) $(OUTDIR)/%.res: %.rc $(RC) $(RCFLAGS) /fo"$@" $< Index: dsinst.rc =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/cm/newinstnt/dsinst.rc,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- dsinst.rc 19 Apr 2005 22:07:21 -0000 1.6 +++ dsinst.rc 31 Aug 2005 21:40:51 -0000 1.6.2.1 @@ -89,7 +89,7 @@ VALUE "LegalCopyright", "Copyright 2001 Sun Microsystems, Inc. Portions copyright 1999, 2002 Netscape Communications Corporation. All rights reserved.\0" VALUE "OriginalFilename", "\0" VALUE "ProductName", "Fedora Server Products\0" - VALUE "ProductVersion", "7, 1, 0, 0\0" + VALUE "ProductVersion", "7, 1, 1, 0\0" END END BLOCK "VarFileInfo" @@ -190,7 +190,7 @@ IDD_SUITESPOTID DIALOG DISCARDABLE 0, 0, 297, 163 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION -"Directory Server 7.0 Fedora configuration directory server administrator " +"Directory Server 7.1 Fedora configuration directory server administrator " FONT 8, "MS Sans Serif" BEGIN @@ -489,7 +489,7 @@ IDD_ADMIN_ID_ONLY DIALOG DISCARDABLE 0, 0, 297, 163 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION -"Directory Server 7.0 Fedora configuration directory server administrator " +"Directory Server 7.1 Fedora configuration directory server administrator " FONT 8, "MS Sans Serif" BEGIN From fedora-directory-commits at redhat.com Wed Aug 31 21:41:05 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:05 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/ntds/wrapper/wix ntds.wxs, 1.5, 1.5.2.1 Message-ID: <200508312141.j7VLfaGf021370@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/ntds/wrapper/wix In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/ntds/wrapper/wix Modified Files: Tag: Directory71RtmBranch ntds.wxs Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: ntds.wxs =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/ntds/wrapper/wix/ntds.wxs,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- ntds.wxs 13 May 2005 03:20:20 -0000 1.5 +++ ntds.wxs 31 Aug 2005 21:40:53 -0000 1.5.2.1 @@ -38,11 +38,11 @@ + Version='1.0.0' Manufacturer='Fedora Project'> From fedora-directory-commits at redhat.com Wed Aug 31 21:41:12 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:12 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/presence presence.def, 1.5, 1.5.2.1 Message-ID: <200508312141.j7VLfgYJ021381@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/presence In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/plugins/presence Modified Files: Tag: Directory71RtmBranch presence.def Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: presence.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/presence/presence.def,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- presence.def 19 Apr 2005 22:07:31 -0000 1.5 +++ presence.def 31 Aug 2005 21:41:09 -0000 1.5.2.1 @@ -36,7 +36,7 @@ ; All rights reserved. ; END COPYRIGHT BLOCK ; -DESCRIPTION 'Fedora Directory Server 7 Presence Plugin' +DESCRIPTION 'Fedora Directory Server 7.1 Presence Plugin' EXPORTS presence_init @2 plugin_init_debug_level @3 From fedora-directory-commits at redhat.com Wed Aug 31 21:41:13 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:13 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/pwdstorage libpwdstorage.def, 1.7, 1.7.2.1 Message-ID: <200508312141.j7VLfh09021382@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/pwdstorage In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/plugins/pwdstorage Modified Files: Tag: Directory71RtmBranch libpwdstorage.def Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: libpwdstorage.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pwdstorage/libpwdstorage.def,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- libpwdstorage.def 20 Apr 2005 18:10:29 -0000 1.7 +++ libpwdstorage.def 31 Aug 2005 21:41:10 -0000 1.7.2.1 @@ -36,7 +36,7 @@ ; All rights reserved. ; END COPYRIGHT BLOCK ; -DESCRIPTION 'Fedora Directory Server 7 password storage scheme Plugin' +DESCRIPTION 'Fedora Directory Server 7.1 password storage scheme Plugin' EXPORTS sha_pwd_storage_scheme_init @2 ssha_pwd_storage_scheme_init @3 From fedora-directory-commits at redhat.com Wed Aug 31 21:41:11 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:11 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/passthru libpassthru.def, 1.6, 1.6.2.1 Message-ID: <200508312141.j7VLfgJd021380@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/passthru In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/plugins/passthru Modified Files: Tag: Directory71RtmBranch libpassthru.def Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: libpassthru.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/passthru/libpassthru.def,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- libpassthru.def 19 Apr 2005 22:07:31 -0000 1.6 +++ libpassthru.def 31 Aug 2005 21:41:09 -0000 1.6.2.1 @@ -38,7 +38,7 @@ ; ; ; -DESCRIPTION 'Fedora Directory Server 7 Pass Through Authentication Plugin' +DESCRIPTION 'Fedora Directory Server 7.1 Pass Through Authentication Plugin' ;CODE SHARED READ EXECUTE ;DATA SHARED READ WRITE EXPORTS From fedora-directory-commits at redhat.com Wed Aug 31 21:40:52 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:40:52 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/cm Makefile, 1.30, 1.30.2.1 Message-ID: <200508312141.j7VLfwbh021398@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/cm In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/cm Modified Files: Tag: Directory71RtmBranch Makefile Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: Makefile =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/cm/Makefile,v retrieving revision 1.30 retrieving revision 1.30.2.1 diff -u -r1.30 -r1.30.2.1 --- Makefile 28 Apr 2005 17:32:32 -0000 1.30 +++ Makefile 31 Aug 2005 21:40:49 -0000 1.30.2.1 @@ -106,9 +106,9 @@ endif ifdef USE_64 -VERSION=-ver 7.1-64bit +VERSION=-ver 7.1SP1-64bit else -VERSION=-ver 7.1 +VERSION=-ver 7.1SP1 endif ifeq ($(ARCH), HPUX) @@ -257,7 +257,7 @@ ifdef BUILD_RPM # name and version of RPM - must correspond to the spec file - these get branded RPM_BASE_NAME=fedora - RPM_VERSION=7.1 + RPM_VERSION=7.1SP1 RPM_FILE_BASE=$(RPM_BASE_NAME)-ds-$(RPM_VERSION) RPM_ARCH = $(shell uname -i) # root dir for RPM built and temp files From fedora-directory-commits at redhat.com Wed Aug 31 21:41:09 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:09 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/cos cos.def, 1.6, 1.6.2.1 Message-ID: <200508312141.j7VLfdSv021378@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/cos In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/plugins/cos Modified Files: Tag: Directory71RtmBranch cos.def Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: cos.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/cos/cos.def,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- cos.def 19 Apr 2005 22:07:29 -0000 1.6 +++ cos.def 31 Aug 2005 21:41:06 -0000 1.6.2.1 @@ -36,7 +36,7 @@ ; All rights reserved. ; END COPYRIGHT BLOCK ; -DESCRIPTION 'Fedora Directory Server 7 Class Of Service Plugin' +DESCRIPTION 'Fedora Directory Server 7.1 Class Of Service Plugin' EXPORTS cos_init @2 plugin_init_debug_level @3 From fedora-directory-commits at redhat.com Wed Aug 31 21:40:51 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:40:51 -0400 Subject: [Fedora-directory-commits] ldapserver/include version.h, 1.6, 1.6.2.1 Message-ID: <200508312141.j7VLfwjr021394@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/include In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/include Modified Files: Tag: Directory71RtmBranch version.h Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: version.h =================================================================== RCS file: /cvs/dirsec/ldapserver/include/version.h,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- version.h 19 Apr 2005 22:06:43 -0000 1.6 +++ version.h 31 Aug 2005 21:40:48 -0000 1.6.2.1 @@ -44,9 +44,9 @@ exist, the PRODUCT_VERSION define has _DEF appended. */ -#define DIRECTORY_VERSION_DEF "7.1" +#define DIRECTORY_VERSION_DEF "7.1 SP1" #define DIRECTORY_COMPATIBLE "3.0" -#define DIRECTORY_VERSION_STRING "Fedora-DirServer/7.1" +#define DIRECTORY_VERSION_STRING "Fedora-DirServer/7.1 SP1" #define DS_VERSION_DEF DIRECTORY_VERSION_DEF #define DS_VERSION_STRING DIRECTORY_VERSION_STRING From fedora-directory-commits at redhat.com Wed Aug 31 21:40:53 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:40:53 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/cm/newinst Makefile, 1.6, 1.6.2.1 Message-ID: <200508312142.j7VLfwjw021395@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/cm/newinst In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/cm/newinst Modified Files: Tag: Directory71RtmBranch Makefile Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: Makefile =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/cm/newinst/Makefile,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- Makefile 19 Apr 2005 22:07:20 -0000 1.6 +++ Makefile 31 Aug 2005 21:40:50 -0000 1.6.2.1 @@ -177,10 +177,10 @@ ifeq ($(ARCH), WINNT) $(INFO): - $(PERL) fixINF.pl $(BUILD_MODULE) $(DIR_VERSION) $(BUILD_ROOT)/$(BUILD_ARCH)/buildnum.dat slapd.inf $(SECURITY) $(PRODUCT) $(IS_DIR_LITE) $(INSTANCE_NAME_PREFIX) $@.inf $(BUILD_BOMB) "bin/admin/ns-admin,bin/admin/ns-admin.so" + $(PERL) fixINF.pl $(BUILD_MODULE) $(NOSP_DIR_VERSION) $(BUILD_ROOT)/$(BUILD_ARCH)/buildnum.dat slapd.inf $(SECURITY) $(PRODUCT) $(IS_DIR_LITE) $(INSTANCE_NAME_PREFIX) $@.inf $(BUILD_BOMB) "bin/admin/ns-admin,bin/admin/ns-admin.so" else $(INFO): - $(PERL) fixINF.pl $(BUILD_MODULE) $(DIR_VERSION) $(BUILD_ROOT)/$(BUILD_ARCH)/buildnum.dat slapd.inf $(SECURITY) $(PRODUCT) $(IS_DIR_LITE) $(INSTANCE_NAME_PREFIX) $@.inf $(BUILD_BOMB) "$(addprefix lib/,$(LDAP_SOLIBS)) bin/admin/libnsslapd.sl bin/slapd/bin/ns-slapd bin/slapd/bin/ns-slapd.so bin/slapd/bin/libnsslapd_shr.a" + $(PERL) fixINF.pl $(BUILD_MODULE) $(NOSP_DIR_VERSION) $(BUILD_ROOT)/$(BUILD_ARCH)/buildnum.dat slapd.inf $(SECURITY) $(PRODUCT) $(IS_DIR_LITE) $(INSTANCE_NAME_PREFIX) $@.inf $(BUILD_BOMB) "$(addprefix lib/,$(LDAP_SOLIBS)) bin/admin/libnsslapd.sl bin/slapd/bin/ns-slapd bin/slapd/bin/ns-slapd.so bin/slapd/bin/libnsslapd_shr.a" endif $(OBJDEST)/%.o: %.c From fedora-directory-commits at redhat.com Wed Aug 31 21:41:13 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:41:13 -0400 Subject: [Fedora-directory-commits] ldapserver/ldap/servers/plugins/referint referint.def, 1.6, 1.6.2.1 Message-ID: <200508312141.j7VLfwp4021396@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/referint In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078/ldap/servers/plugins/referint Modified Files: Tag: Directory71RtmBranch referint.def Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: referint.def =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/referint/referint.def,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- referint.def 19 Apr 2005 22:07:32 -0000 1.6 +++ referint.def 31 Aug 2005 21:41:11 -0000 1.6.2.1 @@ -36,7 +36,7 @@ ; All rights reserved. ; END COPYRIGHT BLOCK ; -DESCRIPTION 'Fedora Directory Server 7 Referint Plugin' +DESCRIPTION 'Fedora Directory Server 7.1 Referint Plugin' CODE SHARED READ EXECUTE DATA SHARED READ WRITE EXPORTS From fedora-directory-commits at redhat.com Wed Aug 31 21:40:50 2005 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Wed, 31 Aug 2005 17:40:50 -0400 Subject: [Fedora-directory-commits] ldapserver Makefile, 1.24, 1.24.2.1 ldapserver.spec.tmpl, 1.10, 1.10.2.1 nsdefs.mk, 1.11, 1.11.2.1 Message-ID: <200508312142.j7VLfwt1021400@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/ldapserver In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21078 Modified Files: Tag: Directory71RtmBranch Makefile ldapserver.spec.tmpl nsdefs.mk Log Message: [166723] Need version number change for 7.1SP1 Results applying brandver script to update the version numbers. Index: Makefile =================================================================== RCS file: /cvs/dirsec/ldapserver/Makefile,v retrieving revision 1.24 retrieving revision 1.24.2.1 diff -u -r1.24 -r1.24.2.1 --- Makefile 16 May 2005 03:10:04 -0000 1.24 +++ Makefile 31 Aug 2005 21:40:45 -0000 1.24.2.1 @@ -206,9 +206,14 @@ $(RELTOOLSPATH)/brandver.pl -i branding/rhds/brandver.dat -s redhat-ds.spec @echo ==== Finished Branding LDAP Server ========== +debrandDirectory: $(RELTOOLSPATH)/brandver.pl + @echo ==== Debranding LDAP Server ========== + $(RELTOOLSPATH)/brandver.pl -i branding/fedora/brandver.dat -s fedora-ds.spec + @echo ==== Finished Debranding LDAP Server ========== + normalizeDirectory: $(RELTOOLSPATH)/brandver.pl @echo ==== Normalizing LDAP Server ========== - $(RELTOOLSPATH)/brandver.pl -i branding/rhds/normalize.dat -s redhat-ds.spec + $(RELTOOLSPATH)/brandver.pl -i branding/fedora/normalize.dat -s redhat-ds.spec @echo ==== Normalizing Branding LDAP Server ========== buildAndPkgDirectory: buildDirectory pkgDirectory Index: ldapserver.spec.tmpl =================================================================== RCS file: /cvs/dirsec/ldapserver/ldapserver.spec.tmpl,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -r1.10 -r1.10.2.1 --- ldapserver.spec.tmpl 10 May 2005 20:49:43 -0000 1.10 +++ ldapserver.spec.tmpl 31 Aug 2005 21:40:45 -0000 1.10.2.1 @@ -45,7 +45,7 @@ Summary: @COMPANY-PRODUCT-NAME@ Name: @LCASE-COMPANY-NAME-NOSP at -ds Version: @GEN-VERSION@ -Release: 2. at PLATFORM@ +Release: 3. at PLATFORM@ License: GPL plus extensions Group: System Environment/Daemons URL: @COMPANY-URL@ Index: nsdefs.mk =================================================================== RCS file: /cvs/dirsec/ldapserver/nsdefs.mk,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -r1.11 -r1.11.2.1 --- nsdefs.mk 19 Apr 2005 22:06:42 -0000 1.11 +++ nsdefs.mk 31 Aug 2005 21:40:45 -0000 1.11.2.1 @@ -264,7 +264,8 @@ OBJDIR=$(COMMON_OBJDIR) OBJDIR_32=$(COMMON_OBJDIR_32) DO_SEARCH=no -DIR_VERSION:=7.1 +DIR_VERSION:=7.1 SP1 +NOSP_DIR_VERSION:=7.1SP1 DIR_NORM_VERSION:=7.1 # When you change DIRSDK_VERSION or DIRSDK_VERSION_DLL_SUFFIX, you must # update all of the .exp and .def files by executing the following command: