summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_dn.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-05ldb: make ldb a top level library for Samba 4.0Andrew Bartlett1-2101/+0
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-01-14ldb:ldb_dn.c - fix counter type in "ldb_dn_minimise"Matthias Dieter Wallnöfer1-1/+1
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Fri Jan 14 10:43:29 CET 2011 on sn-devel-104
2011-01-14ldb: added ldb_dn_minimise()Andrew Tridgell1-0/+54
this removes any extraneous components from a DN. For an extended DN, this means removing the string DN and all but the first extended component. This is needed as AD returns "invalid syntax" if you don't use a minimal DN as the base DN for a search. A non-minimal DN also doesn't ever match in a search expression. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14ldb: added ldb_dn_get_extended_comp_num()Andrew Tridgell1-0/+8
this returns the number of extended components. We need this to validate a DN in the extended_dn_in module Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-12ldb:ldb_dn_explode - remove/unify some duplicate initialisationsMatthias Dieter Wallnöfer1-6/+2
2010-12-06s4:fix some shadowed declaration warnings on Solaris by renaming the symbolsMatthias Dieter Wallnöfer1-2/+2
2010-11-18ldb:ldb_dn_explode - point out that on error cases "data" is implicitly free'dMatthias Dieter Wallnöfer1-1/+1
2010-11-17ldb:ldb_dn.c - ldb_dn_explode - free also the extended components on error casesMatthias Dieter Wallnöfer1-1/+4
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Wed Nov 17 08:45:53 UTC 2010 on sn-devel-104
2010-10-16ldb:"ldb_dn_compare_base" - use "unsigned int" countersMatthias Dieter Wallnöfer1-2/+2
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Sat Oct 16 13:54:13 UTC 2010 on sn-devel-104
2010-10-16ldb:"ldb_dn_add_child" - use "unsigned int" countersMatthias Dieter Wallnöfer1-2/+3
2010-10-16ldb:"ldb_dn_remove_base_components" - use an "unsigned int" counterMatthias Dieter Wallnöfer1-6/+6
2010-10-16ldb:"ldb_dn_canonical" - use an "unsigned int" counterMatthias Dieter Wallnöfer1-3/+3
Convert it to use an "unsigned int" counter which represents the exact length of the DN components.
2010-07-29s4-ldb: use TALLOC_CTX type instead of 'void'Kamen Mazdrashki1-14/+14
2010-07-09ldb:common/ldb_dn.c - "ldb_dn_get_parent" - no need to manipulate the real DNMatthias Dieter Wallnöfer1-6/+0
Since the parent DN is a duplication of the passed DN parameter.
2010-06-29s4:ldb - "ldb_dn_update_components" - fix free of invalid DN partsMatthias Dieter Wallnöfer1-4/+3
Use "LDB_FREE" for such free operations and in addition wipe also the casefolded DN out.
2010-06-29ldb:ldb_dn.c - "ldb_dn_set_extended_component" - free the linearized string ↵Matthias Dieter Wallnöfer1-2/+4
when the components change
2010-06-29s4:ldb_dn.c - make the code parts which free extended components consistentMatthias Dieter Wallnöfer1-9/+7
Cosmetic
2010-06-29ldb:ldb_dn - "ldb_dn_explode" - move the "dn->comp_num" initalisation ↵Matthias Dieter Wallnöfer1-3/+3
upwards and use "LDB_FREE" for freeing "dn->components" Mostly cosmetic - no behaviour change
2010-06-19ldb:ldb_dn.c - don't support "ldb_dn_add_child" on a "" parent DNMatthias Dieter Wallnöfer1-0/+7
It's meaningless and could end in DNs as "cn=child,".
2010-05-10s4/dn: handle case 'base' dn has no componentsKamen Mazdrashki1-1/+1
This could if the 'base' dn is special for example.
2010-03-08LDB:common - Change counters to "unsigned" where appropriateMatthias Dieter Wallnöfer1-20/+26
To count LDB objects use variables of type "unsigned (int)" or "long long int" on binary or downto searches. To count characters in strings use "size_t". To calculate differences between pointers use "ptrdiff_t".
2010-03-01s4:LDB - cosmetic fix for a "for" loopMatthias Dieter Wallnöfer1-1/+1
2010-02-26s4:ldb_dn: fix an uninitialized variable (found by make valgrindtest)Stefan Metzmacher1-1/+1
metze
2010-02-26s4:ldb_dn: remove dn->ext_linearized when ext_components is modified.Stefan Metzmacher1-3/+4
metze
2010-02-26s4:ldb_dn: reset dn->ext_comp_num in ldb_dn_explode()Stefan Metzmacher1-2/+2
metze
2010-02-14s4-ldb: use TYPESAFE_QSORT() in the rest of the ldb codeAndrew Tridgell1-2/+2
2010-01-09s4-ldb: validate the type of the ldb argument to ldb_dn_new()Andrew Tridgell1-1/+7
It has been a common bug to get the first two arguments the wrong way around
2009-12-18s4-dsdb: added ldb_dn_update_components()Andrew Tridgell1-0/+23
This is used to udpate just the DN components of a ldb_dn, leaving the other extended fields alone. It is needed to prevent linked attribute updates from removing other extended components. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2009-12-14s4-ldb: added a function to filter extended components of a ldb_dnAndrew Tridgell1-0/+16
We need to be able to filter out components that should not be exposed to users
2009-12-14s4-ldb: sort the linearized extended DN by component nameAndrew Tridgell1-0/+14
This will make life easier when handling deleted linked attributes
2009-12-10s4-ldb: fixed 2 bugs in ldb_dn_set_extended_component()Andrew Tridgell1-2/+5
The first bug was that setting a component twice could cause it to appear twice in the DN. The second bug was that using an existing ldb_val from a previous call of ldb_dn_get_extended_component() as an argument to ldb_dn_set_extended_component() would cause a valgrind error (as the array the val pointed into will change).
2009-12-10s4-ldb: use GUID_to_ndr_blob()Andrew Tridgell1-1/+6
2009-11-13s4-ldb: make DN escaping/unescaping consistentAndrew Tridgell1-20/+54
The DN escape function was using the form \c where c is any character. The unescape function was using \XX where XX is a 2 digit hex number. The asymmetry led to quite a few problems when we start to deal with DNs containing escape chars, such as CN=foo\0ADEL:XXX. The result was a DN that was not accessible. This patch changes the escaping to follow RFC2253 much more closely. We accept either type of escape, and produce the two types of escape, depending on the character being escaped
2009-11-12s4:ldb Don't segfault if we somehow get an unknown extended dn elementAndrew Bartlett1-0/+8
2009-11-12s4:ldb Remove DN+Binary code from the core ldb_dnAndrew Bartlett1-256/+6
This is now in dsdb_dn. Removing this to a specific wrapper avoids a number of bugs where Binary DNs were being handled incorrectly. This reverts much of tridge's commit fd22e0304782e20b9bbb29464b6c745d409ff4c6 Andrew Bartlett
2009-10-27s4-ldb: '+' can also happen in base64 encoded index DNsAndrew Tridgell1-1/+1
2009-10-25s4-ldb: allow for unescaped '=' in a index DNAndrew Tridgell1-0/+13
The ldb_dn_explode code normally enforces all special characters, including a '=', must be escaped. Unfortunately this conflicts with the ltdb index DNs, which for binary attributes may be base64 encoded. This allows a unescaped '=' as a special case for index DNs.
2009-10-21s4-ldb: allow for non-null terminated ldb_val in ldb_dn_from_ldb_valAndrew Tridgell1-1/+1
The strlen() could go past the end of a non-null terminated value
2009-10-15s4-ldb: removed bugus RDN length checkAndrew Tridgell1-5/+0
This isn't the rDN !
2009-10-02s4-ldb: Add support for binary blobs in DNsAndrew Tridgell1-30/+288
AD has the concept of a DN prefixed with B:NN:XXXXXX: that contains a binary blob. We need to support those in order to give correctly formatted binary blobs for things like wellKnownObjects This implementation is not ideal, as it allows for binary blobs on all DNs, whereas it should only allow them on those with a syntax of 2.5.5.7. We should clean this up in the future, but meanwhile this implementation at least gets us a working DC join of w2k8 to s4. This patch also uses a static function for marking DNs as invalid, which is very useful when debugging this code, as you can break on it in gdb.
2009-09-22Move the check above the tallocAnatoliy Atanasov1-5/+6
2009-09-21Add support in the ldb_dn.c code for MS-ADTS:3.1.1.5.1.2 Naming ConstraintsAnatoliy Atanasov1-0/+13
2009-08-30ldb: cosmetic changes in ldb_dnSimo Sorce1-193/+292
- remove trailing spaces and tabs - shorten some variable names for readability - try to break superlong lines for readability
2009-06-01when comp_num is zero, the case folded DN is always ""Andrew Tridgell1-8/+2
This fixes a bug where we would look at an uninitialised dn->linearized
2009-01-30Fix the mess with ldb includes.Simo Sorce1-1/+1
Separate again the public from the private headers. Add a new header specific for modules. Also add service function for modules as now ldb_context and ldb_module are opaque structures for them.
2008-12-19Small cosmetic LDB patch regarding return values.Matthias Dieter Wallnöfer1-2/+2
It changes some "return 0" in "return LDB_SUCCESS"
2008-12-17s4:ldb: add infrastructure for extended dn handlersAndrew Bartlett1-58/+395
This introduces a new set of pluggable syntax, for use on the extended DN, and uses them when parsing the DN. If the DN appears to be in the extended form, we no longer return the full DN 'as is', but only return the normal part from ldb_dn_get_linearized(). When validating/parsing the DN we validate not only the format of the DN, but also the contents of the GUID or SID (to ensure they are plausable). We also have functions to set and get the extended components on the DN. For now, extended_dn_get_linearized() returns a newly constructed and allocated string each time. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-10-30Revert "Length comparison of the linearized version is not correct."Simo Sorce1-0/+3
This reverts commit 753af36a3e194f645ec0b68a033199035e71c909.
2008-10-29Length comparison of the linearized version is not correct.Simo Sorce1-3/+0
The linearized version is not casefolded so length might not match and yet the strings be equivalent. This can happen if one component is case-insensitive and a letter that have an uppercase version of a multibyte character that differ in legth from the corresponding lowercase one.
2008-10-02s4:lib/ldb: fix stupid <SID=...> dn parsing bugsStefan Metzmacher1-2/+2
metze