1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

4795 Commits

Author SHA1 Message Date
Andrew Tridgell
dffb572ce0 s4-ldb: don't allow modifies outside a transaction. 2009-10-25 13:15:18 +11:00
Andrew Tridgell
5002cddcb0 s4-ldb: fixed re-index during a complex transaction
We may have modified index objects in the in-memory index tdb
2009-10-25 13:15:18 +11:00
Matthias Dieter Wallnöfer
4f8826ff7f ldb python bindungs - better use the "enum ldb_scope" for the search scope rather than "int" 2009-10-23 14:26:41 +02:00
Andrew Tridgell
3050f83288 s4-python: we need to include Python.h first
If we don't include Python.h first then we get a pile of warnings due
to broken redefines of XOPEN_SOURCE in the Python includes.
2009-10-23 16:23:01 +11:00
Andrew Tridgell
890e7719cf s4-ldb: move the tdb_reopen_all() calls to ldb_wrap.c 2009-10-23 14:52:18 +11:00
Andrew Tridgell
906961cd8c s4-ldb: use ldb_wrap_fork_hook() to cancel child transactions 2009-10-23 14:52:18 +11:00
Andrew Tridgell
a32b338647 s4-ldb: added ldb_transaction_cancel_noerr()
This will be used to allow cancelling of transactions in a child after
a fork()
2009-10-23 14:52:18 +11:00
Andrew Tridgell
4ad0397d8a s4-ldbwrap: added re-use of ldb contexts in ldb_wrap_connect()
This allows us to reuse a ldb context if it is open twice, instead
of going through the expensive process of a full ldb open. We can
reuse it if all of the parameters are the same.

The change relies on callers using talloc_unlink() or free of a parent
to close a ldb context.
2009-10-23 14:52:17 +11:00
Andrew Tridgell
98e4393df9 s4-dsdb: create a static system_session context
This patch adds a system_session cache, preventing us from having to
recreate it on every ldb open, and allowing us to detect when the same
session is being used in ldb_wrap
2009-10-23 14:52:17 +11:00
Andrew Tridgell
a109ee71fb s4-ldb: added a TODO about checking the indexlist 2009-10-22 12:47:55 +11:00
Andrew Tridgell
f2988f5cad s4-ldb: fixed some memory leaks in new indexing code 2009-10-22 12:47:55 +11:00
Andrew Tridgell
0fb6e2a52c s4-ldb: don't try to index non-indexed attributes 2009-10-22 12:47:55 +11:00
Andrew Tridgell
1b48764f24 s4-ldb: ensure new dn_list elements are not owned by caller 2009-10-22 12:47:55 +11:00
Andrew Tridgell
129298c9b9 s4-ldb: over-allocate index records to save on realloc costs 2009-10-22 12:47:55 +11:00
Andrew Tridgell
d483c3bb96 s4-ldb: fixed tdb error handling in ldb_index.c 2009-10-22 12:47:55 +11:00
Andrew Tridgell
fcd16eab6c s4-ldb: delete empty index records 2009-10-22 12:47:54 +11:00
Andrew Tridgell
936c8f311a s4-ldb: do more validation of idxptr lists 2009-10-22 12:47:54 +11:00
Andrew Tridgell
74ae8b90ae s4-ldb: expose ltdb_err_map and ltdb_delete_noindex
These will be used by ldb_index.c
2009-10-22 12:47:54 +11:00
Andrew Tridgell
c4cb0c520c s4-ldb: fast path for equal pointers
We compare identical ldb_val values surprisingly often
2009-10-22 12:47:54 +11:00
Andrew Tridgell
5f3cbb5f0b s4-ldb: when taking a list intersection, the result can be as long as the first list
Intuitively you would think it couldn't be longer than the minimum of
the two lists, but we are deliberately allowing for duplicates at this
level of the indexing code, which means the result can be longer
2009-10-22 12:47:53 +11:00
Andrew Tridgell
859cf72692 s4-ldb: ldb indexing rewrite - part1
This gets rid of the @IDXPTR approach to in-transaction indexing,
instead using an in-memory tdb to hold index values during a
transaction. This also cleans up a lot of the internal indexing logic,
hopefully making it easier to understand.

One of the big changes is in memory management, with a lot more use
made of talloc tricks to avoid copying dn lists, and shortcuts used to
avoid high intersection and union calculation costs.

The overall result is that a re-provision on my laptop goes from 48s
to a bit over 10s.
2009-10-22 12:47:53 +11:00
Andrew Tridgell
c5de880c40 s4-ldb: ldb_oom() for modules 2009-10-22 12:47:53 +11:00
Matthias Dieter Wallnöfer
d120e7ebde s4:ldb_sort - Add some more "const"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-10-22 10:02:43 +11:00
Torgeir Lerkerød
95ce7dff20 S4: ldb_map modules uses defines that are reserved
On OpenSolaris MAP_RENAME and friends are defined in <sys/mman.h> e.g. mmap and friends. So on these systems MAP_* have a meaning. Cleaned up LDB name space by adding LDB_ in front of MAP_* e.g. MAP_RENAME => LDB_MAP_RENAME

Signed-off-by: Torgeir Lerkerød <torgeir.lerkerod@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-10-21 15:46:38 +02:00
Andrew Tridgell
1467e5eaab s4-ldb: allow for non-null terminated ldb_val in ldb_dn_from_ldb_val
The strlen() could go past the end of a non-null terminated value
2009-10-21 22:43:58 +11:00
Andrew Bartlett
fa2e04b640 s4:ldb_map Fix use-after-free of memory in ldb_map
We need to keep the old 'ares' from the remote server around so we can forward
it back to the caller.  We can't send the same controls (from the last search
entry) twice (and it makes no sense anyway).

