1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

146 Commits

Author SHA1 Message Date
Andrew Bartlett
a8acaeebb6 ldb: bump version due to header and internal implementation changes
We need this version, not the previous release, for Samba.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jul  3 17:20:32 CEST 2012 on sn-devel-104
2012-07-03 17:20:32 +02:00
Rusty Russell
f3862b9171 ccan: we're subsystems, not a library.
Don't expose a libccan.so; it would produce clashes if someone else
does the same thing.  Unfortunately, if we just change it from a
SAMBA_LIBRARY to a SAMBA_SUBSYSTEM, it doesn't create a static library
as we'd like, but links all the object files in.  This means we get
many duplicates (eg. everyone gets a copy of tally, even though only
ntdb wants it).

So, the solution is twofold:
1) Make the ccan modules separate.
2) Make the ccan modules SAMBA_SUBSYSTEMs not SAMBA_LIBRARYs so we don't
   build shared libraries which we can't share.
3) Make the places which uses ccan explicit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Fri Jun 29 06:22:44 CEST 2012 on sn-devel-104
2012-06-29 06:22:44 +02:00
Andrew Bartlett
46db466372 lib/ldb: Print trace messages for modify correctly 2012-06-27 11:29:17 +02:00
Matthieu Patou
1c850b2f17 ldb: lay foundation for proper utc/generalized time handling
We use to handle UTCtime and generalized time the same way. The thing is
that it's not the case, they are different in the way they are set (most
of the time) with different format and also stored and return in
different format too.
2012-06-22 23:22:03 -07:00
Matthieu Patou
9ebb081cce ldb: add the VERIFY_NAME control 2012-06-22 23:22:02 -07:00
Rusty Russell
df4a6e8228 ldb: use tdb directly, not tdb_compat.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:07 +02:00
Rusty Russell
6244f668a3 TDB2: make SAMBA use tdb1 again for the moment.
Otherwise the following surgery will break the SAMBA build and testsuite.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:05 +02:00
Michael Adam
ff053de096 ldb:tests: fix use of a non-existent word (existant) 2012-06-12 07:21:42 +02:00
Andrew Bartlett
657af5a274 pyldb: Ensure that the ldb argument is really an ldb before we dereference 2012-06-11 11:44:07 +02:00
Stefan Metzmacher
43090fb286 lib/ldb/tools: add missing "replace.h"
This has to be the first header!

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jun 11 01:21:01 CEST 2012 on sn-devel-104
2012-06-11 01:21:01 +02:00
Matthias Dieter Wallnöfer
27bcf7a0b6 LDB:ldb_tdb/ldb_tdb.c - allow LDB modify replaces with different value ordering
This is essential for fixing up wrong ordered "objectClass" attributes.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2012-04-18 07:48:05 +02:00
Andrew Tridgell
9deb650fa2 ldb: added ldb_msg_element_equal_ordered()
this gives us a order sensitive msg element comparison. We need this
to allow dbcheck to fix the order of objectClass attributes.
2012-04-18 07:48:05 +02:00
Matthias Dieter Wallnöfer
55f4275f18 LDB:ldb_msg.c - add another OOM check in "ldb_msg_copy()" 2012-04-11 12:50:16 +10:00
Andrew Bartlett
e17d12c23b ldb-tools: Place the whole of an ldif file in a transaction
This ensures that when operating ldbadd and ldbmodify against local
ldb files, either an ldif file succeeds or fails as a whole.

Also tests to verify that this is working correctly, and an ABI bump
due to the extra (private, but exported to ldb* tools) symbol and
behaviour change.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Apr 10 11:14:43 CEST 2012 on sn-devel-104
2012-04-10 11:14:43 +02:00
Andrew Bartlett
501d6d3dd4 ldb: Allow access to the line number while reading ldif from a file 2012-04-10 17:37:31 +10:00
Andrew Bartlett
c484f259c6 ldb: Detect failures in ldb.base again
We need to wrap the ldb tests in the subunit blackbox helpers.

We also needed to change to the right directory, or else the :< file://
syntax check does not work, as samba4.png is not found.

Andrew Bartlett
2012-04-10 16:57:06 +10:00
Andrew Bartlett
57341c0f29 Revert "ldb: Permit desactivation of autocomit for every ldb_xxx_ctrl function"
This reverts commit 40a4aea891.

Autocommit is important, as otherwise an ldb module could error out
during an operation, and leave an corrupt database.

