slow/samba-autobuild/.git
4 years agolibnet_join: add SPNs for additional-dns-hostnames entries 6396e5c1bc2
Isaac Boukris [Fri, 13 Sep 2019 07:56:10 +0000 (10:56 +0300)]
libnet_join: add SPNs for additional-dns-hostnames entries

and set msDS-AdditionalDnsHostName to the specified list.

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

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agodocs-xml: add "additional dns hostnames" smb.conf option
Isaac Boukris [Tue, 17 Sep 2019 18:38:07 +0000 (21:38 +0300)]
docs-xml: add "additional dns hostnames" smb.conf option

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

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agolibnet_join_set_machine_spn: simplify adding uniq spn to array
Isaac Boukris [Wed, 18 Sep 2019 20:15:57 +0000 (23:15 +0300)]
libnet_join_set_machine_spn: simplify adding uniq spn to array

and do not skip adding a fully qualified spn to netbios-aliases
in case a short spn already existed.

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

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agolibnet_join_set_machine_spn: simplify memory handling
Isaac Boukris [Wed, 18 Sep 2019 18:29:47 +0000 (21:29 +0300)]
libnet_join_set_machine_spn: simplify memory handling

and avoid a possible memory leak when passing null to
add_string_to_array() as mem_ctx.

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

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agolibnet_join_set_machine_spn: improve style and make a bit room for indentation
Isaac Boukris [Wed, 18 Sep 2019 17:00:34 +0000 (20:00 +0300)]
libnet_join_set_machine_spn: improve style and make a bit room for indentation

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

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agolibnet_join: build dnsHostName from netbios name and lp_dnsdomain()
Isaac Boukris [Thu, 29 Aug 2019 21:22:15 +0000 (00:22 +0300)]
libnet_join: build dnsHostName from netbios name and lp_dnsdomain()

This make the join process much more reliable, and avoids "Constraint
violation" error when the fqdn returned from getaddrinfo has already
got assigned an SPN.

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

Signed-off-by: Isaac Boukris <iboukris@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agoctdb-tests: Add -l option to set number of local daemons
Martin Schwenke [Thu, 17 Oct 2019 05:42:36 +0000 (16:42 +1100)]
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>
4 years agoctdb-tests: Prefix remaining environment variables with CTDB_
Martin Schwenke [Thu, 17 Oct 2019 05:33:48 +0000 (16:33 +1100)]
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>
4 years agoctdb-tests: Drop setting of test state directory for testonly target
Martin Schwenke [Thu, 17 Oct 2019 05:19:58 +0000 (16:19 +1100)]
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>
4 years agoctdb-tests: Enable printing of logs on failure in autobuild
Martin Schwenke [Thu, 17 Oct 2019 05:19:33 +0000 (16:19 +1100)]
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>
4 years agoctdb-tests: Add run_tests.sh option to print logs on test failure
Martin Schwenke [Thu, 17 Oct 2019 04:53:09 +0000 (15:53 +1100)]
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>
4 years agoctdb-tests: Avoid running valgrind under valgrind
Martin Schwenke [Wed, 16 Oct 2019 06:21:51 +0000 (17:21 +1100)]
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>
4 years agoctdb-tests: Simplify tool unit test runner
Martin Schwenke [Sun, 13 Oct 2019 23:15:07 +0000 (10:15 +1100)]
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>
4 years agosamba-tool domain: fix an unhandled exception
Amit Kumar [Mon, 2 Sep 2019 09:26:08 +0000 (04:26 -0500)]
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>
4 years agonet: 'net ads gpo getgpo' command not dumping gpo
Amit Kumar [Mon, 15 Jul 2019 20:59:44 +0000 (02:29 +0530)]
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>
4 years agos3/libsmb: clang: Fix 'the left operand of '-' is a garbage value'
Noel Power [Tue, 13 Aug 2019 14:57:22 +0000 (15:57 +0100)]
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>
4 years agos3/libsmb: clang: Fix 'Assigned value is garbage or undefined'
Noel Power [Tue, 13 Aug 2019 14:55:13 +0000 (15:55 +0100)]
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>
4 years agos3/libsmb: clang: Fix 'Value stored to 'p' is never read'
Noel Power [Tue, 13 Aug 2019 14:52:46 +0000 (15:52 +0100)]
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>
4 years agos3/libsmb: clang: Fix 'Assigned value is garbage or undefined'
Noel Power [Tue, 13 Aug 2019 14:43:30 +0000 (15:43 +0100)]
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>
4 years agos3/libsmb: clang: Fix 'Value stored to 'create_options' is never read'
Noel Power [Tue, 13 Aug 2019 14:36:56 +0000 (15:36 +0100)]
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>
4 years agos3/libsmb: clang: Fix 'Dereference of undefined pointer value'
Noel Power [Tue, 13 Aug 2019 14:27:35 +0000 (15:27 +0100)]
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>
4 years agos3/libsmd: clang: Fix some uninitialized value errors
Noel Power [Tue, 13 Aug 2019 14:22:37 +0000 (15:22 +0100)]
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>
4 years agos3/libsmb: clang: Fix 'Value stored to 'p' is never read'
Noel Power [Tue, 13 Aug 2019 14:18:10 +0000 (15:18 +0100)]
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>
4 years agoautobuild: rename samba-ad-member-* to samba-admem-*
Ralph Boehme [Tue, 22 Oct 2019 09:49:22 +0000 (11:49 +0200)]
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

