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

119806 Commits

Author SHA1 Message Date
Martin Schwenke
5a6d319eea ctdb-tests: Add ctdb-db-test tool
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-24 04:06:44 +00:00
Martin Schwenke
439ef65d29 ctdb-client: Factor out function client_db_tdb()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-24 04:06:44 +00:00
Martin Schwenke
41a41d5f3e ctdb-daemon: Implement DB_VACUUM control
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-24 04:06:43 +00:00
Martin Schwenke
d462d64cdf ctdb-vacuum: Only schedule next vacuum event if vacuuuming is scheduled
At the moment vacuuming is always scheduled.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-24 04:06:43 +00:00
Martin Schwenke
13cedaf019 ctdb-daemon: Factor out code to create vacuuming child
This changes the behaviour for some failures from exiting to simply
attempting to schedule the next run.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-24 04:06:43 +00:00
Martin Schwenke
5539edfdbe ctdb-vacuum: Simplify recording of in-progress vacuuming child
There can only be one, so simplify the logic.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-24 04:06:43 +00:00
Martin Schwenke
496204feb0 ctdb-protocol: Add marshalling for control DB_VACUUM
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-24 04:06:43 +00:00
Martin Schwenke
a896486b62 ctdb-protocol: Add marshalling for struct ctdb_db_vacuum
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-24 04:06:43 +00:00
Martin Schwenke
b314835341 ctdb-protocol: Add new control CTDB_CONTROL_DB_VACUUM
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-24 04:06:43 +00:00
Amitay Isaacs
d0cc9edc05 ctdb-vacuum: Avoid processing any more packets
All the vacuum operations if required have an event loop to ensure
completion of pending operations.  Once all the steps are complete,
there is no reason to process any more packets.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:43 +00:00
Amitay Isaacs
680df07630 ctdb-daemon: Avoid memory leak when packet is deferred
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:43 +00:00
Amitay Isaacs
c6427dddf5 ctdb-recoverd: No need for database detach handler
The only reason for recoverd attaching to databases was to migrate
records to the local node as part of vacuuming.  Recovery daemon does
not take part in database vacuuming any more.

The actual database recovery is handled via the recovery_helper and
recovery daemon should not need to attach to the databases any more.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:43 +00:00
Amitay Isaacs
fc81729dd2 ctdb-recoverd: Drop VACUUM_FETCH message handling
This is now implemented in the ctdb daemon using VACUMM_FETCH control.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:43 +00:00
Amitay Isaacs
498932c0e8 ctdb-vacuum: Replace VACUUM_FETCH message with control
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:42 +00:00
Amitay Isaacs
86521837b6 ctdb-vacuum: Add processing of fetch queue
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:42 +00:00
Amitay Isaacs
da617f90d9 ctdb-daemon: Add implementation of VACUUM_FETCH control
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:42 +00:00
Amitay Isaacs
36f9b4953a ctdb-tests: Add marshalling tests for new control
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:42 +00:00
Amitay Isaacs
b71d8cd80f ctdb-protocol: Add marshalling for new control VACUUM_FETCH
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:42 +00:00
Amitay Isaacs
0872c52ef0 ctdb-protocol: Add new control VACUUM_FETCH
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:42 +00:00
Amitay Isaacs
913bd331f6 ctdb-tests: Drop code releated to obsolete controls
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:42 +00:00
Amitay Isaacs
688567f080 ctdb-protocol: Drop code related to obsolete controls
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-24 04:06:42 +00:00
Volker Lendecke
9f41a9fc1e ctdb: Avoid malloc/memcpy/free in ctdb_ltdb_fetch()
Make use of tdb_parse_record()

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
2019-10-24 04:06:42 +00:00
Heinz Hoelzl
6e8c3ae6e9 samba-tool: py3 compatiblity in 'user syncpasswords --daemon'
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14154

