1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-23 11:17:06 +03:00

590 Commits

Author SHA1 Message Date
Andrew Bartlett
3abc3e7a3a s4:ldb Add a helper function for 'canonicalise' both strings base compares
This will help simplify boilerplate comparison functions where we
don't have a shortcut way to compare.

Andrew Bartlett
2009-11-12 16:34:02 +11:00
Matthias Dieter Wallnöfer
843be3bcd9 ldb_init: use constant for result of "ldb_setup_wellknown_attributes" 2009-11-07 10:18:26 +01:00
Kamen Mazdrashki
716eb62b5d s4/ldb: Fix double allocation for "ldb_url"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06 14:05:36 +01:00
Andrew Tridgell
6afac82e4b s4-ldb: '+' can also happen in base64 encoded index DNs 2009-10-27 11:44:05 +11:00
Andrew Bartlett
3c6c230b2d s4:ldb Add additional tracing of the ldb API
This helps pin down where errors occour, by printing a call stack and
setting error strings and trace messages in the transaction case.

Andrew Bartlett
2009-10-27 11:32:14 +11:00
Andrew Tridgell
12c9af7817 s4-ldb: allow for unescaped '=' in a index DN
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-25 22:02:31 +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
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
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
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
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
Endi S. Dewata
6cb652e05c s4:ldb - fixed dangling pointer in ldb_request_add_control() 2009-10-16 14:08:11 +02:00
Andrew Tridgell
4185e376f5 s4-ldb: removed bugus RDN length check
This isn't the rDN !
2009-10-15 10:01:10 +11: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
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
f9990e9b39 s4:ldb - add a check which has to be done on beginning of a "modify" operation 2009-10-08 00:18:06 +02:00
Andrew Tridgell
a0c82f17f8 Revert "s4:ldb always talloc_free() the ldb_ldif_write context, even on success"
This reverts commit a610843e9f21ee77fd29356313d2ef05fe25a1ed.
2009-10-02 22:40:02 +10:00
Andrew Bartlett
a610843e9f s4:ldb always talloc_free() the ldb_ldif_write context, even on success 2009-10-02 12:45:02 +02:00
Matthieu Patou
a73a0372f9 s4-ldb: Add new relax controls that allow relaxed x500 constraints checks 2009-10-02 12:44:59 +02:00
Andrew Tridgell
fd22e03047 s4-ldb: Add support for binary blobs in DNs
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-10-02 12:03:05 +10:00
Matthias Dieter Wallnöfer
54ea150f36 s4:ldb_msg_diff - Fixes up possible memory leaks and the python binding of it 2009-10-01 13:59:02 +02:00
Andrew Tridgell
1dfcd4c22c s4-ldb: fixed call argument order for ldb_dn_from_ldb_val
This caused _lots_ of problems, especially in server side sort
2009-09-22 17:10:06 -07:00
Andrew Tridgell
4a74b28397 s4-ldb: when tracing, show ldb_set_debug messages 2009-09-22 17:10:06 -07:00
Andrew Tridgell
2e98ee0907 s4-ldb: only show the outer level of ldb ops when tracing 2009-09-22 17:10:05 -07:00
Andrew Tridgell
ec5d01278a s4-ldb: don't show timestamps on every line of ldb traces
This adds ldb_debug_add() and ldb_debug_end() to format multiline
messages
2009-09-22 17:10:05 -07:00
Anatoliy Atanasov
68f33428c7 Move the check above the talloc 2009-09-22 14:46:18 -07:00
Anatoliy Atanasov
b850d7fb08 Add support in the ldb_dn.c code for MS-ADTS:3.1.1.5.1.2 Naming Constraints 2009-09-21 17:18:10 -07:00
Andrew Tridgell
1fa643bdd7 s4-ldb: bit prettier output 2009-09-21 16:31:06 -07:00
Andrew Tridgell
4d984d0c05 s4-ldb: fixed O(n^2) string handling in ldif debug print 2009-09-21 16:31:01 -07:00
Andrew Tridgell
97ffb912c1 s4-ldb: add a LDB_FLG_ENABLE_TRACING for full ldb tracing
When LDB_FLG_ENABLE_TRACING is set ldb will send full traces
of all operations and results
2009-09-21 15:27:05 -07:00
Andrew Bartlett
1d4a16acd7 s4:ldb print out which LDB the transaction is still active on. 2009-09-20 16:29:37 -07:00
Matthias Dieter Wallnöfer
52650f109d s4:ldb_parse - Fix the type of an array entry
I found this through a compile warning. Hope that I got this right.
2009-09-20 12:47:52 +02:00
Stefan Metzmacher
46dab92a2d s4:ldb: add ldb_parse_tree_copy_shallow() and change version to 0.9.7
metze
2009-09-20 06:44:16 +02:00
Andrew Tridgell
f2b5b5bb17 s4-ldb: ldap attribute names can contain a '.'
When they are of the form of OIDs
2009-09-15 14:07:43 -07:00
Andrew Tridgell
a99e216a47 s4-ldb: expose ldb_transaction_prepare_commit() in ldb
It is useful to be able to control the 2 phase commit from application
code (s4 replication uses it)
2009-09-15 14:07:06 -07:00
Jelmer Vernooij
d0c9d5ed8e ldb: Remove references to operational module init function.
This module is now part of Samba 4's dsdb subsystem rather than
standalone ldb.
2009-09-11 23:49:57 +02:00
Andrew Tridgell
5b20af988c s4-ldb: don't remove a message element beyond the end of the array 2009-09-11 18:02:04 +10:00
Andrew Tridgell
237f720e6c s4/ldb: expose the ldb flags with ldb_get_flags() 2009-09-08 21:56:31 +10:00
Andrew Tridgell
206d79ac51 s4/ldb: don't line wrap ldif when --show-binary is used 2009-09-08 21:56:31 +10:00
Andrew Tridgell
29ba7765d9 s4/ldb: added --show-binary command line option
This add --show-binary to ldbsearch. When this flag is set, binary
blobs will be shown as-is, instead of base64 encoded. This is useful
for some XML encoded attributes, and will also be used as part of some
NDR print formatting for attributes like repsTo.
2009-09-08 21:56:31 +10:00
Andrew Tridgell
8995491f59 ldb: make ldb module programming less error prone
When a top level method in a module returns an error, it is supposed
to call ldb_module_done(). We ran across a case where this wasn't
done, and then found that in fact that are hundreds of similar cases
in our modules. It took Andrew and I a full day to work out that this
was the cause of a subtle segv in another part of the code.