4 years agos3: include: printing: align function parameters
Marco Wang [Wed, 28 Aug 2019 09:29:31 +0000 (17:29 +0800)]
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

4 years agos3: include: printing: fix indentation of struct printif
Marco Wang [Wed, 28 Aug 2019 09:28:26 +0000 (17:28 +0800)]
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>
4 years agos3: include: printing: move copyright notice to beginning
Marco Wang [Wed, 28 Aug 2019 09:26:14 +0000 (17:26 +0800)]
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>
4 years agos4:kdc: fix the principal names in samba_kdc_update_delegation_info_blob
Stefan Metzmacher [Thu, 28 Sep 2017 12:51:43 +0000 (14:51 +0200)]
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>
4 years agoselftest: add a test for PAC delegation-info blob in S4U2Proxy
Isaac Boukris [Sun, 13 Oct 2019 19:32:36 +0000 (22:32 +0300)]
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>
4 years agoselftest/remote_pac: split test_PACVerify() in two
Isaac Boukris [Tue, 15 Oct 2019 21:55:04 +0000 (00:55 +0300)]
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>
4 years agosmbstatus: fix column length for DenyMode
Christian Schulz [Mon, 14 Oct 2019 13:27:36 +0000 (15:27 +0200)]
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

4 years agosmbstatus: use display print function
Christian Schulz [Mon, 14 Oct 2019 13:24:20 +0000 (15:24 +0200)]
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>
4 years agos3:waf: Remove check for fdatasync
Andreas Schneider [Fri, 18 Oct 2019 11:31:38 +0000 (13:31 +0200)]
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

4 years agoautobuild: harden samba-xc test suite
Uri Simchoni [Wed, 9 Oct 2019 18:53:43 +0000 (21:53 +0300)]
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

4 years agowafsamba: pass environment to cross-execute tests
Uri Simchoni [Sun, 6 Oct 2019 21:37:41 +0000 (00:37 +0300)]
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>
4 years agowafsamba: avoid pre-forking if cross-compilation is enabled
Uri Simchoni [Sun, 6 Oct 2019 21:37:31 +0000 (00:37 +0300)]
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>
4 years agowafsamba: use test_args instead of exec_args to support cross-compilation
Uri Simchoni [Sun, 6 Oct 2019 21:37:17 +0000 (00:37 +0300)]
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>
4 years agowaf: upgrade to 2.0.18
Uri Simchoni [Sun, 6 Oct 2019 21:36:42 +0000 (00:36 +0300)]
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>
4 years agodbwrap_watch: Fix cleaning up dead watchers
Volker Lendecke [Tue, 15 Oct 2019 08:56:54 +0000 (10:56 +0200)]
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

4 years agodbwrap_watch: Test cleanup of dead watchers
Volker Lendecke [Tue, 15 Oct 2019 08:55:25 +0000 (10:55 +0200)]
dbwrap_watch: Test cleanup of dead watchers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibrpc:core: Make dcesrv_find_endpoint public
Samuel Cabrero [Thu, 3 Oct 2019 17:53:32 +0000 (19:53 +0200)]
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