Signed-off-by: Heinz Hölzl <heinz.hoelzl@gvcc.net>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Björn Baumbach <bb@sernet.de>

Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Wed Oct 23 15:54:43 UTC 2019 on sn-devel-184
2019-10-23 15:54:43 +00:00
Andreas Schneider
263bec1b8d replace: Only link libnsl and libsocket if requrired
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14168

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 23 08:23:13 UTC 2019 on sn-devel-184
2019-10-23 08:23:12 +00:00
Christian Ambach
1b69795c5b s3:lib:wins fix a compile warning on Ubuntu 18.04
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) with -O2 puts up a warning here:
../../source3/lib/wins_srv.c: In function ‘wins_srv_tags’:
../../source3/lib/wins_srv.c:235:3: error: assuming signed overflow does not
occur when simplifying conditional to constant [-Werror=strict-overflow]
   for (j=0;j<count;j++) {
   ^~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Oct 23 04:57:09 UTC 2019 on sn-devel-184
2019-10-23 04:57:08 +00:00
Volker Lendecke
f37b913348 smbd: Save 520 bytes of writable memory from every smbd
Move what can be const from the "data" to the "text" segment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Oct 23 02:37:12 UTC 2019 on sn-devel-184
2019-10-23 02:37:12 +00:00
Volker Lendecke
0559701478 smbd: Remove an unused #define from mangle_hash2.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-23 01:11:30 +00:00
Volker Lendecke
ccc486ca11 smbd: Mark #else/#endif with the if-#define
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-10-23 01:11:30 +00:00
Martin Schwenke
aa37668218 ctdb-tests: Add -l option to set number of local daemons
This is the only place where setting an environment variable by hand
is recommended, so remove the anomaly.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 22 21:02:11 UTC 2019 on sn-devel-184
2019-10-22 21:02:11 +00:00
Martin Schwenke
fe80038d07 ctdb-tests: Prefix remaining environment variables with CTDB_
Now they are clearly all part of CTDB.

TEST_SOCKET_WRAPPER_SO_PATH gets too long in
integration_local_daemons.bash, so change it to
CTDB_TEST_SWRAP_SO_PATH instead of just prefixing.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-22 19:39:41 +00:00
Martin Schwenke
e8dc125ed2 ctdb-tests: Drop setting of test state directory for testonly target
This is the default and deciding this should be left to run_tests.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-22 19:39:41 +00:00
Martin Schwenke
fc16b8dbc6 ctdb-tests: Enable printing of logs on failure in autobuild
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-22 19:39:41 +00:00
Martin Schwenke
787662604d ctdb-tests: Add run_tests.sh option to print logs on test failure
Implement this for local daemons integration tests, dumping last 100
lines of logs.  This makes it possible to debug some failures in
automated tests where the logs are unavailable for analysis.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-22 19:39:40 +00:00
Martin Schwenke
5ae330e5a5 ctdb-tests: Avoid running valgrind under valgrind
When run from integration tests $CTDB already includes $VALGRIND, if
set.  So only add $VALGRIND if $CTDB is not set.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-22 19:39:40 +00:00
Martin Schwenke
b8461b422d ctdb-tests: Simplify tool unit test runner
There is no good reason why the code needs to be this way.  The
intervening code was removed years ago leaving a more complex version
of something very simple.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-10-22 19:39:40 +00:00
Amit Kumar
ce3fdc4dee samba-tool domain: fix an unhandled exception
Uncaught exception on running 'samba-tool domain schemaupgrade'

ERROR(<class 'ModuleNotFoundError'>): uncaught exception - No module named
'markdown' File "/usr/lib64/python3.7/site-packages/samba/netcmd/__init__.py",
line 185, in _run return self.run(*args, **kwargs) File
"/usr/lib64/python3.7/site-packages/samba/netcmd/domain.py", line 4157, in run
from samba.ms_schema_markdown import read_ms_markdown File
"/usr/lib64/python3.7/site-packages/samba/ms_schema_markdown.py", line 26, in
<module> import markdown

Signed-off-by: Amit Kumar amitkuma@redhat.com
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-10-22 19:39:40 +00:00
Amit Kumar
799b05cf7f net: 'net ads gpo getgpo' command not dumping gpo
We have passed dump_gpo(debuglevel=1), hence gpo is not
dumped at debuglevel=0. But end user will expect gpo
to be dumped without setting debug flag.

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
2019-10-22 19:39:40 +00:00
Noel Power
6ebd0ba735 s3/libsmb: clang: Fix 'the left operand of '-' is a garbage value'
Fixes:

source3/libsmb/clifile.c:360:19: warning: The left operand of '-' is a garbage value <--[clang]
        if (data[num_data-1] != '\0') {
                 ~~~~~~~~^
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 22 18:48:43 UTC 2019 on sn-devel-184
2019-10-22 18:48:43 +00:00
Noel Power
4ef40d41f6 s3/libsmb: clang: Fix 'Assigned value is garbage or undefined'
Fixes:

source3/libsmb/clirap.c:1490:9: warning: Assigned value is garbage or undefined <--[clang]
                *mode = attr;
                      ^ ~~~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-22 17:28:27 +00:00
Noel Power
6162100998 s3/libsmb: clang: Fix 'Value stored to 'p' is never read'
Fixes:

source3/libsmb/clirap.c:145:3: warning: Value stored to 'p' is never read <--[clang]
                p = rdata;
                ^   ~~~~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-22 17:28:27 +00:00
Noel Power
764bb47a37 s3/libsmb: clang: Fix 'Assigned value is garbage or undefined'
Fixes:

source3/libsmb/smbsock_connect.c:786:13: warning: Assigned value is garbage or undefined <--[clang]
                state->fd = fd;
                          ^ ~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-22 17:28:27 +00:00
Noel Power
4995a0e7e0 s3/libsmb: clang: Fix 'Value stored to 'create_options' is never read'
It looks like the create_options are accumulated as the depending on the
failure reasons returned for cli_smb2_create_fnum (except for when a
directory is encountered) this looks like a mistake
Fixes:

source3/libsmb/cli_smb2_fnum.c:1870:3: warning: Value stored to 'create_options' is never read <--[clang]
                create_options |= FILE_DIRECTORY_FILE;
                ^
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-22 17:28:27 +00:00
Noel Power
25a256bedf s3/libsmb: clang: Fix 'Dereference of undefined pointer value'
Fixes:

source3/libsmb/clidfs.c:350:3: warning: Dereference of undefined pointer value <--[clang]
                DLIST_ADD_END(referring_cli, cli);
                ^
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-22 17:28:27 +00:00
Noel Power
7a4da41c1e s3/libsmd: clang: Fix some uninitialized value errors
Fixes:

source3/libsmb/clilist.c:534:14: warning: 1st function call argument is an uninitialized value <--[clang]
        num_finfo = talloc_array_length(finfo);
                    ^
source3/libsmb/clilist.c:1007:13: warning: The right operand of '<' is a garbage value <--[clang]
        for (i=0; i<num_finfo; i++) {
                   ^~~~~~~~~~
2 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-22 17:28:27 +00:00
Noel Power
e9dd8821ad s3/libsmb: clang: Fix 'Value stored to 'p' is never read'
Fixes:

source3/libsmb/climessage.c:73:2: warning: Value stored to 'p' is never read <--[clang]
        p += hlen;
        ^    ~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-22 17:28:27 +00:00
Ralph Boehme
6a9041ba43 autobuild: rename samba-ad-member-* to samba-admem-*
Needed to come around MAX pathlen limit for UNIX domain socket triggered by
the new samba-ad-member-mitkrb5 target added in samba-ad-member-mitkrb5.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 22 14:53:17 UTC 2019 on sn-devel-184
2019-10-22 14:53:17 +00:00
Marco Wang
1722e5fb1c s3: include: printing: align function parameters
Signed-off-by: Marco Wang <m.aesophor@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 21 16:01:56 UTC 2019 on sn-devel-184
2019-10-21 16:01:56 +00:00
Marco Wang
31563f5759 s3: include: printing: fix indentation of struct printif
Signed-off-by: Marco Wang <m.aesophor@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-21 14:40:38 +00:00
Marco Wang
073dc735b4 s3: include: printing: move copyright notice to beginning
Signed-off-by: Marco Wang <m.aesophor@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-10-21 14:40:38 +00:00
Stefan Metzmacher
fd5cf415a7 s4:kdc: fix the principal names in samba_kdc_update_delegation_info_blob
We need the target service without realm, but the proxy services with realm.

I have a domain with an w2008r2 server and a samba and now both generate
the same S4U_DELEGATION_INFO.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-21 14:40:38 +00:00