1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
Commit Graph

8911 Commits

Author SHA1 Message Date
Douglas Bagnall
781057b3ca ldb:kv: s/ltdb/ldb_kv/ in comments and messages
with some subsequent tidy-ups for style.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-12-19 23:00:32 +00:00
Douglas Bagnall
77ad9096d0 ldb:ldb_pack: filter avoids looping over msg when attrs contain "*"
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-12-19 23:00:32 +00:00
Douglas Bagnall
df3f7be326 ldb:dn_casefold_internal: TALLOC_FREE only what we talloced
If the failure is not on the last component, we would have
TALLOC_FREE()ed some components that we hadn't set.

I think in all pathways we initialise the unset components to zero,
but we should be careful just in case.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-12-19 23:00:32 +00:00
Douglas Bagnall
9754980b03 ldb:tests: add tests ensuring indexes don't change search results
The index code (lib/ldb_key_value/ldb_kv_index.c) recapitulates LDB
expression logic, and it seemed less than completely obvious that it
would never make a mistake and return a different result than an
unindexed search.

Here we run the same search on an unindexed database and on some that
have been indexed with a variety of options. We assert that the
results are identical over a number of searches.

By default, when run from the command line, that number is 495161,
which takes a couple of minutes. But if the SKIP_SLOW_TESTS
environment variable is set, the number is 33569, which takes 20
seconds or so. In selftest we set the variable and run the smaller
number.

The tests will print the cumulative search time for each database for
each testsuite, like this:

$ python3 lib/ldb/tests/python/index_transparency.py
..........................................................[...]
<class '__main__.SearchTest'>
25.78186821937561 <ldb connection tdb:///tmp/tmpf1x72x7l/tdb-indexed-dn.ldb>
17.73349642753601 <ldb connection tdb:///tmp/tmpf1x72x7l/tdb-half-indexed.ldb>
15.14864206314087 <ldb connection tdb:///tmp/tmpf1x72x7l/tdb-indexed-guid.ldb>
13.107165575027466 <ldb connection mdb:///tmp/tmpf1x72x7l/mdb-indexed.ldb>

Like all benchmarks it is interesting but misleading. One caveat here
is that you have (probably) compiled tdb in developer mode without
optimisation, while lmdb is probably a system package compiled with -O2,
though perhaps not tuned to your exact architecture.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-12-19 23:00:32 +00:00
Douglas Bagnall
9aefaa9dc9 lib:ldb-samba: use 'ldb' debug class more widely
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-12-19 23:00:32 +00:00
Andreas Schneider
d091182156 ldb: Add LGPLv3 LICENSE file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15729

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-12-12 13:59:29 +00:00
Andreas Schneider
d1849ba12f tdb: Add LGPLv3 LICENSE file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15729

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-12-12 13:59:29 +00:00
Andreas Schneider
24494f9ff7 tevent: Add LGPLv3 LICENSE file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15729

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-12-12 13:59:29 +00:00
Andreas Schneider
cd0fb59568 talloc: Add LGPLv3 LICENSE file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15729

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-12-12 13:59:29 +00:00
Volker Lendecke
a14fa71db5 lib: Simplify smbconf_txt_load_file()
file_modtime() returns errno, so we can skip the racy file_exist()
call.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-12-02 04:53:33 +00:00
Volker Lendecke
edc1f99ffa lib: Move some R/W "data" segment to R/O "text"
Doesn't really matter for tests, but I just came across it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-12-02 04:53:33 +00:00
Volker Lendecke
7c4d1f9de1 lib: Simplify nybble_to_hex_*
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-11-12 12:09:35 +00:00
Volker Lendecke
542cf01bfe ldb: User hexchars_upper from replace.h
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-11-12 12:09:35 +00:00
Volker Lendecke
fd5562bee7 libreplace: Introduce hexchars_{upper|lower}
We use that in quite a few places in our code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-11-12 12:09:35 +00:00
Thomas Klausner
04e0fb9b2d lib/replace: memset_explicit() only takes three arguments
Signed-off-by: Thomas Klausner <wiz@gatalith.at>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 11 16:47:46 UTC 2024 on atb-devel-224
2024-11-11 16:47:46 +00:00
Volker Lendecke
24dc8ef174 param: Add "client netlogon ping protocol"
Allow "net ads join" in environments where UDP/389 is blocked. Code
will follow.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:04 +00:00
Volker Lendecke
527d81fc5e param: Remove parameter "cldap port"
This was not used consistently across all of our code base, and I
don't see a reason why this should ever not be port 389.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-11 14:03:03 +00:00
Samuel Thibault
23ddfd3b03 lib/util: Include grp.h for setgroups during autoconf
Otherwise setresuid and friends don't get detected on GNU/Hurd because the
inclusion of <grp.h> is missing for the declaration of setgroups.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 11 12:51:17 UTC 2024 on atb-devel-224
2024-11-11 12:51:17 +00:00
Earl Chew
1655413f12 Describe implication of upstream ICU-22610
Add commentary to link commit 86c7688 (MR !3447) to the upstream
fix for ICU-22610 in case there is subsequent breakage.