4 years agolibrpc:core: Return NTSTATUS for dcesrv_find_endpoint
Samuel Cabrero [Thu, 3 Oct 2019 17:51:53 +0000 (19:51 +0200)]
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>
4 years agolibrpc:core: Rename find_endpoint to dcesrv_find_endpoint
Samuel Cabrero [Thu, 3 Oct 2019 17:46:59 +0000 (19:46 +0200)]
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>
4 years agolibrpc:core: Initialize static variable
Samuel Cabrero [Thu, 3 Oct 2019 17:44:10 +0000 (19:44 +0200)]
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>
4 years agolibrpc:core: Allocate struct dcesrv_interface with talloc
Samuel Cabrero [Tue, 1 Oct 2019 14:48:01 +0000 (16:48 +0200)]
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>
4 years agolibrpc:core: Set debug class
Samuel Cabrero [Mon, 4 Feb 2019 16:37:01 +0000 (17:37 +0100)]
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>
4 years agos4:rpc_server: Move core functions to core library
Samuel Cabrero [Thu, 3 Oct 2019 17:38:31 +0000 (19:38 +0200)]
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>
4 years agos4:rpc_server: Move core structures and prototypes to core library
Samuel Cabrero [Thu, 3 Oct 2019 16:39:58 +0000 (18:39 +0200)]
s4:rpc_server: Move core structures and prototypes 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>
4 years agolibrpc: Add new dcerpc server core library
Samuel Cabrero [Thu, 3 Oct 2019 16:05:04 +0000 (18:05 +0200)]
librpc: Add new dcerpc server core library

Next commits will move the core of s4 rpc server to this library.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Make functions public
Samuel Cabrero [Thu, 24 Jan 2019 19:55:27 +0000 (20:55 +0100)]
s4:rpc_server: Make functions public

These functions will be moved to core dcerpc library and called from
s4 and s3 implementations.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Add public function dcesrv_connection_loop_start
Samuel Cabrero [Thu, 24 Jan 2019 14:59:04 +0000 (15:59 +0100)]
s4:rpc_server: Add public function dcesrv_connection_loop_start

This function starts the server loop and will be called from 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>
4 years agos4:rpc_server: Add transport termination function pointer
Samuel Cabrero [Thu, 24 Jan 2019 19:25:58 +0000 (20:25 +0100)]
s4:rpc_server: Add transport termination function pointer

As the dcesrv_terminate_connection function will be moved to the shared
rpc server core library, hide the stream_terminate_connection call behind
a function pointer.

The s3 implementation will define its own termination function.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Find association groups through context callbacks
Samuel Cabrero [Thu, 3 Oct 2019 15:35:03 +0000 (17:35 +0200)]
s4:rpc_server: Find association groups through context callbacks

Split the association group management from the server code, the s3 and
s4 implementation will handle differently.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: inline the dcesrv_assoc_group_find function
Samuel Cabrero [Thu, 3 Oct 2019 15:26:54 +0000 (17:26 +0200)]
s4:rpc_server: inline the dcesrv_assoc_group_find function

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Hide gensec prepare behind function pointer
Samuel Cabrero [Thu, 24 Jan 2019 19:34:03 +0000 (20:34 +0100)]
s4:rpc_server: Hide gensec prepare behind function pointer

This function will be different for s3 and s4

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Add dcesrv_context_callbacks to dcesrv_context
Samuel Cabrero [Thu, 24 Jan 2019 19:03:44 +0000 (20:03 +0100)]
s4:rpc_server: Add dcesrv_context_callbacks to dcesrv_context

Add a new struct dcesrv_context_callbacks in dcesrv_context to hold pointers
to functions whose implementation will differ between S3 and S4.

The log_successful_dcesrv_authz_event implementation will differ as it
requires an imessaging_context.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Do not include s4 librpc headers in dcerpc core
Samuel Cabrero [Thu, 3 Oct 2019 14:59:49 +0000 (16:59 +0200)]
s4:rpc_server: Do not include s4 librpc headers in dcerpc core

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibrpc: Move dcerpc_log_packet from s4 librpc to common librpc
Samuel Cabrero [Thu, 24 Jan 2019 11:03:45 +0000 (12:03 +0100)]
librpc: Move dcerpc_log_packet from s4 librpc to common librpc

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibrpc: Move dcerpc_ncacn_push_auth from s4 librpc to common librpc
Samuel Cabrero [Thu, 3 Oct 2019 14:44:36 +0000 (16:44 +0200)]
librpc: Move dcerpc_ncacn_push_auth from s4 librpc to common librpc

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:librpc: Rename ncacn_push_auth to dcerpc_ncacn_push_auth
Samuel Cabrero [Thu, 3 Oct 2019 14:40:53 +0000 (16:40 +0200)]
s4:librpc: Rename ncacn_push_auth to dcerpc_ncacn_push_auth

