1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
Commit Graph

241 Commits

Author SHA1 Message Date
Andrew Tridgell
30ffdda45b ldb: fixed callers for ldb_pack_data() and ldb_unpack_data()
with ltdb_pack_data() and ltdb_unpack_data() now moved into common, we
need to increase the minor version and fixup callers of the API

Note that this relies on struct ldb_val being the same shape as
TDB_DATA, in much the same way as we rely on ldb_val and DATA_BLOB
being the same shape.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:41 +11:00
Andrew Tridgell
fc47b0d03c ldb: move ldb_pack.c into common
this code should not be tied to the ldb_tdb backend, both because it
could be used for any record oriented backend, and because it should
be exposed for use by diagnosis/repair tools such as the recently
added ldbdump tool

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:40 +11:00
Jeremy Allison
7c1fd74ba5 At Michael's suggestion, factor common code into a function. My bad :-).
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 11 20:08:37 CEST 2012 on sn-devel-104
2012-09-11 20:08:37 +02:00
Jeremy Allison
cfeac09fc0 Fix bug #9147 - winbind can't fetch user or group info from AD via LDAP
Don't use "isprint" in ldb_binary_encode(). This is locale specific.
Restrict to ASCII only, hex encode everything else.
2012-09-10 21:56:34 +02:00
Andrew Bartlett
395b8e4d58 lib/ldb: Avoid printing secret attributes in ldb trace logs
These are printed when Samba has debug level 10, which is often used for debugging.

Instead, print a note to say that this attribute has been skipped.

Andrew Bartlett
2012-08-29 12:28:38 +10:00
Matthias Dieter Wallnöfer
536c082505 LDB:ldif_handlers.c - LDB_OP_GREATER/LDB_OP_LESS are thought as ">=" or "<="
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:55 +02:00
Andrew Bartlett
73f0cb5278 lib/ldb: Do not vasprintf() the tevent debug messages that will not be shown
This malloc() and free() actually shows up quite high on a call profile of
provision of the AD DC.

This allows the debug handler to decide if the argument list should be
printed.

Andrew Bartlett
2012-08-09 20:14:23 +10: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
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
501d6d3dd4 ldb: Allow access to the line number while reading ldif from a file 2012-04-10 17:37:31 +10: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
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
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
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
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
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
aefde815ac ldb:ldb_controls.c - cosmetic indentation fix 2011-08-19 19:31:04 +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
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
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
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
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
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