Signed-off-by: Earl Chew <earl_chew@yahoo.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov  8 00:20:38 UTC 2024 on atb-devel-224
2024-11-08 00:20:38 +00:00
Douglas Bagnall
a909db027f ldb:test:lmdb_free_list: s/the the/to the/ in comment
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-06 10:57:35 +00:00
Douglas Bagnall
f914f53913 util:charset: s/the the\b/the/ in comments
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-06 10:57:35 +00:00
Douglas Bagnall
153a14776d tevent docs: s/the the\b/the/
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-06 10:57:35 +00:00
Douglas Bagnall
0bb729d613 pyldb: s/the the\b/the/ in comments
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-06 10:57:35 +00:00
Douglas Bagnall
296456407e ldb:pack: s/the the/in the/ in comments
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-06 10:57:34 +00:00
Douglas Bagnall
3c1e99f5d3 lib/afs: s/the the\b/the/ in comments
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-06 10:57:34 +00:00
Ralph Boehme
ae3e9dde4c smbd: add option "smb3 directory leases"
By default enabled on non-clustered Samba, disabled on clustered Samba, the
reason being the expected additional load caused by forcing strict rename to be
enabled.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05 14:39:30 +00:00
David Mulder
948d0fcfe1 Isolate hsm auth value from the cache
Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2024-10-23 14:21:33 +00:00
David Mulder
f0cbe4d5a2 Add lp Rust bindings
Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2024-10-23 14:21:33 +00:00
Volker Lendecke
79b05108ec lib: Use talloc_realloc instead of talloc_realloc_size
Maybe Coverity understands that talloc_realloc re-allocates the input
buf. It does not understand that talloc_realloc_size does it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-10-06 01:14:31 +00:00
Volker Lendecke
d03096721e lib: Avoid duplicate definition of ADD_TO_ARRAY
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-10-02 13:12:30 +00:00
Volker Lendecke
f3e7d450ea lib: Fix CID 1596761 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-10-02 13:12:30 +00:00
Stefan Metzmacher
7d255e5c23 lib/addns: match additional names in a non case insensitive way
Sometime proxy dns servers mess up the case of parts of the
name...

So we should match with strequal() instead of strcmp(),
which results in much less dns packets on the wire...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Sep 29 08:09:46 UTC 2024 on atb-devel-224
2024-09-29 08:09:46 +00:00
Andreas Schneider
03e880931d doc: Update doc about talloc vs malloc speed
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Sep 28 01:20:01 UTC 2024 on atb-devel-224
2024-09-28 01:20:01 +00:00
Andreas Schneider
a66db6c16e lib:talloc: Use tabs to align output in speed test
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-09-28 00:11:34 +00:00
Andreas Schneider
39c13f062a lib:talloc: Increase alloc size to 128 kilobytes
We want to avoid that the optimizer will use stack allocations. This way
the test should be a bit more realistic.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-09-28 00:11:34 +00:00
Andreas Schneider
00d5982da2 lib:talloc: Don't optimize the speed test
If the speed test gets optimized, the malloc() and free() might be
replaced by stack allocations.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-09-28 00:11:34 +00:00
Andreas Schneider
b6bf9cba80 lib:talloc: Add talloc_zero vs calloc test
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-09-28 00:11:34 +00:00
Andreas Schneider
8dddea2ced lib:talloc: Use memset_s() to avoid the call gets optimized out
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-09-28 00:11:34 +00:00
Andreas Schneider
6812e30be3 lib:talloc: Remove trailing spaces from testsuite.c
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-09-28 00:11:34 +00:00
Andreas Schneider
20a3a94e06 lib:ldb: Document environment variables in ldb manpage
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15643

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Sep 27 09:06:43 UTC 2024 on atb-devel-224
2024-09-27 09:06:43 +00:00
Andreas Schneider
d6ff05cb57 lib:ldb: Remove trailing spaces from ldb.3.xml
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15643

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-09-27 07:55:29 +00:00
Andreas Schneider
dc6927fdca lib:ldb: Don't use RTLD_DEEPBIND by default
It should be off by default, as this is not needed by default. It
crashes named on startup, if bind is built with jemalloc support.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-09-27 07:55:29 +00:00
Andreas Schneider
8d6b518377 lib:ldb: Remove trailing spaces from ldb_modules.c
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15643

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-09-27 07:55:29 +00:00
Andreas Schneider
b3bc2c950f lib:ldb: Use tdb_traverse_read() in ldb_kv_index_sub_transaction_commit()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 26 09:59:34 UTC 2024 on atb-devel-224
2024-09-26 09:59:34 +00:00
Andreas Schneider
03c2f3d1fd lib:ldb: Use tdb_parse_record() in ldb_kv_sub_transaction_traverse()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-09-26 08:46:29 +00:00
Andreas Schneider
3582250538 lib:ldb: Use tdb_parse_record() in ldb_kv_dn_list_store()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-09-26 08:46:29 +00:00
Andreas Schneider
090f8009b3 lib:ldb: Use tdb_parse_record() in ldb_kv_dn_list_load()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2024-09-26 08:46:28 +00:00
Andreas Schneider
fdef894d79 ldb: Build lmdb backend also in non-AD case
We should build with lmdb support also if it is not in AD case. The lmdb
backend is also used e.g. by sssd.

If you don't want to build it, you can always specify --without-ldb-lmdb

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Sep 25 05:36:13 UTC 2024 on atb-devel-224
2024-09-25 05:36:13 +00:00
Douglas Bagnall
3d47fc749a ldb:test:api_search: shift remaining setUp adds to class add_index
Before:

ldb.python.api_search -> 52
ldb.python.api_search.tr -> 48

After:

ldb.python.api_search.tr -> 10
ldb.python.api_search -> 9

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Sep 24 10:38:03 UTC 2024 on atb-devel-224
2024-09-24 10:38:03 +00:00
Douglas Bagnall
45137017af ldb:test:api_search: remove pass-through setUp()s
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:39 +00:00