1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

149 Commits

Author SHA1 Message Date
Matthieu Patou
96f972460c ldb_tdb: Warn when reindexing is done
Signed-off-by: Matthieu Patou <mat@matws.net>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon May 20 15:47:33 CEST 2013 on sn-devel-104
2013-05-20 15:47:32 +02:00
Vadim Zhukov
2fda6c47f4 More generic check for OpenBSD platform
OpenBSD versioning is different from many other
projects, and, say, 5.0 does not differ from 4.9 more than from 5.1. So the
right approach will be to check that platform name starts with "openbsd"
instead. This is also the thing OpenBSD developers do when patching other
software, so this patch is consistent with already existing practicies.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9888

Reviewed-by: Lars Müller <lars@samba.org>
Reviewed-by: Björn Jacke <bj@sernet.de>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri May 17 17:58:16 CEST 2013 on sn-devel-104
2013-05-17 17:58:16 +02:00
Andrew Bartlett
c89df54423 ldb: Add missing dependency on replace for ldb
This brings in rep_timegm() on Solaris for example.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-22 08:47:23 +01:00
Matthieu Patou
554ba5ebbf ldb: Add more data test data for one level test cases
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Feb  8 06:46:40 CET 2013 on sn-devel-104
2013-02-08 06:46:40 +01:00
Matthieu Patou
9206eaaf5d ldb: Add tests for the python api
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-08 15:06:42 +11:00
Matthieu Patou
13b4815945 ldb: Add more tests related to onelevel search
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-08 15:06:39 +11:00
Matthieu Patou
057896a090 ldb: use strncmp instead of strcmp when comparing the val part
val part of a DN's component is DATA_BLOB and nothing insure that it
will be finished by a '\0'

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-08 15:06:37 +11:00
Matthieu Patou
87cbd9414b ldb: make test output more readable
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-08 15:06:36 +11:00
Matthieu Patou
75f422fe1d ldb-tdb: Document ltdb_index_add1 for more clarity
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-08 15:06:34 +11:00
Matthieu Patou
1e4e51f4c9 ldb-tdb: Fix a wrong parameter in ltdb_store
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-08 15:06:33 +11:00
Matthieu Patou
2470b0fe5f ldb_tdb: raise level of full index scan message so that it starts to be really visible
We don't want to have to set log level to 4 or 5 AND set the environment
variable to be able to see those log messages

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-08 15:06:31 +11:00
Andrew Bartlett
1d1ea72574 ldb: Ensure to decrement the transaction_active whenever we delete a transaction
This is in the error path for prepare_commit, which rarely fails, but
when it does we need to ensure that when a new transaction is opened,
that it really starts a new transaction.

We bump the version to recognise critical fix for the AD DC

Without this fix, a single invalid inbound replicated link disables
all subsequent replication as we operate without a transaction (which
is refused by ldb_tdb).

Andrew Bartlett

Reviewed-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-26 13:42:46 +01:00
Stefan Metzmacher
1ea6fabcde ldb: fix a warning by converting from TDB_DATA to struct ldb_val
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-26 13:41:39 +01:00
Karolin Seeger
875a1721ae docs: ldbsearch.1.xml: Correct meta data.
Signed-off-by: Karolin Seeger <kseeger@samba.org>

Karolin

Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 24 16:09:37 CET 2013 on sn-devel-104
2013-01-24 16:09:35 +01:00
Karolin Seeger
99e2a63a0c docs: ldbrename.1.xml: Correct meta data.
Signed-off-by: Karolin Seeger <kseeger@samba.org>

Karolin

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-24 14:29:32 +01:00
Karolin Seeger
25cc400c64 docs: ldbmodify.1.xml: Correct meta data.
Signed-off-by: Karolin Seeger <kseeger@samba.org>

Karolin

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-24 14:29:23 +01:00
Karolin Seeger
f585052d88 docs: ldbedit.1.xml: Correct meta data.
Signed-off-by: Karolin Seeger <kseeger@samba.org>

Karolin

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-24 14:29:01 +01:00
Karolin Seeger
918057bd11 docs: ldbdel.1.xml: Correct meta data.
Signed-off-by: Karolin Seeger <kseeger@samba.org>

Karolin

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-24 14:28:47 +01:00
Karolin Seeger
1d4346d4b7 docs: ldbadd.1.xml: Correct meta data.
Signed-off-by: Karolin Seeger <kseeger@samba.org>

Karolin

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-24 14:28:25 +01:00
Karolin Seeger
7d56b94011 docs: ldb.3.xml: Correct meta data.
Signed-off-by: Karolin Seeger <kseeger@samba.org>