Next commit will move this function to common librpc

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Split dcerpc_generic_session_key for server and client
Samuel Cabrero [Wed, 23 Jan 2019 19:52:50 +0000 (20:52 +0100)]
s4:rpc_server: Split dcerpc_generic_session_key for server and client

Split the common bits of dcerpc_generic_session_key to librpc and rename
client the specific part to dcecli_generic_session_key.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Remove server_id from dcerpc core structs
Samuel Cabrero [Wed, 23 Jan 2019 19:41:54 +0000 (20:41 +0100)]
s4:rpc_server: Remove server_id from dcerpc core structs

Add a helper function to retrieve it from the stream connection.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Remove imessaging_context from dcerpc core structs
Samuel Cabrero [Wed, 23 Jan 2019 19:37:21 +0000 (20:37 +0100)]
s4:rpc_server: Remove imessaging_context from dcerpc core structs

Add a helper function to retrieve the imessaging_context from the
stream connection.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Rename common/reply.c to dcesrv_reply.c
Samuel Cabrero [Thu, 24 Jan 2019 12:38:29 +0000 (13:38 +0100)]
s4:rpc_server: Rename common/reply.c to dcesrv_reply.c

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Cleanup includes
Samuel Cabrero [Mon, 30 Sep 2019 21:35:55 +0000 (23:35 +0200)]
s4:rpc_server: Cleanup includes

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:rpc_server: Fix debug string printing duplicated function name
Samuel Cabrero [Fri, 25 Jan 2019 08:54:03 +0000 (09:54 +0100)]
s4:rpc_server: Fix debug string printing duplicated function name

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:torture: Assert connection
Samuel Cabrero [Tue, 19 Feb 2019 11:43:02 +0000 (12:43 +0100)]
s4:torture: Assert connection

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:torture: Fix torture comment
Samuel Cabrero [Tue, 19 Feb 2019 11:42:11 +0000 (12:42 +0100)]
s4:torture: Fix torture comment

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:torture: Add braces
Samuel Cabrero [Tue, 19 Feb 2019 11:41:38 +0000 (12:41 +0100)]
s4:torture: Add braces

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agotstream_npa: Set local server name in auth requests
Samuel Cabrero [Mon, 30 Sep 2019 21:33:09 +0000 (23:33 +0200)]
tstream_npa: Set local server name in auth requests

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:printing: Add spoolssd header file
Samuel Cabrero [Tue, 1 Oct 2019 15:21:00 +0000 (17:21 +0200)]
s3:printing: Add spoolssd header file

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:printing: Add header inclusion guards in queue_process.h
Samuel Cabrero [Tue, 1 Oct 2019 15:14:04 +0000 (17:14 +0200)]
s3:printing: Add header inclusion guards in queue_process.h

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3:smbd: Add header inclusion guards in globals.h
Samuel Cabrero [Thu, 12 Sep 2019 17:05:57 +0000 (19:05 +0200)]
s3:smbd: Add header inclusion guards in globals.h

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolib: Explicitly refuse to truncate unix domain socket paths
Andrew Bartlett [Fri, 18 Oct 2019 08:11:13 +0000 (21:11 +1300)]
lib: Explicitly refuse to truncate unix domain socket paths

This avoids creating a socket like:

.../winbindd_privileged/p

instead of

.../winbindd_privileged/pipe

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: torture: Ensure SMB1 cli_qpathinfo2() doesn't return an inode number.
Jeremy Allison [Thu, 17 Oct 2019 19:41:08 +0000 (12:41 -0700)]
s3: torture: Ensure SMB1 cli_qpathinfo2() doesn't return an inode number.

Piggyback on existing tests, ensure we don't regress on:

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: libsmb: Ensure SMB1 cli_qpathinfo2() doesn't return an inode number.
Jeremy Allison [Thu, 17 Oct 2019 18:39:02 +0000 (11:39 -0700)]
s3: libsmb: Ensure SMB1 cli_qpathinfo2() doesn't return an inode number.

The info level it uses doesn't return that, previously we
were using the field that is returned as the EA size as
the inode number (which is usually zero, so the code in
libsmbclient would then synthesize an inode number from
a hash of the pathname, which is all it can do for SMB1).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agodsdb: Change LDB_TYPESAFE_QSORT() to TYPESAFE_QSORT() in operational module
Andrew Bartlett [Wed, 16 Oct 2019 03:47:26 +0000 (16:47 +1300)]
dsdb: Change LDB_TYPESAFE_QSORT() to TYPESAFE_QSORT() in operational module