Andrew Bartlett
2012-04-10 16:40:05 +10:00
Matthieu Patou
40a4aea891 ldb: Permit desactivation of autocomit for every ldb_xxx_ctrl function
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Fri Mar 30 11:59:09 CEST 2012 on sn-devel-104
2012-03-30 11:59:09 +02:00
Matthias Dieter Wallnöfer
d6fde2d4c2 LDB/s4 - deny the "(dn=...)" syntax on search filters when in AD mode
Achieve this by introducing a "disallowDNFilter" flag.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-03-26 00:57:29 +02:00
Amitay Isaacs
af68fe7113 build: Fix build issue on OpenBSD 5.x
Do not use -Wl,-no-undefined flag on OpenBSD 5.x (tested on 5.0)

Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Fri Mar 16 05:14:03 CET 2012 on sn-devel-104
2012-03-16 05:14:02 +01:00
Jelmer Vernooij
ebe04fc652 pyldb: Fix some more long lines, fix formatting.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Fri Mar  2 05:26:56 CET 2012 on sn-devel-104
2012-03-02 05:26:56 +01:00
Jelmer Vernooij
e29a9f4af7 pyldb: Avoid using PyErr_LDB_ERROR_IS_ERR_RAISE where PyErr_SetLdbError suffices.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Mar  1 23:06:55 CET 2012 on sn-devel-104
2012-03-01 23:06:55 +01:00
Matthias Dieter Wallnöfer
1e46ccba5a LDB:pyldb.c - use always the case insensitive comparison for attribute names
We can make no assumptions about our users

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-02-13 09:49:12 +11:00
Andrew Bartlett
eecf2ac4c8 selftest: Remove unused support for --exeext 2012-02-01 02:45:07 +01:00
Kelly Yeoh
34e7d960d0 ldbedit: prevent a transaction warning on failure
if a modify fails then cancel the transaction to prevent a dangling
transaction error

Signed-off-by: Andrew Tridgell <tridge@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Jan 25 07:06:40 CET 2012 on sn-devel-104
2012-01-25 07:06:40 +01:00
Matthieu Patou
f05edc0ecb pyldb: raise an exception if we can't add the attribute 2012-01-03 06:47:10 +01:00
Matthias Dieter Wallnöfer
9ab7299b32 ldb:ldb/common/ldb_controls.c - reference "err_string" variable correctly
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-02 19:10:04 +01:00
Matthias Dieter Wallnöfer
eddf0d0fe2 ldb:ldb_tdb.c - fix warnings in "ltdb_init_rootdse"
We should ignore the LDB result.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-12-23 10:36:07 +01:00
Jelmer Vernooij
03e5f581ae pyldb: Add more docstrings.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Dec  8 22:08:49 CET 2011 on sn-devel-104
2011-12-08 22:08:49 +01:00
Jelmer Vernooij
91c5bd23a7 Update ldb API sigs. 2011-11-30 22:58:05 +01:00
Jelmer Vernooij
0c8887c1cb Bump ldb version to 1.1.4 after introduction of ldb_module_error. 2011-11-30 22:58:05 +01:00
Amitay Isaacs
3a0f7b89d5 ldb: Add handy macros for reporting error inside ldb module
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Thu Nov 17 05:24:46 CET 2011 on sn-devel-104
2011-11-17 05:24:46 +01:00
Jelmer Vernooij
86afe83d86 waf: Factor checking for undefined symbol flags out into separate method.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Nov 13 19:38:38 CET 2011 on sn-devel-104
2011-11-13 19:38:38 +01:00
Jelmer Vernooij
c526078806 ldb: Only check for pkg-config file when checking for system ldb. 2011-11-13 18:06:06 +01:00
Jelmer Vernooij
8aa988a455 ldb: Use pyembed rather than pyext for ldb-util library. 2011-11-13 18:06:06 +01:00
Jelmer Vernooij
a0ed2da105 ldb: Re-apply pyldb fixes from Tridge and Amity, using unittest rather
than samba.tests.
2011-11-10 23:37:04 +01:00
Jelmer Vernooij
04be49f600 Revert "pyldb: fixed ldb API test"
This reverts commit 333248f08c.

This commit made the pyldb tests depend on the Samba testsuite.
2011-11-10 23:37:04 +01:00
Andrew Tridgell
333248f08c pyldb: fixed ldb API test
it was failing previously, but the failure wasn't being noticed
2011-11-10 14:24:21 +11:00
Andrew Tridgell
58457e6cd2 pyldb: enhanced get() method on msg object
get() now takes a default value and an idx, allowing for much easier
usage

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-11-10 14:24:21 +11:00
Jelmer Vernooij
21be155af8 pyldb: Remove duplicate definition of SYNTAX_DN. 2011-11-02 18:35:38 +01:00
David Disseldorp
2107ba5be8 ldb: fix compiler warning
Mixed declarations and code.