To try to prevent this happening again, this patch changes
ldb_next_request() to catch the error by checking if a module
returning an error has called ldb_module_done(). If it hasn't then the
call is made on behalf of the module.
2009-09-04 17:29:21 +10:00
Andrew Tridgell
bfccc4590d always use prepare_commit in ldb transaction commits if possible
The reason we need this is to make multi-tdb transactions safe, with
the partition module. The linked_attributes and repl_meta_data modules
now do extra processing when the transaction ends, and that processing
can fail. When it fails we need to cancel the transaction, which we
can only do if the hook is on the prepare commit instead of the end
transaction call. Otherwise the partition module cannot ensure that no
commit has been done on another partition.
2009-09-03 18:36:09 +10:00
Andrew Tridgell
67bf17598b don't allow two controls to be added with the same OID
Two controls with the same OID makes no sense, as they may
have different data attached
2009-09-02 18:19:55 +10:00
Andrew Tridgell
b5bf440065 added ldb_ldif_message_string()
This function provides a easy function for displaying a ldb_message
structure in a human readable format. It is especially useful for
calling in gdb.
2009-09-02 18:19:54 +10:00
Simo Sorce
185d06e122 ldb: cosmetic changes in ldb_dn
- remove trailing spaces and tabs
- shorten some variable names for readability
- try to break superlong lines for readability
2009-08-30 17:49:37 -04:00
Andrew Bartlett
425386ff61 s4:ldb Add ldb_ldif_write_string() and python wrappers
This allows us to turn a python LdbMessage back into a string.

Andrew Bartlett
2009-08-26 15:59:00 +10:00