summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/back-ldbm/import-threads.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug 592397 - Upgrade tool dn2rdn: it does not clean upNoriko Hosoi2010-10-191-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | the entrydn in id2entry https://bugzilla.redhat.com/show_bug.cgi?id=592397 Description: If entries created by the 389 v1.2.5 or older, the primary db (id2entry.db4) contains "entrydn: <normalized dn>". Upgrading from the old version to v1.2.6 keeps the entrydn attribute type and its value even though v1.2.6 is not supposed to store the entrydn in the database. 1) This patch drops the entrydn attribute and value in upgrading the db. 2) If an ldif file contains entrydn attribute type and value, import (ldif2db[.pl]) ignores it. 3) A leak was found in the export (db2ldif[.pl]) which is fixed. 4) When nsslapd-subtree-rename-switch configuration attribute has the value "on", entrydn is not used nor created. But the server accepted reindexing entrydn request and generated an entrydn index file. This patch rejects it. 5) Entry and dn cache clear calls (cache_clear) are added to dblayer_instance_close in "#if defined(_USE_VALGRIND)", which is not defined. To enable the code, the server needs to be rebuilt with defining the macro. This is purely for debugging.
* remove extra format argument; use %lu for size_t printf formatRich Megginson2010-10-141-2/+2
| | | | | | Removed the extra proxydn format argument that was not being used Use %lu for size_t format arguments Reviewed by: nkinder (Thanks!)
* Bug 630092 - Coverity #15490: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+1
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The import_producer() has been modified to release ep when an error occured.
* Bug 630092 - Coverity #15487: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+2
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The index_set_entry_to_fifo() has been modified to release ep when the job is aborted.
* Bug 630092 - Coverity #15484: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+1
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The bulk_import_queue() has been modified to release ep when an error occurs.
* Bug 630097 - (cov#12182,12183) NULL dereference in import codeNathan Kinder2010-09-151-2/+2
| | | | | | The entry pointer that is passed to slapi_entry_attr_find() is dereferenced by that function without a check for NULL. We should check if ep->ep_entry is NULL before calling slapi_entry_attr_find().
* Bug 633168 - Share backend dbEnv with the replication changelogNoriko Hosoi2010-09-131-17/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=633168 Description: * cl5_api.c, cl5_api.h - fetches dbEnv from backend using slapi_back_get_info. - unused macros and DB helper functions and APIs are removed. * cl5_config.c - local changelog DB related config parameters are removed. * Added SLAPI_PLUGIN_BE_PRE_CLOSE_FN and SLAPI_PLUGIN_BE_POST_OPEN_FN to close changelog DB before dbEnv is closed and to open changelog DB after dbEnv is opened, respectively. * Added slapi APIs slapi_back_get_info and slapi_back_set_info to get/set the backend info. * back-ldbm - db2bak[.pl] and bak2db[.pl] backs up and restores the database files including changelog db. - changelog dir is backed up in <backupdir>/.repl_changelog_backup. - underlying implementation ldbm_back_get_info for slapi_back_get_info is added. * Added an upgrade script 81changelog.pl See also: http://directory.fedoraproject.org/wiki/Move_changelog
* Bug 630094 - (cov#15457) Remove deadcode in import codeNathan Kinder2010-09-091-4/+0
| | | | | | | | The skipit variable is set to zero shortly before we check if it is 0 in an if condition. This if block can be removed since it will never be hit. The entry that was being freed in the if block is already removed earlier in the function if skipit was non-0 prior to resetting skipit to 0.
* Bug 630094 - (cov#15456) Remove NULL check for srdn in import codeNathan Kinder2010-09-091-1/+1
| | | | | | | | | | | In the call to slapi_log_error(), we are guaranteed that srdn is NULL if we are checking it for NULL due to the way the conditions are nested. The only time we check if srdn is NULL is if inst is non-NULL, and the if condition guarantees that either inst or srdn are NULL. We can just use the string "srdn" in our log message if inst is non-NULL.
* fix compiler warnings - unused vars/funcs, invalid castsRich Megginson2010-09-011-2/+2
| | | | | | | | | This commit fixes many compiler warnings, mostly for things like unused variables, functions, goto labels. One place was using csngen_free instead of csn_free. A couple of places were using casts incorrectly, and several places needed some casts added. Tested on: RHEL5 x86_64, Fedora 14 x86_64 Reviewed by: nkinder (Thanks!)
* implement slapi_ldap_explode_dn and slapi_ldap_explode_rdnRich Megginson2010-08-311-1/+1
| | | | | | | | | | | | The DS has some problems with the openldap versions of these functions: 1) They are deprecated - should use the str2[r]dn and [r]dn2str and the bv versions of those functions instead 2) They escape utf-8 and other values in the strings - the mozldap functions do not do this 3) They handle double quoted strings, but they remove the quotes - our code expects the quotes to be left in place Until we fix our DN handling, and get rid of the double quoted DNs, we just use the mozldap versions of these functions.
* document slapi wrappers for openldap/mozldap functions that differRich Megginson2010-08-311-2/+0
| | | | | | | There are slapi wrappers that hide differences between the openldap and mozldap ldap and ldif API code. These are now doxygen documented. Reviewed by: nkinder (Thanks!) Platforms tested: Fedora 14 (rawhide)
* openldap - add support for missing controls, add ldif api, fix NSS usageRich Megginson2010-08-311-13/+7
| | | | | | | | | | | Added proxy auth control creation - mozldap has a function to do that but not openldap Do not use mozldap filter create function - just create one using slapi_smprintf Fix usage of TLS/SSL with new NSS functionality Created ldif parse wrapper - changed code to use it Reviewed by: nkinder (Thanks!) Platforms tested: Fedora 14 (rawhide)
* Bug 531642 - EntryUSN: RFE: a configuration option to make entryusn "global"Noriko Hosoi2010-08-311-4/+23
| | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=531642 Resolves: 531642 Fix description: 1. Introduced a config parameter nsslapd-entryusn-global: on|off to enable | disable the global mode. By default, off. In the global mode, search on root dse returns "lastusn: <num>" without the backend subtype (e.g., "lastusn;userroot: <num>") 2. Added slapi_get_next_suffix_ext to mapping_tree.c, which visits children as well as siblings in the mapping tree. (Note: slapi_get_next_suffix does just siblings.) 3. import (ldif2db) adds "entryusn: 0" to every entry unless the entry already contains the entryusn attribute. 4. ldbm_back_delete, ldbm_back_modify, ldbm_back_modrdn: set ldap_result_code to pblock so that bepost plugin could see if the operation was successful or not. See also http://directory.fedoraproject.org/wiki/Entry_USN#Global_mode
* Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues ↵Endi S. Dewata2010-08-231-4/+12
| | | | | | | | | | 12167 - 12199 https://bugzilla.redhat.com/show_bug.cgi?id=610119 Resolves: bug 610119 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199 Fix description: Catch possible NULL pointer in import_producer(), upgradedn_producer(), bulk_import_queue(), and dse_conf_backup_core().
* Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues ↵Noriko Hosoi2010-08-201-4/+8
| | | | | | | | | | 11892 - 11939 https://bugzilla.redhat.com/show_bug.cgi?id=613056 Resolves: bug 613056 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939 description: Catch possible NULL pointer in index_producer() and upgradedn_producer(). coverity ID: 11919
* Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093Endi S. Dewata2010-08-191-5/+16
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=617630 Resolves: bug 617630 Bug description: fix coverify Defect Type: Resource leaks issues CID 12072, 12088, 12089. description: dse_conf_verify_core() has been modified to release estr before continuing the loop. import_worker() has been modified to release substring_key_buffer before returning. upgradedn_producer() has been modified to release the older data.data and ecopy before reallocating the new ones and before returning.
* 616618 - 389 v1.2.5 accepts 2 identical entries with different DN formatsNoriko Hosoi2010-07-221-39/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=616618 Change Description: . renamed 91upgradednformat.pl to 80upgradednformat.pl to run upgradednformat before 90subtreerename.pl. . ported following patches applied to Directory_Server_8_2_Branch to master and 389-ds-base-1.2.6. 612771 - RHDS 8.1/389 v1.2.5 accepts 2 identical entries with different DN formats * commit 50bb2ee6676e10cdda704982dfa831efa4011037 Fix Description: This patch fixes the upgradednformat utility to eliminate the duplicated DNs found in the upgrading period. Assuming DN: attr0=value0,attr1=value1,...,attrn=valuen exists in the DB and another identical DN is found, the second DN is renamed to nsuniqueid=<uuid>+attr0=value0,attr1=value1,...,attrn=valuen , where the <uuid> is the unique id assigned to the entry when the entry is added to the server. The modification is logged in the error log. In addition, there was a bug to handle multi-valued RDNs in slapi_dn_normalize_ext. In case multi-valued RDN appears with DN value (e.g., nsuniqueid=<uuid>+cn=uid\=<uid>\,o\=<org>,dc=<dc>), it was not normalized properly. Introduced second rdn_av_stack (subinitial_rdn_av_stack) for the nested DN value. See also: http://directory.fedoraproject.org/wiki/Upgrade_to_New_DN_Format#Another_Upgrade_Scenario * commit ebaa18adaf201f75c709e078abd8e32605eddb81 Fix Description: 1) In the previous commit 50bb2ee6676e10cdda704982dfa831efa4011037, there were 3 places to miss replacing rdn_av_count with subrdn_av_count. 2) A variable subtypestart is used to keep the head of nested multivalued RDNs. For instance, seeAlso=cn\=<CN>\+l\=<L>\,o\=<O>,dc=examle,dc=com ^ or ^ or ^ There was a bug to set the first position ("cn" in the above example). In addition, fixed a warning assigning "const char *" to "char *" in import_foreman (import-threads.c). * commit 472a2c0f2f21205390ba87c31c498b4419a932ba Fix Description: When newly creating an ancestorid index file, instead of opening the index file with DB_TRUNCATE option, delete the file then create it. 616135 - Upgrade failure on Solaris : tar: db/NetscapeRoot/{DBVERSION,*.db4}: No such file or directory * commit e6723421e6dc69408edb2a396eb22da361cff206 Fix Description: .../'{'DBVERSION,*.db4'}' is not a shell syntax. Process DBVERSION and *.db4 individually. Cherry-picked 700d7c1a199db4a690740636b8bd3e612304ce1e and 0b6ddc9b06845bdf385e749f2c5a99497df20d98 from 389-ds-base-1.2.6 branch.
* 591336 - Implementing upgrade DN format toolNoriko Hosoi2010-05-171-33/+747
| | | | | | | | | | | | | | | | | | | | | | | | | | Change description: . adding upgradednformat utility to each server instance. . adding 91upgradednformat.pl for in-place-upgrade. . implementing ldbm_back_upgradednformat sharing the import/ reincexing codes. . adding a new DBVERSION ID "dn-4514" for the upgraded db. . fixing access logs (delete.c and modify.c) . fixing compiler warnings. . fixing memory leaks. . fixing a bug in syntax plugin to free strings. . adding templates for plugin id, version, vendor, and description, which are needed for the online upgrade. . dbversion_write takes an additional bit flags, which indicates which extra DBVERSION strings are written to the DBVERSION file. It was introduced for the upgrade tools not to intervene each other's tasks (e.g., dn2rdn for converting entrydn to entryrdn and upgradednformat for upgrading the DN format). . fixing a bug in entryrdn index code which was missing to normalize RDN. See also: https://bugzilla.redhat.com/show_bug.cgi?id=591336 http://directory.fedoraproject.org/wiki/Upgrade_to_New_DN_Format#Migration.2FUpgrade
* Update to New DN FormatNoriko Hosoi2010-04-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Description: . adding slapi_dn_normalize_ext and its siblings to normalize/validate invalid DNs; deprecating slapi_dn_normalize and its siblings. (dn.c) . replacing slapi_dn_normalize with new corresponding functions. . normalizing hardcoded DNs (e.g., removing spaces around ',') . setting correct DN syntax to nsslapd-suffix, nsslapd-ldapiautodnsuffix, costemplatedn, nsslapd-changelogsuffix, nsBaseDN, nsBindDN . if nsslapd-dn-validate-strict is enabled, incoming DN is examined and rejected if it is invalid. Once approved, the DN is normalized. . fixing compiler warnings and typos. See also: http://directory.fedoraproject.org/wiki/Upgrade_to_New_DN_Format Related bugs: Bug 199923 - subtree search fails to find items under a db containing special characters Bug 567968 - subtree/user level password policy created using 389-ds-console doesn't work. Bug 570107 - The import of LDIFs with base-64 encoded DNs fails, modrdn with non-ASCII new rdn incorrect Bug 570962 - ns-inactivate.pl does not work Bug 572785 - DN syntax: old style of DN <type>="<DN>",<the_rest> is not correctly normalized Bug 573060 - DN normalizer: ESC HEX HEX is not normalized Bug 574167 - An escaped space at the end of the RDN value is not handled correctly
* 570107 - The import of LDIFs with base-64 encoded DNs fails,Noriko Hosoi2010-03-111-2/+4
| | | | | | | | | | | modrdn with non-ASCII new rdn incorrect https://bugzilla.redhat.com/show_bug.cgi?id=570107 Description: When getting the DN value from the raw ldif file, it was strictly checking "dn: ", which was incomplete. We should have checked "dn:: " for the Base64 encoded DN. This patch is adding the case.
* cleanup build warningsRich Megginson2010-03-081-3/+3
| | | | | | This patch cleans up various build warnings found by compiling the code with -Wall on RHEL5. Reviewed by: nhosoi (Thanks!)
* fix various memory leaksRich Megginson2010-03-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: nhosoi (Thanks!) var/tmp/run_gssapi.vg.25032:Memory leak: 99 bytes duplicates: 5 > malloc() at vg_replace_malloc.c:207 > strdup() at /lib/libc-2.10.2.so > slapi_ch_strdup() at ch_malloc.c:277 > ids_sasl_check_bind() at saslbind.c:924 > do_bind() at bind.c:382 > connection_threadmain() at connection.c:554 > --unknown-- at /lib/libnspr4.so > start_thread() at /lib/libpthread-2.10.2.so > clone() at /lib/libc-2.10.2.so The problem is that ids_sasl_check_bind can reset SLAPI_BIND_TARGET to a malloc'd value. The do_bind() code should check for this condition and free it. var/tmp/entryusn.vg.5997:Memory leak: 8 bytes duplicates: 8 > calloc() at vg_replace_malloc.c:397 > slapi_ch_calloc() at ch_malloc.c:243 > slapi_counter_new() at slapi_counter.c:95 > ldbm_usn_init() at ldbm_usn.c:86 > ldbm_back_start() at start.c:223 > plugin_call_func() at plugin.c:1417 > plugin_dependency_startall.clone.0() at plugin.c:1385 > main() at main.c:1138 The backend cleanup code should free be_usn_counter. var/tmp/ipv6.vg.15561:Memory leak: 13 bytes duplicates: 3 > malloc() at vg_replace_malloc.c:207 > strdup() at /lib/libc-2.10.2.so > slapi_ch_strdup() at ch_malloc.c:277 > config_get_listenhost() at libglobs.c:3674 > main() at main.c:874 var/tmp/ipv6.vg.15561:Memory leak: 13 bytes duplicates: 3 > malloc() at vg_replace_malloc.c:207 > strdup() at /lib/libc-2.10.2.so > slapi_ch_strdup() at ch_malloc.c:277 > config_get_securelistenhost() at libglobs.c:3686 > main() at main.c:881 config_get_listenhost() and config_get_securelistenhost() return malloc'd memory which must be freed. var/tmp/dna_scen1.vg.4901:Memory leak: 248 bytes duplicates: 1 > malloc() at vg_replace_malloc.c:207 > nslberi_malloc() at io.c:1677 > ber_flatten() at io.c:1604 > create_NSDS50ReplicationExtopPayload() at repl_extop.c:218 > NSDS50EndReplicationRequest_new() at repl_extop.c:265 > release_replica() at repl5_protocol_util.c:469 > repl5_inc_run() at repl5_inc_protocol.c:1187 > prot_thread_main() at repl5_protocol.c:341 > --unknown-- at /lib/libnspr4.so > start_thread() at /lib/libpthread-2.10.2.so > clone() at /lib/libc-2.10.2.so The payload was not being freed under all function exit conditions. So, just free it immediately after use. var/tmp/dnarun.vg.2491:Memory leak: 27 bytes duplicates: 0 > malloc() at vg_replace_malloc.c:207 > slapi_ch_malloc() at ch_malloc.c:155 > slapi_entry_attr_get_charptr() at entry.c:2432 > dna_parse_config_entry() at dna.c:816 > dna_pre_op() at dna.c:2587 > plugin_call_func() at plugin.c:1417 > plugin_call_plugins() at plugin.c:1379 > op_shared_add() at add.c:606 > do_add() at add.c:232 > connection_threadmain() at connection.c:564 > --unknown-- at /lib/libnspr4.so > start_thread() at /lib/libpthread-2.10.2.so > clone() at /lib/libc-2.10.2.so The value was not being freed under all conditions. ==9877== 1,890 (252 direct, 1,638 indirect) bytes in 3 blocks are definitely lost in loss record 1,628 of 1,725 ==9877== at 0x47E0E5C: calloc (vg_replace_malloc.c:397) ==9877== by 0x4819D89: slapi_ch_calloc (ch_malloc.c:243) ==9877== by 0x48284A6: slapi_entry_alloc (entry.c:1686) ==9877== by 0x4829BA5: str2entry_dupcheck (entry.c:631) ==9877== by 0x482BB5D: slapi_str2entry_ext (entry.c:1194) ==9877== by 0xB2A8E9D: import_producer (import-threads.c:541) ==9877== by 0x72E1990: (within /lib/libnspr4.so) ==9877== by 0x731E8F4: start_thread (in /lib/libpthread-2.10.2.so) ==9877== by 0x75B2FCD: clone (in /lib/libc-2.10.2.so) Make sure the entry or backentry are freed.
* Allow modrdn to move subtree and rename non-leaf nodeNoriko Hosoi2010-01-221-296/+615
| | | | | | | | | | | | | | | | | | | | | | | | | This patch includes - replacing the entrydn index with the entryrdn index - replacing a full DN in each entry in the DB with an RDN - extending Slapi_Entry, entry2str, and str2entry to absorb the changes made on the entry - adding DN/RDN helper functions - adding DN cache - adding a utility and a migration script to convert the DN format database to the RDN format - extending a database dump utility dbscan to support the entryrdn - slapi_dn_syntax_check by nkinder@redhat.com is added to check the dn before modify operations - big fix for 171338 - Enhancement: winsync modrdn not synced In addition to the above, compile warnings and memory leaks found in testing the new feature are fixed. For more details, see the feature design document at: http://directory.fedoraproject.org/wiki/Subtree_Rename and bugzilla at: https://bugzilla.redhat.com/show_bug.cgi?id=171338
* 525007 ldif2db replaces existing modify/create name and timestampsNoriko Hosoi2009-09-251-7/+12
| | | | | | | | | | | | | | | | | | | | | Fix contributed by Ulf Weltman (ulf.weltman@hp.com) Description From Ulf Weltman (ulf.weltman@hp.com) In previous releases, if LDIF being imported contained createTimestamp, creatorsName, modifyTimestamp, or modifiersName, those values would be kept in the imported entries. BZ# 462922 added code to insert those attributes during import but it clobbers any values existing in the LDIF being imported. I think the imported values should take precedence, this would be useful during migration for example. If anyone wants to take advantage of the new behavior where the server provisions new values, they can strip out the values from the LDIF before importing or they can set nsslapd-exclude-from-export to not export those attributes before importing. See also https://bugzilla.redhat.com/show_bug.cgi?id=525007 Reviewed by richm, nkinder, and nhosoi
* 509472 db2index all does not reindex all the db backends correctlyNoriko Hosoi2009-08-061-16/+21
| | | | | | | | | | | | | | | | | | | | db2index all (internally, called upgradedb) reads through the main db id2entry.db# and reindex all the associated indexed attributes. The reindex borrows the import code where the entry id is newly assigned. The new entry id's are connective. On the other hand, entry id's of the entries in the db to be reindexed are not. The borrowed import code assumes the entry id and the index of the fifo are tightly coupled and the timing when the writing to and reading from the fifo are calculated based upon the assumption. The assumption should have been revised so that the entry id which is available up to is kept in ready_EID in the job structure and entry id from each entry (entry->ep_id) is compared with ready_EID instead of ready_ID that holds the sequential number. Additionally, I eliminated unused variable "shift" from import_fifo_fetch. Also, _dblayer_delete_instance_dir cleans up files and directories, recursively.
* Skip syntax check of encrypted attributes during import.Nathan Kinder2009-07-201-1/+44
| | | | | | | | When importing an ldif with pre-encrypted attributes, we need to skip the syntax check to avoid the import of those entries being skipped. The fix makes a copy of an entry with encrypted attributes, removes the encrypted attribtues, and uses this trimmed copy for the syntax check.
* OpenLDAP supportcleanupRich Megginson2009-07-071-0/+4
| | | | | | | | | | These changes allow the server to be built with OpenLDAP (2.4.17+). A brief summary of the changes: * #defines not provided by OpenLDAP were copied into slapi-plugin.h and protected with #ifndef blocks * where it made sense, I created slapi wrapper functions for things like URL and LDIF processing to abstract way the differences in the APIs * I created a new file utf8.c which contains the UTF8 functions from MozLDAP - this is only compiled when using OpenLDAP * I tried to clean up the code - use the _ext versions of LDAP functions everywhere since the older versions should be considered deprecated * I removed some unused code NOTE that this should still be considered a work in progress since it depends on functionality not yet present in a released version of OpenLDAP, for NSS crypto and for the LDIF public API.
* Added capability to validate syntax of values being added to the database. ↵Nathan Kinder2009-05-081-2/+20
| | | | | | Also added numericstring syntax support. For more details, see the design doc at http://directory.fedoraproject.org/wiki/Syntax_Validation_Design
* Resolves: bug 486400Nathan Kinder2009-03-031-2/+2
| | | | | | | | | | | | | | | Bug Description: During migration, if import fails for some reason, the exact cause of why it was unable to open the LDIF is not logged. Reviewed by: nhosoi (thanks!) Files: see diff Branch: HEAD Fix Description: As discussed in the bug council, the fix is to just report the actual error returned when the open() of the LDIF fails. This reports the errno and a string description of the error in the errors log (which is also output to stderr when running ldif2db). Platforms tested: F9 Flag Day: no Doc impact: no
* Resolves: 454348Nathan Kinder2008-11-211-5/+31
| | | | Summary: Index nscpEntryDN attribute when importing tombstones.
* Resolves: #462922Noriko Hosoi2008-11-041-0/+44
| | | | | | | | Summary: Import of data does not record timestamps Description: Added a static function import_add_created_attrs to add ModifiersName, CreateTimestamp, ModifyTimestamp to each imported entry. I also added a check if nsslapd-lastmod is on or off. It adds the created info only if the lastmod is on.
* Resolves: bug 454030Rich Megginson2008-10-171-12/+5
| | | | | | | | | | | Bug Description: Need to address 64-bit compiler warnings Fix Description: As it turns out, there is no portable format specifier for size_t that works on all of our supported platforms. Afaict, %lu should work everywhere. C99 uses the "z" specifier, but alas not all of the compilers we use support C99 and/or "z". Platforms tested: RHEL5, Solaris Flag Day: no Doc impact: no
* Resolves: #466702Noriko Hosoi2008-10-151-2/+2
| | | | | Summary: Memory usage research: checking in the experimental code See also: http://directory.fedoraproject.org/wiki/Memory_Usage_Research
* Bug Description: Need to address 64-bit compiler warnings - part 1Rich Megginson2008-10-081-9/+17
| | | | | | | | | | | | | | | | | | | | | Reviewed by: nhosoi (Thanks!) Fix Description: The intptr_t and uintptr_t are types which are defined as integer types that are the same size as the pointer (void *) type. On the platforms we currently support, this is the same as long and unsigned long, respectively (ILP32 and LP64). However, intptr_t and uintptr_t are more portable. These can be used to assign a value passed as a void * to get an integer value, then "cast down" to an int or PRBool, and vice versa. This seems to be a common idiom in other applications where values must be passed as void *. For the printf/scanf formats, there is a standard header called inttypes.h which defines formats to use for various 64 bit quantities, so that you don't need to figure out if you have to use %lld or %ld for a 64-bit value - you just use PRId64 which is set to the correct value. I also assumed that size_t is defined as the same size as a pointer so I used the PRIuPTR format macro for size_t. I removed many unused variables and some unused functions. I put parentheses around assignments in conditional expressions to tell the compiler not to complain about them. I cleaned up some #defines that were defined more than once. I commented out some unused goto labels. Some of our header files shared among several source files define static variables. I made it so that those variables are not defined unless a macro is set in the source file. This avoids a lot of unused variable warnings. I added some return values to functions that were declared as returning a value but did not return a value. In all of these cases no one was checking the return value anyway. I put explicit parentheses around cases like this: expr || expr && expr - the && has greater precedence than the ||. The compiler complains because it wants you to make sure you mean expr || (expr && expr), not (expr || expr) && expr. I cleaned up several places where the compiler was complaining about possible use of uninitialized variables. There are still a lot of these cases remaining. There are a lot of warnings like this: lib/ldaputil/certmap.c:1279: warning: dereferencing type-punned pointer will break strict-aliasing rules These are due to our use of void ** to pass in addresses of addresses of structures. Many of these are calls to slapi_ch_free, but many are not - they are cases where we do not know what the type is going to be and may have to cast and modify the structure or pointer. I started replacing the calls to slapi_ch_free with slapi_ch_free_string, but there are many many more that need to be fixed. The dblayer code also contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=463991 - instead of checking for dbenv->foo_handle to see if a db "feature" is enabled, instead check the flags passed to open the dbenv. This works for bdb 4.2 through bdb 4.7 and probably other releases as well. Platforms tested: RHEL5 x86_64, Fedora 8 i386 Flag Day: no Doc impact: no
* Resolves: 429793Nathan Kinder2008-01-251-34/+22
| | | | Summary: Fixed crash in replication during bulk import. Use bulk impport code more consistently.
* Resolves: 429799Nathan Kinder2008-01-241-1/+1
| | | | Summary: Allow import fifo to clear out all finished entries.
* Resolves: #243488Noriko Hosoi2007-06-111-6/+1
| | | | | | | | Summary: Use mozldap6 ldif_parse_line API Changes: 1) Removed ldif.h from the DS tree. 2) Eliminated the 5-th arg of ldif_parse_line (errmsg) and the errmsg related code.
* Resolves: #214533Noriko Hosoi2006-11-101-0/+5
| | | | | | | | | | Summary: configure needs to support --with-fhs (Comment #6) Changes: Added the following include next to the end of the copyright block. + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif +
* Resolves: #214728Noriko Hosoi2006-11-101-6/+0
| | | | | Summary: Cleaning up obsolete macros in the build Changes: eliminated macro UPGRADEDB (Comment #6)
* Resolves: #199923Noriko Hosoi2006-11-061-2/+2
| | | | | Summary: subtree search fails to find items under a db containing special characters (Comment#16) Description: When dn contains rdn which includes '\\', it was escaped twice to generate a key for entrydn and caused mismatch in forming ancestorid index. It ends up the subtree search fail.
* [175063] entry with escaped characters fails to import and indexNoriko Hosoi2005-12-061-5/+7
| | | | | If missing entry_id is found, skip it and continue reading the primary db to be reindexed.
* 156273Rob Crittenden2005-04-281-1/+1
| | | | Convert to C-style comments to avoid build breakage.
* Fixed licensing typoNathan Kinder2005-04-191-1/+3
|
* 155068 - Added license to source filesNathan Kinder2005-04-151-0/+30
|
* Merge over new code: fractional replication, wan replication and windows ↵David Boreham2005-03-111-3/+11
| | | | sync plus associated UI
* clean up sprintf usage and many other flawfinder issues; clean up compiler ↵Rich Megginson2005-03-051-23/+9
| | | | warnings on Linux; remove pam_passthru from DS 7.1
* 149951 - Updated source code copyrightsNathan Kinder2005-02-281-2/+2
|
* Add support for filesystem-based replica initialization.David Boreham2005-01-281-6/+56
|
* Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. ↵ldapserver7xcvsadm2005-01-211-0/+1992
(foxworth)