Autobuild-User: David Disseldorp <ddiss@samba.org>
Autobuild-Date: Wed Nov  2 16:51:24 CET 2011 on sn-devel-104
2011-11-02 16:51:24 +01:00
Matthias Dieter Wallnöfer
8a6daa3cf9 ldb:common/ldb_modules.c - fix a typo in comment
Reviewed-by: abartlet
2011-10-27 18:52:28 +02:00
Amitay Isaacs
ab50165a02 ldb: ldb_errstring() takes ldb_contxt as an argument
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-10-20 05:53:05 +02:00
Andrew Tridgell
3712006faa dsdb: improve debug message
show the reply type in "Invalid reply type" messages

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Oct 20 00:57:05 CEST 2011 on sn-devel-104
2011-10-20 00:57:05 +02:00
Andrew Bartlett
9d49945ff0 ldb: Output more error information when a connect fails 2011-10-18 13:13:34 +11:00
Andrew Tridgell
75953f1846 ldb: fixed a race in ldb initialisation
This fixes a race when two processes initialise the same ldb database
at the same time. One of them could fail due to the other creating the
@BASEINFO record first.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Oct 18 03:54:42 CEST 2011 on sn-devel-104
2011-10-18 03:54:42 +02:00
Matthias Dieter Wallnöfer
fea02ce177 ldb:ldb_autotransaction_request - error string shouldn't be set here
A generic error string should be set independently of the access
mechanism to an LDB operation. Hence it should be handled in "ldb_wait"
and "ldb_request"

Signed-off-by: Andrew Tridgell <tridge@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Oct 11 10:15:18 CEST 2011 on sn-devel-104
2011-10-11 10:15:18 +02:00
Matthias Dieter Wallnöfer
21d053d120 ldb:pyldb.c - py_ldb_* modification calls - error string shouldn't be set here
As discussed with Jelmer, we shouldn't be setting a generic LDB error string
only for the Python bindings alone. This should be done in "ldb_request"
and "ldb_wait" - the common place for all possible LDB access mechanisms.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-10-11 08:42:07 +02:00
Matthias Dieter Wallnöfer
7599d59d1a ldb:ldb.c/"ldb_wait" - make "ldb_wait" always return an error string
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-10-11 08:42:07 +02:00
Matthias Dieter Wallnöfer
500d1ba546 ldb:ldb.c/"ldb_wait" - change "ldb_wait" slightly in order to introduce error messages
In this occasion remove a redundant check for "LDB_ASYNC_DONE":

if (handle->state == LDB_ASYNC_DONE ||    if (handle->state == LDB_ASYNC_DONE)
    handle->status != LDB_SUCCESS) {              return handle->status;
        return handle->status;         == if (handle->status != LDB_SUCCESS)
}                                                 return handle->status;
...                                       ...
return LDB_SUCCESS;                       return LDB_SUCCESS;

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-10-11 08:42:07 +02:00
Matthias Dieter Wallnöfer
8cab94e827 ldb:ldb.c/"ldb_request" - make "ldb_request" always return an error string
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-10-11 08:42:07 +02:00
Matthias Dieter Wallnöfer
f2a3125dcb ldb:ldb.c - "ldb_set_errstring" can be implemented by using "ldb_asprintf_errstring"
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-10-11 08:42:07 +02:00
Matthias Dieter Wallnöfer
0f41868691 ldb:ldb_autotransaction_request - fix a typo in a comment
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-10-11 08:42:07 +02:00
Stefan Metzmacher
f47b4055e8 ldb: change version to 1.1.3 after pyldb changes
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Oct 10 14:24:25 CEST 2011 on sn-devel-104
2011-10-10 14:24:25 +02:00
Stefan Metzmacher
94899cd83c Revert "ldb: support raw OIDs in control string parsing"
This reverts commit ea41860d32.

This is not needed, because we already have the 'local_oid' magic.

metze
2011-10-07 12:20:49 +02:00
Stefan Metzmacher
ec910d94d3 ldb/ldb_controls: allow oid up to 255 chars
We have char oid[256], so allow sscanf() to consume 255 chars.

