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

138870 Commits

Author SHA1 Message Date
Stefan Metzmacher
6446715747 s4:librpc/rpc: add dcerpc_bh_auth_session_key()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
5e34173041 librpc/rpc: add dcerpc_binding_handle_auth_session_key()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
d9bf23f971 s4:librpc/rpc: remove unused dcerpc_fetch_session_key()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
4ccd2dd8a2 s4:torture/rpc: make use of dcerpc_binding_handle_transport_session_key()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
57905603e0 xss4:pyrpc: make use of dcerpc_binding_handle_transport_session_key()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
93e8d58736 s4:libnet: make use of dcerpc_binding_handle_transport_session_key() in libnet_passwd.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
2d1c182bf5 s4:libnet: add struct dcerpc_binding_handle helper variables in libnet_passwd.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
3cc6ddeb58 s4:librpc/rpc: remove unused dcerpc_transport_encrypted()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
9567d753ac s4:pyrpc: let py_iface_transport_encrypted() use dcerpc_binding_handle_transport_encrypted()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
5bb35cc7cc s3:rpc_client: add rpccli_bh_transport_session_key()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
9b50ab08c1 s4:librpc/rpc: add dcerpc_bh_transport_{encrypted,session_key}()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
3dc3f9cf1b librpc/rpc: add dcerpc_binding_handle_transport_{encrypted,session_key}()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
061267e0e4 s4:torture/rpc: avoid using DCERPC_NDR_REF_ALLOC in fsrvp.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
136ee756fe s4:torture/rpc: remove useless usage of DCERPC_SIGN, DCERPC_SEAL
We already used DCERPC_AUTH_LEVEL_PRIVACY for the connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
b0be3c8af8 s4:torture/rpc: avoid checking p->last_fault_code in iremotewinspool*
Now that we check for NT_STATUS_RPC_UNSUPPORTED_TYPE, there's no
need to check for DCERPC_NCA_S_UNSUPPORTED_TYPE.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
492f6a0eef librpc/rpc: map DCERPC_NCA_S_UNSUPPORTED_TYPE to NT_STATUS_RPC_UNSUPPORTED_TYPE
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +00:00
Stefan Metzmacher
722e93e4d9 librpc/rpc: map DCERPC_NCA_S_SERVER_TOO_BUSY to NT_STATUS_RPC_SERVER_TOO_BUSY
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26 15:22:45 +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
Jones Syue
4f3dfb2029 s3: SIGHUP handlers use consistent log level 3
When turn-on 'log level = 3', sending SIGHUP to samba processes, for
example: smbd parent/children, smbd-notifyd, and smbd-cleanupd. Then
monitor log.smbd in order to parse sighup logs, it looks like the log level
is inconsistent among these processes: smbd parent/children use level 1,
and smbd-notifyd/smbd-cleanupd use level 3.