This call does not use the context argument so no additional parameter is needed.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Oct 18 10:58:45 UTC 2019 on sn-devel-184

4 years agos4-rpc_server: Change LDB_TYPESAFE_QSORT() to TYPESAFE_QSORT() in getncchanges
Andrew Bartlett [Wed, 16 Oct 2019 03:39:35 +0000 (16:39 +1300)]
s4-rpc_server: Change LDB_TYPESAFE_QSORT() to TYPESAFE_QSORT() in getncchanges

This call does not use the context argument so no additional parameter is needed.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agodsdb: Change LDB_TYPESAFE_QSORT() to TYPESAFE_QSORT() in repl_meta_data module
Andrew Bartlett [Wed, 16 Oct 2019 03:38:38 +0000 (16:38 +1300)]
dsdb: Change LDB_TYPESAFE_QSORT() to TYPESAFE_QSORT() in repl_meta_data module

This call does not use the context argument so no additional parameter is needed.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3/dump_core: Have a newline towards the end of log message
Anoop C S [Wed, 16 Oct 2019 09:03:06 +0000 (14:33 +0530)]
s3/dump_core: Have a newline towards the end of log message

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Fri Oct 18 08:54:04 UTC 2019 on sn-devel-184

4 years agoAdd fuzzing binary for ldb_parse_tree
Michael Hanselmann [Thu, 11 Apr 2019 22:46:49 +0000 (00:46 +0200)]
Add fuzzing binary for ldb_parse_tree

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
4 years agoAdd fuzzing binary for ldap_decode
Michael Hanselmann [Tue, 9 Apr 2019 23:20:36 +0000 (01:20 +0200)]
Add fuzzing binary for ldap_decode

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
4 years agoAdd fuzzing binary for lzxpress
Michael Hanselmann [Tue, 9 Apr 2019 22:36:03 +0000 (00:36 +0200)]
Add fuzzing binary for lzxpress

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
4 years agoAdd fuzzing binary for regfio
Michael Hanselmann [Thu, 4 Apr 2019 00:26:26 +0000 (02:26 +0200)]
Add fuzzing binary for regfio

Checksums are better ignored during fuzzing, hence a flag is added to
the regfio parser to disable checksums.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
4 years agoregfio: Allow ignoring of checksum
Michael Hanselmann [Mon, 23 Sep 2019 21:53:55 +0000 (21:53 +0000)]
regfio: Allow ignoring of checksum

In order to get good coverage fuzzing code has to either calculate
checksums correctly or to disable their verification. This change
implements the latter for the "REGF_FILE" structure used by the
"regfio_*" family of functions.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
4 years agoAdd fuzzing binary for reg_parse
Michael Hanselmann [Thu, 4 Apr 2019 22:50:09 +0000 (00:50 +0200)]
Add fuzzing binary for reg_parse

A temporary file is used to store the fuzzing input.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
4 years agoBuild registry parsing code into subsystem
Michael Hanselmann [Mon, 23 Sep 2019 21:47:51 +0000 (21:47 +0000)]
Build registry parsing code into subsystem

Fuzzing code will make use of the "reg_parse_fd" function. By building
it into the "SMBREGISTRY" subsystem it can just be linked and
"reg_parse.c" doesn't need to be explicitly included.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
4 years agosamba-tool: Add facility to add rfc2307 attributes to an already created user or...
Rowland Penny [Tue, 2 Jul 2019 12:41:34 +0000 (13:41 +0100)]
samba-tool: Add facility to add rfc2307 attributes to an already created user or group

Signed-off-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Oct 17 12:21:55 UTC 2019 on sn-devel-184

4 years agosamba-tool: Update 'samba-tool gpo list <>' description
Amit Kumar [Thu, 27 Jun 2019 23:21:57 +0000 (04:51 +0530)]
samba-tool: Update 'samba-tool gpo list <>' description

We have a command to get gpo listing from Active Directory.
samba-tool gpo list <username>

This command can list GPOs for both username and machinename,
But command help only shows 'username'.

This PR
- Updates the option presented in help.
- Updates name of variable used to retrieve GPO so that it's
 not misleading if someone reads code later on

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-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): Thu Oct 17 09:21:20 UTC 2019 on sn-devel-184

4 years agodocs: modifies 'net ads dns gethostbyname -h' Changes server to nameserver and name...
Amit Kumar [Fri, 27 Sep 2019 06:42:20 +0000 (01:42 -0500)]
docs: modifies 'net ads dns gethostbyname -h' Changes server to nameserver and name to hostname.

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

