Commit Graph

189 Commits

Author SHA1 Message Date
Howard Chu
975a5e9a24 Added dnPretty2/dnNormalize2 using preallocated destination berval 2001-12-29 04:48:00 +00:00
Pierangelo Masarati
c8335e7d14 strengthen previous commit 2001-12-28 15:56:18 +00:00
Pierangelo Masarati
9dab474fa4 fix realloc bug 2001-12-28 15:28:10 +00:00
Pierangelo Masarati
cd8eb327d6 more exploitation of efficient parsing 2001-12-28 15:13:16 +00:00
Pierangelo Masarati
2f3f7c6765 ldap_str2rdn() can parse without allocating a LDAPRDN* (not very clean, though); used by dn_rdnlen 2001-12-28 12:50:48 +00:00
Howard Chu
65636e0855 Changed dnExtractRdn to use a provided berval instead of allocating one.
Use ldap_dn2bv and ldap_rdn2bv instead of the *2str versions.
2001-12-28 10:04:53 +00:00
Howard Chu
d6a37432bd Changed dn_rdn/dn_rdnlen to struct berval 2001-12-28 08:38:24 +00:00
Howard Chu
292c575c1f Added dnPrettyNormal, do both Pretty and Normalize at once to save
some ldap_str2dn overhead.
2001-12-28 07:27:15 +00:00
Kurt Zeilenga
cefce9c965 dnExtractRDN should take a struct berval DN. 2001-12-27 17:17:01 +00:00
Pierangelo Masarati
70e7d58c7d small improvement and prototyping 2001-12-27 15:15:30 +00:00
Kurt Zeilenga
cddf7e0e00 More struct berval DN changes
decrease dependency on dn_validate/dn_normalize
2001-12-27 07:13:13 +00:00
Howard Chu
3e826ae1c7 More struct berval fixes for modrdn 2001-12-27 00:58:14 +00:00
Howard Chu
bbcb0f8a7f Replace strcat with slap_strcopy 2001-12-26 16:25:18 +00:00
Kurt Zeilenga
f443af5a57 Remove unneeded cheats. hyc found/fixed my bug (in slap.h) 2001-12-24 20:42:05 +00:00
Kurt Zeilenga
5ccff70aa3 update comment
make tests (0-4) now works! (w/ dnNormalize/dnMatch cheats)
2001-12-24 20:29:59 +00:00
Kurt Zeilenga
b735ca3237 Add some cheats to dnNormalize and dnMatch to workaround
ava normalization issues.
2001-12-24 20:07:19 +00:00
Pierangelo Masarati
cbe43a8540 more re-engineering; now rdn_attrs() and so are written in terms of ldap_str2rdn; some functions are deprecated 2001-12-24 18:42:51 +00:00
Kurt Zeilenga
d047cc854e Require the struct berval **out argument of dnPretty/dnNormalize
point to a NULL pointer, that is assert( *out == NULL ).
Eventually, we'll allow **out to point to a preallocated
struct berval (to avoid unnecessary allocation).
2001-12-24 18:38:20 +00:00
Kurt Zeilenga
f6085d3f82 Every quick mod to use a struct berval for e_dn/e_ndn. No bv_len yet. 2001-12-24 16:53:47 +00:00
Pierangelo Masarati
7bf6ec940b re-engineered some dn related functions with ldap_dn* functions; helpers should be used instead of deprecated functions in code 2001-12-24 15:48:35 +00:00
Kurt Zeilenga
d0abe6f59f Misc DN cleanup, no functional changes 2001-12-24 06:00:02 +00:00
Kurt Zeilenga
e701812f27 Make note of deprecated DN routines. Need to write
"struct berval" versions
2001-12-24 04:39:15 +00:00
Kurt Zeilenga
9d56c59d1b Minor cleanup, rename ldapava_free_*() routines and
don't expose symbols of ava helper routines
2001-12-23 22:46:37 +00:00
Kurt Zeilenga
7a6e80cdcd Zap dn_match(), cleanup up prototype header 2001-12-23 20:23:15 +00:00
Kurt Zeilenga
50d57151a7 Move dnValidate, dnNormalize, dnPretty to dn.c 2001-12-23 01:19:46 +00:00
Kurt Zeilenga
0c28b66a75 use dnPretty instead of dn_pretty 2001-12-23 00:43:57 +00:00
Pierangelo Masarati
cea4556910 allow empty suffix 2001-12-12 07:56:17 +00:00
Pierangelo Masarati
7330016026 strengthen dn_issuffix 2001-12-11 12:36:54 +00:00
Howard Chu
ebadb3737f Added dn_issuffixbv() like dn_issuffix, but with bervals. 2001-12-09 03:02:29 +00:00
Howard Chu
fd93e0721b Cleanup previous commit 2001-12-08 11:15:55 +00:00
Howard Chu
ad9d17d537 Added dn_rdnlen. Fixed rdn leak in limits.c. 2001-12-08 11:08:26 +00:00
Howard Chu
e2c2de11c3 Converted all use of dn_parent to the in-place version. (Fixed a pdn leak
in back-sql along the way.)
2001-12-08 10:37:42 +00:00
Howard Chu
3fce8e0e80 Turned dn_parent into dn_parent1, returning in-place pointer. Made
dn_parent return ch_strdup of dn_parent1 for compatibility.
2001-12-08 08:41:39 +00:00
Kurt Zeilenga
ea8f7aaab3 Pretty the entry DNs on add but not rename (yet). 2001-12-08 06:57:06 +00:00
Pierangelo Masarati
379e0e9d50 another step towards schema aware normalization: ava sorting in rdns; now by defining USE_LDAP_DN_PARSING both the new dn parsing and the server side normalization is used. There might be, every now and then, a flaw mostly due to naive normalization of pseudo-dn (thinking about some acl/regex stuff and so) 2001-12-05 19:26:30 +00:00
Pierangelo Masarati
09626cc1d5 of course we don't need debug stuff any more ... :) 2001-12-04 20:27:26 +00:00
Pierangelo Masarati
9004262d95 reimplement dn_validate/normalize/(match) using the ldap_str2dn/dn2str stuff; need to #define USE_LDAP_DN_PARSING 2001-12-04 20:22:26 +00:00
Kurt Zeilenga
b5504a1c36 Clean up some misplaced 'extern' declarations (should be headers) 2001-12-04 19:57:09 +00:00
Pierangelo Masarati
aee3600276 minor cleanup 2001-11-17 16:18:07 +00:00
Kurt Zeilenga
7000f3e8cb Zap old DN code 2001-07-21 23:45:04 +00:00
Kurt Zeilenga
5cb6b1ce02 Back out DN changes, needs more work 2001-07-21 22:44:55 +00:00
Pierangelo Masarati
a453d7eacf dn_validate/dn_normalize has been rewritten by
David A. Cooper <david.cooper@nist.gov> (ITS#1232)
according to draft-ietf-ldapbis-dn-05.txt

A copyright statement follows:

  The functions normalize_unicode(), get_hexpair(), write_hex_pair(),
  get_next_byte(), get_next_char(), get_ber_length(),
  ber_parse_primitive_string(), ber_parse_string(), String_normalize(),
  DirectoryString_normalize(), PrintableString_normalize(),
  IA5String_normalize(), ber_parse_primitive_bitstring(),
  ber_parse_bitstring(), getNext8bits(), bitString_normalize(), match_oid(),
  match_key(), get_validated_av_in_dn(), get_validated_rdn_in_dn(),
  and get_validated_dn() in this file were developed at the National Institute
  of Standards and Technology by employees of the Federal Government in the
  course of their official duties. Pursuant to title 17 Section 105 of the
  United States Code the code in these functions is not subject to copyright
  protection and is in the public domain. The copyright for all other code in
  this file is as specified below.
2001-07-13 08:21:14 +00:00
Pierangelo Masarati
27e5c484e6 reworked rdn_attrs to use ldap_explode_rdn; maybe we should remove escapes "\" from parts directly in ldap_explode_rdn 2001-07-10 18:19:22 +00:00
Pierangelo Masarati
38ce12a6f6 added rdn_attrs: parses a rdn and returns types and values in two arrays (honors '+' separator according to RFC 2253) 2001-07-06 12:22:01 +00:00
Pierangelo Masarati
901ce99dde added a comment to rdn_validate: needs to be rewritten according to dn_validate 2001-07-05 20:33:15 +00:00
Pierangelo Masarati
cd74b62fd2 rdn check to prevent illegal rdns in modrdn (copied from dn_rdn) fixes ITS#1102 2001-07-05 08:40:40 +00:00
Stig Venaas
b371357c13 Made dnNormalize() do Unicode normalization and case folding.
dn_normalize() now uses dnNormalize() and fails if normalized string is
longer than original string.
2001-01-25 16:51:59 +00:00
Gary Williams
f49fd8a98e fix format 2001-01-17 16:35:53 +00:00
Gary Williams
ffcdc6d11d More new logging (Behind NEW_LOGGING) 2001-01-15 19:17:29 +00:00
Kurt Zeilenga
5935a11c8e Set UTF8DN by default 2000-10-30 20:05:41 +00:00
Stig Venaas
a8985a440b Use the macro UTF8DN to set whether new UTF8 dn_normalize() code should
be used.
2000-10-30 20:00:56 +00:00
Stig Venaas
fdbd1ded93 Short term dn_normalize() fix. Uppercases all UTF8 characters as long
as the character byte length is preserved. Change #if 1 to use.
2000-10-28 23:38:14 +00:00
Kurt Zeilenga
38cf4a1d82 Add better space compression 2000-10-21 03:27:41 +00:00
Kurt Zeilenga
ce382475f0 misc cleanup 2000-09-29 02:50:34 +00:00
Kurt Zeilenga
b7d1b10bca Minor cleanup 2000-06-14 21:11:56 +00:00
Mark Valence
d91dba4ad0 Bug fix in dn_rdn when dn string begins with whitespace. 2000-06-14 03:59:19 +00:00
Kurt Zeilenga
1aa4b07c98 Remove support for DNS DNs (not to be confused with X.500 DN using
domainComponents (DC)).
2000-06-05 20:07:02 +00:00
Kurt Zeilenga
60802201e3 Const'ification
SASL mech removed from backend bind callback (as SASL is managed by frontend)
Changes to some backends are untested (as I don't have all dependent
  software install)
2000-05-22 03:46:57 +00:00
Kurt Zeilenga
4bc786f34b Y2k copyright update 2000-05-13 02:47:56 +00:00
Kurt Zeilenga
0dbaf87730 Another round of changes behind -DSLAPD_SCHEMA_NOT_COMPAT
plus these changes unhidden changes:
	remove now meaning --enable-discreteaci configure option
	fix ITS#451, slapd filters
	Add ber_bvecadd() to support above
	constify ldap_pvt_find_wildcard() and misc slapd routines
	renamed some slap.h macros
	likely broken something
2000-02-14 20:57:34 +00:00
Kurt Zeilenga
4bdd788c68 Move uppercase comment to be next to uppercasing code. 2000-01-25 00:49:14 +00:00
Kurt Zeilenga
da93ca8c5e Remove DNS_DN experimental code. 1999-12-18 19:54:22 +00:00
Kurt Zeilenga
7a0b0b2bbf In preparation for adding dn_rewrite()...
s/dn_normalize/dn_validate/
s/dn_normalize_case/dn_normalize/
1999-09-24 01:46:37 +00:00
Kurt Zeilenga
403f4479bc Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers.
Replace old Id as needed (back-tcl).
Leave updating of contribWare to contributors (for now).
1999-09-08 19:06:24 +00:00
Kurt Zeilenga
5c63fd55b5 Implement ldap_dn_normalize and friends. Should be used by clients
to validate input dn's BEFORE sending dn's to server.
Also fixed getfilter to use REG_EXTENDED|REG_NOSUB.  (and fixed one
case where REG_BASIC was still used).
s/strdup/LDAP_STRDUP/
Added ldap_pvt_str2lower/upper
1999-08-25 06:44:08 +00:00
Kurt Zeilenga
2a74677799 const'fication 1999-08-20 19:00:44 +00:00
Kurt Zeilenga
397294fc40 Add dn_subtree() (used for subtree index generation) 1999-08-12 04:20:32 +00:00
Kurt Zeilenga
1ffe5122b7 Implement DN_PARENT_PREFIX and framework for DN_SUBTREE_PREFIX. 1999-08-11 20:59:28 +00:00
Kurt Zeilenga
9c3ed0310b Add copyright notices. 1999-08-06 23:07:46 +00:00
Kurt Zeilenga
c9778dd116 Implement better DN checking... make sure attribute type is
an OID or a proper type string (letter followed by 0 or more
alnum/-).
1999-07-22 19:06:56 +00:00
Kurt Zeilenga
68d561a97b Add limited LDAP_INVALID_DN_SYNTAX support. dn_normalize{,_case}() now returns
NULL does not meet basic syntax rules.
1999-07-22 17:14:42 +00:00
Kurt Zeilenga
933908f72f ACL CHANGES:
by <who> <access> changed to by <who>+ <access> (joined with AND)
  added peername=<regex> sockname=<regex> url=<regex>
  removed addr=<regex> (use peername instead).
replace dn_upcase with str2upper and str2lower.  Use where needed.
1999-07-21 20:54:23 +00:00
Kurt Zeilenga
9b8a5036dd Update back-passwd based on patches from howard.chu@platinum.com.
Modified by me to dn_*() and attr_*() functions and to use
uidObject and to handle search scopes better.  Could use some
more work.  A fun project for anyone wanting to learn how
backends work.
Modified dn_parent and dn_rdn to accept be=NULL (to bypass
be_issuffix check).  These functions should be generalized
and moved to -lldap.  A project for another day.
1999-04-29 06:50:00 +00:00
Hallvard Furuseth
815a62930c UNDO LAST COMMIT. 1999-04-02 03:45:33 +00:00
Hallvard Furuseth
45118be88e Fix wait4child change: Prefer wait3 over wait. Use SIGNAL instead of signal. 1999-04-02 03:23:20 +00:00
Juan Gomez
90ebcb8bd9 Added support for newSuperior. 1999-03-24 21:45:15 +00:00
Juan Gomez
dccfdb97e9 Added a new function: build_new_dn(), which builds new dn for entries
being renamed through modrdn/moddn. This in preparation to add support
for MODDN v3.
1999-03-24 20:26:43 +00:00
Hallvard Furuseth
5ef648a109 Silence warnings: Remove unused variables. Enclose some initializers in in {}. 1999-03-09 07:15:35 +00:00
Juan Gomez
943cfaf41a Added get_next_substring(), rdn_attr_type(), and rdn_attr_value() which
are needed in the implementation of modrdn v3.
1999-03-04 00:31:19 +00:00
Hallvard Furuseth
73db912500 Cast char' arguments to ctype.h functions to unsigned char'.
These functions require their arguments to be in the range of `unsigned char'.
1999-02-22 17:57:22 +00:00
Kurt Zeilenga
91f6792109 Add dn_rdn() function to return rdn part of dn. 1999-01-28 21:40:04 +00:00
Kurt Zeilenga
29b1e1f0ba dn_parent(" ") should be NULL. 1999-01-23 19:34:02 +00:00
Kurt Zeilenga
f9b416ea7c ndn & strcasecmp cleanup 1999-01-20 03:05:35 +00:00
Kurt Zeilenga
0daa8c1f06 Recode suffixAlias to implement simple check to see if part to aliased
is at a DNSEPARATOR.  Moved DNSEPARATOR macro from dn.c to slap.h
1999-01-19 19:26:09 +00:00
Kurt Zeilenga
e2ee741ea8 Replace strdup() with ch_strdup() such that exit() will be called
if strdup fails.  This is better than not checking, but we should
add orderly shutdown.
1998-11-27 20:21:54 +00:00
Hallvard Furuseth
7e6ad5100c Protoized, moved extern definitions to .h files, fixed related bugs.
Most function and variable definitions are now preceded by its extern
definition, for error checking.  Retyped a number of functions, usually
to return void.  Fixed a number of printf format errors.

API changes (in ldap/include):
  Added avl_dup_ok, avl_prefixapply, removed ber_fatten (probably typo
  for ber_flatten), retyped ldap_sort_strcasecmp, grew lutil.h.

A number of `extern' declarations are left (some added by protoize), to
be cleaned away later.  Mostly strdup(), strcasecmp(), mktemp(), optind,
optarg, errno.
1998-11-15 22:40:11 +00:00
Kurt Zeilenga
2a869f5a99 merged with autoconf branch 1998-10-25 01:41:42 +00:00
Kurt Zeilenga
dfeabf5213 Fixes from Allan Lynne 1998-08-18 17:51:53 +00:00
Kurt Zeilenga
42e0d83cb3 Initial revision 1998-08-09 00:43:13 +00:00