Andrew Bartlett
2009-10-21 22:43:57 +11:00
Andrew Bartlett
937140bf10 s4:ldb Put ltdb_private under the 'module'
This helps track the memory better, as we can then place it under the partition
hirarchy.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
bd53628c7a s4:ldb Add new function to create a cut down list of controls
This I hope will be useful for removing controls from the ldb_reply

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
17237f18f0 s4:ldb Add function to add controls to an LDB reply 2009-10-21 22:43:53 +11:00
Andrew Tridgell
c45a81ecf3 s4-pyldb: fixed 64 bit issues
The python argument parse functions take standard C types, not enums
and time_t. This broken the python interface on PPC.
2009-10-19 21:36:41 +11:00
Matthias Dieter Wallnöfer
d673b49dfc s4:ldb_msg_check_string_attribute - add a comment about the result values 2009-10-18 18:16:31 +02:00
Matthias Dieter Wallnöfer
9d097fa0e0 Revert "s4:ldb_msg - Use LDB constants on results"
This reverts commit 56a8baff3df6a5120b6c7bbca771dfb7c6934fd5.
Simo pointed out that I was wrong here.
2009-10-18 18:15:55 +02:00
Matthias Dieter Wallnöfer
56a8baff3d s4:ldb_msg - Use LDB constants on results 2009-10-18 10:45:30 +02:00
Matthias Dieter Wallnöfer
a69f84fd2a s4:ldb_ldap - Fix intendation 2009-10-18 10:45:15 +02:00
Andrew Tridgell
81eb31f07b s4: spelling error 2009-10-18 15:56:16 +11:00
Endi S. Dewata
6cb652e05c s4:ldb - fixed dangling pointer in ldb_request_add_control() 2009-10-16 14:08:11 +02:00
Kamen Mazdrashki
40a8a22684 s4/drs: Propagate redefinition of drsuapi_DsReplicaOID into code base
The biggest change is that 'oid' field is transmited in binary format.
Also the field name is changed to 'binary_oid' so that
field format to be clear for callers.

After those changes, Samba4 should work the way it works before -
i.e. no added value here but we should not fail when
partial-oid is part of prefixMap transmited from Win server.

Also, thre is a bug in this patch - partial-binary-OIDs are
not handled correctly. Partial-binary-OIDs received during
replication will be encoded, but not handled correctly.
2009-10-16 12:54:14 +03:00
Andrew Tridgell
387e67d53f s4-ldaptest: "testgroup" is a bit too common
This failed on one of my test boxes that has a group called
"testgroup". using "testgroupXX" should be a bit better.
2009-10-15 20:02:59 +11:00
Andrew Tridgell
818d98acf1 s4-ldap: test the rDN size limit 2009-10-15 15:54:40 +11:00
Andrew Tridgell
4185e376f5 s4-ldb: removed bugus RDN length check
This isn't the rDN !
2009-10-15 10:01:10 +11:00
Andrew Tridgell
41ba2f8189 ldb: fixed display of replUpToDateVector 2009-10-15 08:20:37 +11:00
Matthias Dieter Wallnöfer
e9686985cb s4: Changes the old occurences of "lp_realm" in "lp_dnsdomain" where needed
For KERBEROS applications the realm should be upcase (function "lp_realm") but
for DNS ones it should be used lowcase (function "lp_dnsdomain"). This patch
implements the use of both in the right way.
2009-10-14 10:50:43 +02:00
Matthias Dieter Wallnöfer
a889303e3e s4:ldb_tdb - Revert some introduced "trivial gotos"
I hope that this makes abartlet & simo happy again (consider mailing list).
2009-10-12 23:43:20 +02:00
Matthias Dieter Wallnöfer
78ebc02146 Revert "s4:ldb - add a check which has to be done on beginning of a "modify" operation"
This reverts commit f9990e9b391f330a8e6c5c158ee4e4eaa50f6176.

abartlet claims that this behaviour is too AD specific to put here. Btw I had
also some doubts if this is clean enough. I put it only here to make "ldap.py"
pass.

I'll try to find a new solution soon.
2009-10-12 16:19:04 +02:00
Andrew Bartlett
a37efaf922 s4:ldb Allow a NULL module list 2009-10-12 23:33:22 +11:00
Andrew Bartlett
fa05abc8ff Allow (and ignore) distinguishedName on special records
They are not stored, so we can ignore them (makes copying records much
easier)

Andrew Bartlett
2009-10-12 16:51:27 +11:00
Andrew Bartlett
554791c49f s4:ldb Reload the 'ltdb_cache' when @OPTIONS changes
(Otherwise setting the check base on search option is not applied
until after a reload).

Andrew Bartlett
2009-10-12 16:51:03 +11:00
Andrew Bartlett
93ac2cdb54 s4:ldb Allow a module string of ""
(We may have no modules set)

Andrew Bartlett
2009-10-12 16:51:02 +11:00
Matthias Dieter Wallnöfer
91456b8dc5 s4:ldb - SQLite: port some constraints from the TDB backend also to the SQLITE one 2009-10-08 00:18:07 +02:00
Matthias Dieter Wallnöfer
30faff7567 s4:ldap.py - Further enhancements
- Enhance test for "distinguishedName"
- Add a test for single-valued attributes
- Add a test for multi-valued attributes
- Add a test for empty messages
- Add a test for empty attributes
2009-10-08 00:18:07 +02:00