Signed-off-by: Amit Kumar amitkuma@redhat.com
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agodocs: Add 'ads dns command' text in man net
Amit Kumar [Tue, 25 Jun 2019 19:48:52 +0000 (01:18 +0530)]
docs: Add 'ads dns command' text in man net

This change adds contents to man net for 'ads dns' command set.

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agolibcli smb smb1cli_trans: fix ubsan warning
Gary Lockyer [Wed, 5 Jun 2019 20:40:42 +0000 (08:40 +1200)]
libcli smb smb1cli_trans: fix ubsan warning

Fix ubsan warning null pointer passed as argument 2 when the source
pointer is NULL.  The calls to memcpy are now guarded by an
if (len > 0)

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 16 18:00:31 UTC 2019 on sn-devel-184

4 years agodocs: Add 'net gpo command' text in man net
Amit Kumar [Wed, 5 Jun 2019 20:24:31 +0000 (01:54 +0530)]
docs: Add 'net gpo command' text in man net

This change adds contents to man net for 'net ads gpo' command
set based on results got after executing:
'# net ads gpo help' and subcommands

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3:winbind: Don't abort when receiving a NULL SID
Amit Kumar [Fri, 31 May 2019 13:27:52 +0000 (18:57 +0530)]
s3:winbind: Don't abort when receiving a NULL SID

Source code in winbind_rpc.c states that if the trusted domain
has no SID, winbindd just aborts the session. This happens with
MIT Kerberos realm added as trust to AD and winbindd just returns
without processing further as there is no SID returned for the
Linux system having kerberos support.

This fix makes winbindd to skip the domain having NULL SID instead
of aborting the request completely.

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoselftest: Disable RTLD_DEEPBIND if running with ASAN
Gary Lockyer [Mon, 20 May 2019 20:49:08 +0000 (08:49 +1200)]
selftest: Disable RTLD_DEEPBIND if running with ASAN

Disable the RTLD_DEEPBIND option for dlopen in LDB and Socket Wrapper when
running with  AddressSanitizer. The RTLD_DEEPBIND option is not compatible
with Address Sanitizer see
https://github.com/google/sanitizers/issues/611

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 16 15:41:41 UTC 2019 on sn-devel-184

4 years agos3:tests: Add smbspool test for CUPS-like "sanitized" Device URI in argv[0]
Bryan Mason [Thu, 26 Sep 2019 01:49:56 +0000 (18:49 -0700)]
s3:tests: Add smbspool test for CUPS-like "sanitized" Device URI in argv[0]

Before calling a backend like smbspool, CUPS will set argv[0] to the
"sanitized" Device URI (the Device URI with username/password
information removed).  These changes are intended to catch problems
with smbspool that may be created by this behavior (like
https://bugzilla.samba.org/show_bug.cgi?id=14128).

source3/script/tests/smbspool_argv_wrapper.c: added to emulate
CUPS-like behavior by setting argv[0] to the device URI before
exec()ing smbspool.

source3/script/tests/test_smbspool.sh: updated to use
smbspool_argv_wrapper to test the CUPS-like behavior described above.

Signed-off-by: Bryan Mason <bmason@redhat.com>
Reviewed-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 16 10:55:04 UTC 2019 on sn-devel-184

4 years agos3:libsmb: Link libsmb against pthread
Isaac Boukris [Tue, 15 Oct 2019 14:01:48 +0000 (17:01 +0300)]
s3:libsmb: Link libsmb against pthread

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

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agonsswitch: Link stress-nss-libwbclient against pthread
Isaac Boukris [Tue, 15 Oct 2019 10:52:42 +0000 (13:52 +0300)]
nsswitch: Link stress-nss-libwbclient against pthread

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

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agos3: VFS: Complete the removal of SMB_VFS_CHOWN()
Jeremy Allison [Thu, 10 Oct 2019 21:35:37 +0000 (14:35 -0700)]
s3: VFS: Complete the removal of SMB_VFS_CHOWN()

No longer used anywhere.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 15 20:07:51 UTC 2019 on sn-devel-184

4 years agos3: VFS: vfs_full_audit: Remove chown_fn(). No longer used.
Jeremy Allison [Thu, 10 Oct 2019 21:30:42 +0000 (14:30 -0700)]
s3: VFS: vfs_full_audit: Remove chown_fn(). No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the chown_fn() from the VFS definitions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>