This patch raises sighup handler's log level from level 1 to level 3, which
is more consistent with smbd-notifyd by Commit 6e5bff80a0 ("s3:notifyd:
Handle sigup in notifyd to reparse smb.conf"), and smbd-cleanupd by Commit
57c1e115ec ("smbd: reopen logs on SIGHUP for notifyd and cleanupd").

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

Signed-off-by: Jones Syue <jonessyue@qnap.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Sep 25 01:38:02 UTC 2024 on atb-devel-224
2024-09-25 01:38:02 +00:00
Kacper Boström
bb12f19e4f samba-tool: Fix for inability to delete GPOs containing GPWL policies
GPOs containing GPWL (Wireless/Wired Protocol Extension) policies could not be deleted with samba-tool
as those policies were stored as subentries of the GPO and only the main root was deleted.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15387
RN: Fix for inability to delete GPOs containing GPWL policies using samba-tool

Signed-off-by: Kacper Boström <kacper@kacper.se>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Sep 24 17:11:53 UTC 2024 on atb-devel-224
2024-09-24 17:11:52 +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
Douglas Bagnall
1871eb9d1c ldb:test:api_search: use @unittest.skipIf for LMDB tests
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
Douglas Bagnall
235c7d15ef ldb:test:api_search: skip LMDB tests at class level
LMDB is not going to turn up midway through the testsuite, so we might
as well skip the whole class

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
Douglas Bagnall
d9225d2460 ldb:test:api_search: use class method to add index
The index attribute of these classes was a mutable object, which made
me nervous. If a subclass were to alter the class.index (rather than
replace it), it would affect tests in other subclasses.

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
Douglas Bagnall
f7269c2fa3 ldb:test:api_search: tidy up files in each subclass
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
Douglas Bagnall
2029cd7a7b ldb:test:api_search: set up the database once and use copies
The api_search tests are really slow, in part because we populate the
database identically for all the individual tests. We can instead do
it once and use copies.

This makes the test several times faster.
Comparing "make test TESTS=ldb.python":

Before:

TOP 10 slowest tests
ldb.python.api_search.tr -> 415
ldb.python.api_search -> 413
ldb.python.api_add_modify -> 5
ldb.python.api_add_modify.tr -> 4
ldb.python.index.tr -> 4
ldb.python.index -> 4
ldb.python.api_simple.tr -> 2
ldb.python.api_simple -> 2
ldb.python.repack -> 2
ldb.python.api_misc.tr -> 1
'testonly' finished successfully (14m13.276s)

After:

TOP 10 slowest tests
ldb.python.api_search.tr -> 52
ldb.python.api_search -> 50
ldb.python.api_add_modify -> 7
ldb.python.api_add_modify.tr -> 7
ldb.python.index.tr -> 4
ldb.python.index -> 4
ldb.python.api_simple -> 4
ldb.python.api_simple.tr -> 2
ldb.python.repack -> 2
ldb.python.api_misc -> 1
'testonly' finished successfully (2m14.505s)

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
98d408be86 ldb:test:api_search: use test name as db name
This will help enusre we are using the right DB when (in the next
commit) we set up the database for each test via copy. It also helps
with debugging.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
146540a128 ldb:test:api_search: put config options on class, not instance.
This makes them available to class methods.

In a later commit we will convert the index attribute into an
add_index() class method, because having a mutable variable on a class
is a slightly bad idea.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
69a00fd0d7 ldb:test:api_search: improve attribute access tests
`list = res.msgs` tests nothing more than a bare `res.msgs`,
and we can instead assert that the result is a list.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
b08427d086 ldb:test:api_base: make flags method a class method
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
8d97ce958f ldb:test:api_base: simplify prefix selection
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
83f3afaac4 ldb:tests:index: use abi_base
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
0c968d374a ldb:tests:crash: rationalise imports
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
102660e7d1 ldb:tests:api_simple uses conventional 4 space indent
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
b932143c8d ldb:tests:repack: use common api_base variables
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
ccc732dae2 ldb:tests:api_misc: fix Control test
`self.assertRaises(TypeError, ldb.Control, ldb, 1234)` is raising a
TypeError because `ldb` is not an ldb.Ldb object, it is the ldb module.

What we want to test here is that the non-string `1234` raises a
TypeError -- the previous line tests the type of the ldb argument.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
c706021d55 ldb:tests: move api.py to api_misc
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
081125f3b3 ldb:tests: make api_simple module
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
565eba4120 ldb:tests: make api_add_modify module
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
e4410ada21 ldb:tests: make api_search module
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
6e947a20ee ldb:tests: make api_base module
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
16820c883d ldb:tests:api.py uses .disconnect before rmdir
super.tearDown() was removing the tmpdir, but because self.ldb had
the file open, the directory was not cleared.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
09d9680f5e ldb:pytest:api: remove unnecessary super() parameters
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
b1fd6e2b07 ldb:pytest:api: remove pass-though tearDowns
The result is exactly the same, unless we previously had the wrong
class name in the pass-through, in which case the result is *probably*
the same, only more correct.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00
Douglas Bagnall
64e3c5cba9 ldb:py bindings: ldb.Ldb().__str__ prints connection URL
before:  "<ldb connection>"
after:   "<ldb connection tdb:///path/to/samdb.ldb>"

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-09-24 09:14:38 +00:00