metze
2011-10-07 12:20:48 +02:00
Andrew Tridgell
ea41860d32 ldb: support raw OIDs in control string parsing
this makes it possible to use a raw OID string on the command line or
in python scripts

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06 14:34:21 +11:00
Andrew Tridgell
b3476f00a6 ldb: fixed memory leak in control string parsing
if parsing fails, free ctrl

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06 14:34:21 +11:00
Matthias Dieter Wallnöfer
2e76b798fe ldb:"ldb_extended" -make the call more similar to "ldb_search"
For example NULL out the LDB result pointer on failures.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-09-19 10:57:03 +10:00
Jelmer Vernooij
6589f1712f pyldb: Drop unnecessary dependency on pytalloc-util.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Sep 18 17:23:40 CEST 2011 on sn-devel-104
2011-09-18 17:23:40 +02:00
Rusty Russell
376511ed4d tdb_compat: adapt to tdb2 API change.
Add the ecode arg to all the log functions, and log it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14 07:13:13 +09:30
Matthias Dieter Wallnöfer
3a759e0375 ldb:pyldb.c - "py_ldb_rename" remove superflous "ldb" pointer
Reviewed-by: Jelmer

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Tue Sep 13 18:11:18 CEST 2011 on sn-devel-104
2011-09-13 18:11:18 +02:00
Matthias Dieter Wallnöfer
80f6932e3e ldb:ldb_controls.c - remove duplicate definition of "LDB_CONTROL_CMP"
And fix the comment

Reviewed-by: Jelmer
2011-09-11 17:33:08 +02:00
Matthias Dieter Wallnöfer
e3213bb4d0 ldb:pyldb.c - point out that "PyLdbResult_AsResult" does not convert everything
Reviewed-by: Jelmer
2011-09-11 17:32:58 +02:00
Andrew Tridgell
ccaab14ac4 ldb: make the 'spy' code more paranoid
the spy code in ldb_tdb was added a while ago to overcome a memory
hierarchy problem with async ldb errors. Recently we started to get
valgrind errors related to the order of free in the spy code. This
patch ensures that we don't try to use a freed spy pointer. This
prevents the valgrind errors, although I suspect that the memory
hierarchy we have here is more complex than it needs to be

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Sep  1 08:54:23 CEST 2011 on sn-devel-104
2011-09-01 08:54:23 +02:00
Andrew Tridgell
4d6c120fb7 ldb: fixed ldbsearch when no baseDN specified and cross-ncs is used
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-01 15:23:09 +10:00
Andrew Tridgell
8ab3c843b1 pyldb: added OID_COMPARATOR constants
This also changes the other constants to remove the LDB_ prefix, which
is redundent

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-01 15:23:09 +10:00
Andrew Tridgell
4655a5bf7c pyldb: fixed a warning
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-25 07:39:37 +10:00
Jelmer Vernooij
31912781ca wafsamba: Only install .pc files if libraries are public. 2011-08-21 03:22:05 +02:00
Matthias Dieter Wallnöfer
aefde815ac ldb:ldb_controls.c - cosmetic indentation fix 2011-08-19 19:31:04 +02:00
Matthias Dieter Wallnöfer
87b482a89e ldb - two cosmetic fixes
@ldb.h: Removes an invalid comment line
@pyldb.c: Fixes indentation
2011-08-19 19:31:03 +02:00
Andrew Bartlett
813bdf466d ldb: Remove use after free in error case
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Aug 13 13:49:44 CEST 2011 on sn-devel-104
2011-08-13 13:49:44 +02:00
Andrew Tridgell
cba88a2b62 ldb: fix the canonicalisation of booleans
we were canonicalising "FALSE" to "FALS"

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-09 11:56:23 +02:00
Stefan Metzmacher
a5fdf05d6c pyldb: fix uninitialized memory bug in PyArg_ParseTuple() argument
"s#", &str, &len) required 'len' as 'int' not as 'Py_ssize_t'.
With Py_ssize_t the 2nd half of a 64bit Py_ssize_t, will be
uninitialized as 'int' is only 32bit.

