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

119687 Commits

Author SHA1 Message Date
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
Isaac Boukris
90bdaaf09d selftest: add a test for PAC delegation-info blob in S4U2Proxy
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13133

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-21 14:40:38 +00:00
Isaac Boukris
d6a4eea5fd selftest/remote_pac: split test_PACVerify() in two
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13133

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-21 14:40:38 +00:00
Christian Schulz
5216fd2287 smbstatus: fix column length for DenyMode
Signed-off-by: Christian Schulz <chris@schocktools.de>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Oct 21 01:26:29 UTC 2019 on sn-devel-184
2019-10-21 01:26:28 +00:00
Christian Schulz
7b1466cc1e smbstatus: use display print function
Signed-off-by: Christian Schulz <chris@schocktools.de>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-10-21 00:04:32 +00:00
Andreas Schneider
c1349c44d9 s3:waf: Remove check for fdatasync
This is already checked by libreplace as replace also provides it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sun Oct 20 14:52:40 UTC 2019 on sn-devel-184
2019-10-20 14:52:40 +00:00
Uri Simchoni
649d15bb96 autobuild: harden samba-xc test suite
Add more checks which directly test the behavior of
--cross-answers and --cross-execute.

Previous test tested things in a round-about way, checking
that running in all three modes (native, cross-execute,
cross-answers) yields the same result. It was vulnerable
to a degradation in which cross-compilation modes didn't
work at all and were running native tests, which is
what happened with the upgrade of waf.

The added tests check the following:
- That cross-excute with cross-answers sets the cross-answers file
- That the content of cross-answers file actually affects the build
  configuration
- That a missing line in cross-answers fails the build

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Sun Oct 20 13:29:58 UTC 2019 on sn-devel-184
2019-10-20 13:29:58 +00:00
Uri Simchoni
fdfd698409 wafsamba: pass environment to cross-execute tests
This can come in handy for cross-execute scripts in general, and
is particularly required by the samba-xc test for cross-answers /
cross-execute, because Samba sets LD_LIBRARY_PATH during rpath
checks, and the test program needs that in order to successfully
run.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-10-20 12:06:30 +00:00
Uri Simchoni
5a4ade9534 wafsamba: avoid pre-forking if cross-compilation is enabled
Waf supports pre-forking to run configuration tests, but this
doesn't play well with Samba's cross-compilation support, because
Samba monkey-patches the actual fork+exec, which doesn't happen
in a pre-forked process pool.

This patch emulates the impact of WAF_NO_PREFORK env var when
cross-compilation is enabled.

The blueprint for the solution has been suggested by Thomas Nagy
in https://bugzilla.samba.org/show_bug.cgi?id=13846#c7 (item #2)

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-10-20 12:06:30 +00:00
Uri Simchoni
e00e933502 wafsamba: use test_args instead of exec_args to support cross-compilation
exec_args seems to have been a custom addition to Samba's copy of waf.
Upstream Waf has an identically-purposed parameter called test_args.

This parameter is being used for addiing runtime args to test programs that
are being run during configuration phases.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-10-20 12:06:30 +00:00
Uri Simchoni
09e282ec81 waf: upgrade to 2.0.18
This is required to get the new test_args parameter to conf.check, which
facilitates passing arguments to configuration test programs.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-10-20 12:06:30 +00:00
Volker Lendecke
0afd655e80 dbwrap_watch: Fix cleaning up dead watchers
"wrec->num_watchers" changes in dbwrap_watch_rec_del_watcher(). In
32d6cc84c I forgot to update the copy of that variable.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct 18 22:28:07 UTC 2019 on sn-devel-184
2019-10-18 22:28:07 +00:00
Volker Lendecke
75433f6052 dbwrap_watch: Test cleanup of dead watchers
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-10-18 21:06:33 +00:00
Samuel Cabrero
50f69b6054 librpc:core: Make dcesrv_find_endpoint public
Will be used from s3 implementation when a connection is passed to other
process where a particular association group was created.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Oct 18 17:30:39 UTC 2019 on sn-devel-184
2019-10-18 17:30:39 +00:00
Samuel Cabrero
e10028a050 librpc:core: Return NTSTATUS for dcesrv_find_endpoint
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:38 +00:00
Samuel Cabrero
08c663828c librpc:core: Rename find_endpoint to dcesrv_find_endpoint
This function will be public and available for s3 and s4 implementations.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:38 +00:00
Samuel Cabrero
73948df2f1 librpc:core: Initialize static variable
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:37 +00:00
Samuel Cabrero
6a6546b565 librpc:core: Allocate struct dcesrv_interface with talloc
The S3 implementation needs to reinit the dcesrv_context and free the
endpoints list with their registered interfaces.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:37 +00:00
Samuel Cabrero
52727543b0 librpc:core: Set debug class
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:37 +00:00
Samuel Cabrero
491102b5b2 s4:rpc_server: Move core functions to core library
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-18 16:07:37 +00:00