Karolin

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-24 14:27:44 +01:00
Stephen Gallagher
813bd0353f ldb: Move doxygen comments for ldb_connect to the right place
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan 14 16:21:02 CET 2013 on sn-devel-104
2013-01-14 16:21:02 +01:00
Michael Adam
8f3f38ece4 ldb: fix a typo in the comment for ldb_req_is_untrusted()
Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Nov 30 15:44:46 CET 2012 on sn-devel-104
2012-11-30 15:44:46 +01:00
Karolin Seeger
0162dd55d3 docs: man ldbsearch: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:39 +01:00
Karolin Seeger
787a58b4a7 docs: man ldbrename: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:36 +01:00
Karolin Seeger
1404a24d3e docs: man ldbmodify: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:32 +01:00
Karolin Seeger
0b900da6ac docs: man ldbedit: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:26 +01:00
Karolin Seeger
1d5ef8931c docs: man ldbdel: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:23 +01:00
Karolin Seeger
08e63057de docs: man ldbadd: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:41:19 +01:00
Karolin Seeger
ac4881bd01 docs: man ldb.3: Add missing meta data.
This avoids warnings during the waf build and removes "FIXME" entries from the
manpage.

Karolin

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:40:58 +01:00
Stefan Metzmacher
6f47497610 lib/ldb: add missing newline in the output of ldb_ldif_write_trace()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov 13 13:53:31 CET 2012 on sn-devel-104
2012-11-13 13:53:31 +01:00
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
Andrew Bartlett
a71ad96bd0 ldb: Add ldbdump, based on tdbdump
This uses a tdb_traverse or (more usefully) the tdb_rescue API, like tdbdump.

The difference here is that it uses ldb helper functions to further
eliminate faulty records, which avoids creating duplicates in the output.

(The duplicates come from parts of records that are left in blank space
in the db, which tdb_rescue finds, but which are not actually a full
record).

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Oct 30 23:56:11 CET 2012 on sn-devel-104
2012-10-30 23:56:11 +01:00
Andrew Bartlett
4b2f3c6dec ldb: Remove no-longer-existing ltdb_unpack_data_free from ldb_tdb.h 2012-10-31 08:13:56 +11:00
Andrew Bartlett
cc6d0decc7 ldb: Change ltdb_unpack_data to take an ldb_context
It always de-references the module to find the ldb anyway.

Andrew Bartlett
2012-10-31 08:13:56 +11:00
Andrew Bartlett
ffd61e2bbf ldb: bump version to 1.1.13 so the 4.0 release can get the isprint fix
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Sep 17 23:47:57 CEST 2012 on sn-devel-104
2012-09-17 23:47:57 +02: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
Andrew Bartlett
dd21bb0b72 lib/ldb: Bump ldb version to 1.1.11
This will ensure the next Samba release requires an ldb with the recent
fixes.

Andrew Bartlett
2012-08-28 15:47:37 +10:00
Matthias Dieter Wallnöfer
32cd618e6c LDB:ldb_tdb.c - deny multi-valued attributes manipulation with doublets
This refers to LDB add operations as well, we have only to be careful on
"@ATTRIBUTES" entries.

E.g.

dn: cn=testperson,cn=users,dc=...,dc=...
objectClass: person
url: www.example.com
url: www.example.com

should not work.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:57 +02:00
Matthias Dieter Wallnöfer
cb63b34b05 LDB:ldbsearch - add search filter tests
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:57 +02:00
Matthias Dieter Wallnöfer
6a8c697954 LDB:ldbsearch - search filters do not only contain "="
Also "<=", ">=", "~"... are allowed as well. Enumeration taken from
ldb_parse_filtertype().
This was the cause of not identifying the search filter as described in bug
https://bugzilla.samba.org/show_bug.cgi?id=8647.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:55 +02: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
1d1bdc315b lib/ldb: Use tdb_parse_record and a callback rather than tdb_fetch()
This avoid allocation at the tdb layer as we will allocate this
with talloc right away anyway.

Andrew Bartlett
2012-08-10 10:18:27 +10: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
299fc75228 lib/ldb: Use tdb_exists() rather than tdb_fetch()/talloc_free()
This avoids pulling the record and doing an allocation when we just
want to know if it exists.

Andrew Bartlett
2012-08-09 20:14:22 +10:00
Andrew Bartlett
4e0fb8b4b1 Revert "ldb: Add parameter to avoid NULL format string flagged by -Werror=format"
This reverts commit cddcaf7bd2.

-Werror=format is no longer uses when it would cause this to fail.
 This is a legitimate use of the ldb_search API.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Aug  6 14:47:27 CEST 2012 on sn-devel-104
2012-08-06 14:47:26 +02:00
Andrew Bartlett
8208d7b2c2 lib/ldb: Ensure rename target does not exist before deleting old record
This is all in a transaction, but when we are handling rename errors in the repl_meta_data
module, we key off the error, and do not close the transaction.  We found that the
old record was gone and so could not try renaming it again to a conflict DN.

Andrew Bartlett
2012-07-31 14:15:29 +02:00
Andrew Bartlett
cddcaf7bd2 ldb: Add parameter to avoid NULL format string flagged by -Werror=format
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jul 30 15:48:53 CEST 2012 on sn-devel-104
2012-07-30 15:48:53 +02:00