metze
2011-08-08 16:45:27 +02:00
Jelmer Vernooij
3bcb8710fd pyldb: Generate ABI file. 2011-08-07 17:17:18 +02:00
Jelmer Vernooij
fdff105854 pyldb: Consistently use pyldb_ prefix. 2011-08-07 17:08:56 +02:00
Andrew Tridgell
23598d56ff ldb: rule_id in ldb_parse_tree should be const
this allows assignment to a constant string without allocation

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-04 16:17:25 +10:00
Andrew Tridgell
849d042dd8 ldb: added a new always-fail ldap extended match OID
this is used when rewriting filter rules to replace a filter rule with
one that is guaranteed not to match

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-04 16:17:25 +10:00
Andrew Tridgell
a8293a5baa ldb: added signatures for 1.1.2 2011-08-04 16:17:24 +10:00
Andrew Tridgell
39576e9d65 ldb: raise minor version
needed for new module function ldb_dn_replace_components()

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-04 16:17:24 +10:00
Andrew Tridgell
841d17ff83 ldb: added ldb_parse_tree_walk()
this walks a ldb parse tree, calling a callback on each node

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-04 16:17:24 +10:00
Andrew Tridgell
4ba8069e3d ldb: added ldb_dn_replace_components()
this allows you to replace the string part of a DN with the string
part from another DN. This is useful when you want to fix a DN that
has the right GUID but the wrong string part, because the target
object has moved.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-04 16:17:24 +10:00
Andrew Tridgell
a7f3545b82 pyldb: return a copy of key constant DNs via python interface
this prevents an easy coding error where the caller modifies one of
the key DNs for the database, by using an add_child function or
similar

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:25:38 +10:00
Andrew Tridgell
7ce4aca029 pyldb: added binary_encode() and binary_decode() methods
this gives access to RFC2254 encoding from python

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-29 18:17:44 +10:00
Andrew Tridgell
d815ce094e ldb: added a test for an invalid search expression
this tests the fix for invalid expressions in & and | expressions

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-29 18:17:44 +10:00
Andrew Tridgell
e3b76bd620 ldb: fixed a search expression parse bug
when a secondary component of a & or | expression was invalid, it was
ignored rather than giving an error. For example:

 (|(objectclass=user)(samaccountname=foo\blah))

was treated as being:

 (objectclass=user)

whereas it should be an error, as foo\blah is invalid

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-29 18:17:44 +10:00
Amitay Isaacs
197996c3df ldb: Expose ldb_handler_fold() funcion
This allows creation of derived syntax handlers from the base directory string.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-28 15:20:51 +10:00
Andrew Tridgell
a36af1a501 pyldb: use dn.is_child_of() instead of dn.compare_base()
the compare_base() C API doesn't really fit well in python, as it
returns 0 for true. Better to have a boolean function for the python
interface.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-21 11:44:36 +10:00
Matthieu Patou
3f6df9f9e3 pyldb: add unit test for ldbDn.compare_base 2011-07-21 11:44:34 +10:00
Matthieu Patou
521556ceed ldb-python: add a function to Dn object to compare the Dn with a base DN 2011-07-21 11:44:34 +10:00
Andrew Tridgell
23b6af10f6 ldb: added ldb_val_string_cmp()
this should help fix some places where we run past the end of a string

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-13 12:51:05 +02:00
Andrew Tridgell
c60a48948a ldb: don't return special DNs on non-base searches
to look at a special DN, give the full DN

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-13 12:51:05 +02:00
Andrew Tridgell
58e89443e2 ldb: don't shortcut dn comparison for mismatched special DNs
DNs that start with @ can't be compared via string comparison with
normal DNs

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-13 12:51:05 +02:00
Matthieu Patou
f97e4f6b8f ldb-tdb: Introduce a flag on ltdb_add_internal to indicate whether unique value test should be performed or not
The function ltdb_add_internal is called either from ltdb_add or
ltdb_rename. In case of add we enforce the unique test (unless it has
been relaxed by a upper module through the
LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK flag), but for rename as it
is translated by a delete + a add we relax the test as we can have one
or more attribute which are supposed to be single valued but that are
not (ie. when we have a couple of deleted value on a single valued
attribute), we have already done the tests on insert so make the
assumption that the values are OK.

Without this patch deleting a subnet that has been affected to more than
one site fails as the delete is in fact a rename to GUID\0DEL ... with
an attribute siteObject that has 1 active link value and 1 inactive link
value

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Wed Jul 13 02:29:20 CEST 2011 on sn-devel-104
2011-07-13 02:29:20 +02:00
Andrew Bartlett
fe8fe384f3 ldb: set -Wl,-no-undefined only on standalone build
This ensures that the flag is not propogated to other projects, such
as Samba's source3 waf build.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Jul  5 10:37:30 CEST 2011 on sn-devel-104
2011-07-05 10:37:30 +02:00
Andrew Bartlett
8420a36dc7 ldb: make ldb a top level library for Samba 4.0
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-05 17:24:47 +10:00