Commit Graph

102 Commits

Author SHA1 Message Date
Pierangelo Masarati
260fd357df fix structuralObjectClass modification (glue, ITS#5921; w/ relax, ITS#5792) 2009-02-04 22:36:49 +00:00
Kurt Zeilenga
4af9eb9715 Update copyright notices 2009-01-22 00:40:04 +00:00
Hallvard Furuseth
587d928552 reformat 2008-11-14 18:19:19 +00:00
Hallvard Furuseth
355c94ddb7 ITS#5329: back-ldif deadlock with access controls 2008-11-14 18:15:35 +00:00
Hallvard Furuseth
d756699af6 ITS#5319 - support rename to same DN. 2008-11-12 00:20:48 +00:00
Hallvard Furuseth
9f55af00ce ITS#5408 part 11 - notice Abandon. 2008-11-12 00:11:53 +00:00
Hallvard Furuseth
2d1af3f2f7 ITS#5408 part 10 - errors from search and slapcat.
- Tweak error code/message for absent directory, including database directory.
- Catch closedir() error.
- ldif_tool_entry_close(): Free entries and reset entry list.
- Propagate any error to slapcat & co.
2008-11-12 00:10:01 +00:00
Hallvard Furuseth
c765070bf0 ITS#5408 part 9 - Sorted RDNs.
- Parse sorted attrs more carefully:
  Accept only attr={num}val.ldif and attr=val{num}.ldif and only base 10.
  Sort "attr=foo" before "attr=foo{n}".  Truncate at ".ldif" while sorting.
- Make the sort order independent of the LDIF files' order in the directory.
2008-11-12 00:03:55 +00:00
Hallvard Furuseth
32bc29d1af ITS#5408 part 8 - Rewrite search API, structs bvlist/enumCookie/ldif_tool.
r_enum_search() -> ldif_send_entry() + ldif_readdir() + ldif_search_entry().
enum_tree() -> search_tree().  fullpath() -> fullpath_alloc() + FILL_PATH().
No functionality change except catching malloc and opendir() errors.
2008-11-11 23:59:43 +00:00
Hallvard Furuseth
7c3cba840c ITS#5408 part 7 - Search operation bugs in r_enum_tree().
- Do not modify op->ors_scope, pass scope parameter instead.
- Save copies of dn/ndn before sending with REP_ENTRY_MODIFIABLE.
- Only the search baseDN may produce noSuchObject.
- More accurate result code.
2008-11-11 23:49:00 +00:00
Hallvard Furuseth
b1aed5b0ab ITS#5408 part 6 - referrals.
- Sending continuation references:
  Drop an unnecessary and wrong LDAP_SCOPE_BASE check.  The correct
  check would have been for DN == baseDN.
  Do not rewrite the scope, the caller already did.
- ldif_prepare_create(): Check that parent/newSuperior is not a referral.
- Rewrite ldif_back_rerferrals().  Better error handling.  Always pass
  refs through referral_rewrite().  As in back-bdb, apply manageDSAit
  only to the baseDN and do not use default_referral.
2008-11-11 23:42:32 +00:00
Hallvard Furuseth
5c41dfdabe ITS#5408 part 5 - handle modrdn file error. Move entry/subtree back if needed.
Add move_dir() macro, matching move_file().
2008-11-11 23:22:24 +00:00
Hallvard Furuseth
a9481e437c ITS#5408 part 4 - preparing for entry creation. More error handling.
- Move mkdir() into ldif_write_entry().  Modrdn lacked this.
- Factor tests for whether to create entry & dir out to ldif_prepare_create().
- Ensure an entry always exists if the corresponding subtree directory does.
- Move get_parent_path() up, accept NULL output param and malloc errors.
2008-11-11 23:16:22 +00:00
Hallvard Furuseth
ddc0613920 ITS#5408 part 3 - file path tweaks, sanity checks.
- Rename temporary filename patterns from "<rdn>.ldifXXXXX" to "<rdn>.XXXXX".
- Add and start using ldif2dir_len() & co.
2008-11-11 23:06:07 +00:00
Hallvard Furuseth
b00aa30d37 ITS#5408 part 2 - filesystem I/O, file error handling:
- Start moving file handling near the top - move_file(), ldif_tempname().
- Rename get_entry_for_fd() -> ldif_read_entry() and move open() into it.
  Rewrite slurp_file() as ldif_read_file(). Just stat() if output param==NULL.
- Rewrite ldif_write_entry(). Add LDAP_DEBUG_TRACE output.
2008-11-11 23:00:18 +00:00
Hallvard Furuseth
69a6d8ca2f ITS#5408 part 1 - error handling, debug output, add error texts (rs->sr_text).
- Reset rs->sr_text on success in apply_modify_to_entry(), not in its callers.
- Fix error test from ldif_write_entry() in ldif_move_entry().
- Start changing LDAP_UNWILLING_TO_PERFORM -> LDAP_OTHER for internal errors.
- Pass around LDAP result codes instead of errno.
- Rename spew_entry() -> ldif_write_entry(), move entry2str_mutex lock into it.
- Some other preparation for upcoming changes.
2008-11-11 22:53:41 +00:00
Howard Chu
66be548b58 ITS#5774 blind fix for Windows, please test 2008-10-29 13:14:10 +00:00
Hallvard Furuseth
742f3a2a2c Warning cleanup: signed meets unsigned. 2008-10-13 14:54:27 +00:00
Hallvard Furuseth
04a7b8bf70 For ITS#5408: Handle special chars in filenames, in particular on Windows.
When upgrading, may need to slapcat/slapadd the database if back-ldif
is used as a general backend with chars like ':' or Windows' special
chars in DNs.
2008-04-16 00:09:25 +00:00
Hallvard Furuseth
66bedd2962 For ITS#5408: Cleanup: No functionality change.
Change dn2path(), get_entry() and move_entry() prototypes/usage.
Remove unused statements/initializations.  get_entry() now returns
a result code, reducing result code handling a bit.
2008-04-15 22:30:40 +00:00
Hallvard Furuseth
e67144ca7c For ITS#5408: back-ldif cannot currently handle multiple database suffixes.
So make olcDbDirectory SINGLE-VALUE and set SLAP_DBFLAG_ONE_SUFFIX.
Take advantage of that in ldif_back_referrals().
2008-04-15 22:22:38 +00:00
Hallvard Furuseth
61140d66a0 ITS#5328:
Do not send errors (other than referral) from ldif_back_referrals().
Return LDAP result code from ldif_back_entry_get().
2008-02-11 21:04:05 +00:00
Kurt Zeilenga
c890c96d13 Happy New Year (belated) 2008-01-08 00:19:56 +00:00
Hallvard Furuseth
d3c90c989c Fix spew_file() comment 2008-01-08 00:02:58 +00:00
Pierangelo Masarati
64c662c5b2 behave when the empty DN is used as database suffix (ITS#5265) 2007-12-11 16:59:40 +00:00
Pierangelo Masarati
4d53c886a8 fix back-ldif delete (ITS#5265) 2007-12-11 15:12:48 +00:00
Pierangelo Masarati
b6508a1066 fix dirsep's in DN (ITS#5172) 2007-10-10 18:50:20 +00:00
Pierangelo Masarati
8f95ff260c consistently use "tag=" instead of "op=" in debug messages 2007-08-25 00:10:52 +00:00
Pierangelo Masarati
ce6b685caf rework previous commit 2007-08-17 09:52:31 +00:00
Pierangelo Masarati
27428ac00e uniformly exploit rootdn bind; add support for rootdn bind to backends that didn't have it (ITS#4962) 2007-08-16 09:38:15 +00:00
Pierangelo Masarati
87f918ebc0 don't dereference save_errnop if NULL; create temporary file in right dir; revert to strtol(3) (ITS#4627) 2007-08-16 09:23:48 +00:00
Howard Chu
c727d5caf7 ITS#4627 fix tool_entry_next 2007-08-15 20:09:06 +00:00
Hallvard Furuseth
8e30e008c6 Fix rev 1.68 spew_entry() for ITS#4627: Do not dereference NULL save_errnop.
Add missing unlink().  Update debug messages, move one from spew_file().
Also check the close() return code.
2007-08-15 19:43:13 +00:00
Howard Chu
b45c15fdc9 TS#4627 fix tool_entry_first() 2007-08-14 18:54:28 +00:00
Pierangelo Masarati
d8f964fb7a fix most of the issues of ITS#4627 2007-08-14 15:54:56 +00:00
Howard Chu
a87b4592a4 Remove tool_id2entry_get 2007-08-11 04:19:53 +00:00
Ralf Haferkamp
3a9310431e Reworked recent backend API changes, now using a separate struct,
(ConfigReply) for the error messages.
2007-08-03 12:02:07 +00:00
Ralf Haferkamp
5ae46c195e Added a new parameter (ConfigArgs*) to the _db_init, _db_open, _db_close and
_db_destroy functions.
2007-07-25 17:21:05 +00:00
Kurt Zeilenga
da6d9eb046 happy new year 2007-01-02 20:00:42 +00:00
Howard Chu
fcc51c0497 Fix modrdn, must also rename the directory if it exists. 2006-12-24 00:54:14 +00:00
Howard Chu
2a9afa55a7 Avoid unnecessary calls to oc_bvfind 2006-11-27 19:59:59 +00:00
Howard Chu
701c39ed83 Tone down enum_tree warning 2006-11-17 22:51:04 +00:00
Kurt Zeilenga
7c68de27c8 Check opattrs add result 2006-09-16 17:20:29 +00:00
Howard Chu
3f4e196beb Portability cleanups 2006-09-14 07:29:46 +00:00
Pierangelo Masarati
1efd2ef101 (almost blind) fix potential strchr() read-past-end of berval 2006-05-26 00:07:55 +00:00
Howard Chu
716df7c62c ITS#4512 fix bogus Debug messages in rev 1.48 2006-04-28 06:22:48 +00:00
Howard Chu
f3ee4f5d30 Fix rev 1.52, frontendDB uses index {-1}. 2006-04-27 23:21:39 +00:00
Howard Chu
e97673df67 ITS#4500 use rdwr lock instead of mutex 2006-04-27 07:52:12 +00:00
Pierangelo Masarati
02b3af0900 check existence of newSuperior 2006-04-25 21:11:44 +00:00
Pierangelo Masarati
54f7d5aef3 allow empty modlist 2006-04-25 19:51:38 +00:00