]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
5 years agopython/tests/krb5: add simple_tests.py with the first simple test
Stefan Metzmacher [Thu, 13 Feb 2020 15:29:38 +0000 (16:29 +0100)] 
python/tests/krb5: add simple_tests.py with the first simple test

This just demonstrates that the infrastructure works:-)

I'm running this as:

  SERVER=172.31.9.188 DOMAIN=W2012R2-L6 REALM=W2012R2-L6.BASE \
  USERNAME=administrator PASSWORD=A1b2C3d4 SERVICE_USERNAME="w2012r2-188" \
  python/samba/tests/krb5/simple_tests.py

Pair-Programmed-With: Isaac Boukris <iboukris@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agopython/tests/krb5: add raw_testcase.py as the base for our Kerberos protocol testing
Stefan Metzmacher [Thu, 13 Feb 2020 15:29:38 +0000 (16:29 +0100)] 
python/tests/krb5: add raw_testcase.py as the base for our Kerberos protocol testing

Pair-Programmed-With: Isaac Boukris <iboukris@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agopython/tests/krb5: modify rfc4120.asn1 in order to generate pyasn1 code
Stefan Metzmacher [Thu, 13 Feb 2020 15:29:38 +0000 (16:29 +0100)] 
python/tests/krb5: modify rfc4120.asn1 in order to generate pyasn1 code

The pyasn1 bindings are generated by pyasn1gen.py from
https://github.com/kimgr/asn1ate.git

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agopython/tests/krb5: add rfc4120.asn1
Stefan Metzmacher [Thu, 13 Feb 2020 15:29:38 +0000 (16:29 +0100)] 
python/tests/krb5: add rfc4120.asn1

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agopython/tests/krb5: add support for Cksumtype.MD5
Stefan Metzmacher [Mon, 23 Mar 2020 07:53:54 +0000 (08:53 +0100)] 
python/tests/krb5: add support for Cksumtype.MD5

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agos4:selftest: run samba.tests.krb5.kcrypto test
Stefan Metzmacher [Wed, 25 Mar 2020 21:07:39 +0000 (22:07 +0100)] 
s4:selftest: run samba.tests.krb5.kcrypto test

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agopython/tests/krb5: convert kcrypto.py to python3-cryptography and a few Samba helpers
Stefan Metzmacher [Fri, 20 Mar 2020 11:47:39 +0000 (12:47 +0100)] 
python/tests/krb5: convert kcrypto.py to python3-cryptography and a few Samba helpers

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agopython/tests/krb5: add crypto.py from greghudson/pyk5 as kcrypto.py
Isaac Boukris [Sat, 15 Feb 2020 17:33:33 +0000 (18:33 +0100)] 
python/tests/krb5: add crypto.py from greghudson/pyk5 as kcrypto.py

This is crypto.py of commit f0612aa908062fb239d1c3873595e7204ae1691d
from https://github.com/greghudson/pyk5.git

This will be used in order to do raw protocol testing against
[MS-KILE] KDCs.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agopython/tests: let usage.py be more verbose on errors
Stefan Metzmacher [Tue, 24 Mar 2020 13:02:58 +0000 (14:02 +0100)] 
python/tests: let usage.py be more verbose on errors

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agobootstrap: add python3-pyasn1/python3-cryptography for kerberos testing
Stefan Metzmacher [Tue, 24 Mar 2020 14:36:48 +0000 (15:36 +0100)] 
bootstrap: add python3-pyasn1/python3-cryptography for kerberos testing

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agobootstrap: add ubuntu2004 Ubuntu Focal Fossa (development branch)
Stefan Metzmacher [Wed, 25 Mar 2020 21:17:46 +0000 (22:17 +0100)] 
bootstrap: add ubuntu2004 Ubuntu Focal Fossa (development branch)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agoselftest: we no longer need '--use-dns-faking' on Linux and FreeBSD
Stefan Metzmacher [Wed, 23 Jan 2019 23:23:34 +0000 (00:23 +0100)] 
selftest: we no longer need '--use-dns-faking' on Linux and FreeBSD

For now I'll leave it arround for others I haven't tested.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Mar 27 10:39:32 UTC 2020 on sn-devel-184

5 years agoselftest: use 10.53.57.0/8 instead of 127.0.0.1/8
Stefan Metzmacher [Wed, 23 Jan 2019 21:29:19 +0000 (22:29 +0100)] 
selftest: use 10.53.57.0/8 instead of 127.0.0.1/8

This makes our testing much more realistic and allows
the removal of some knowfail entries.

It also means the testing with network namespaces on Linux
can use the same addresses as our socket wrapper testing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: pass ipv4 and ipv6 listener addresses to dns_hub.py
Stefan Metzmacher [Wed, 11 Mar 2020 16:03:01 +0000 (17:03 +0100)] 
selftest: pass ipv4 and ipv6 listener addresses to dns_hub.py

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: let realm_to_ip_mappings() return stable (sorted) results
Stefan Metzmacher [Wed, 11 Mar 2020 15:57:02 +0000 (16:57 +0100)] 
selftest: let realm_to_ip_mappings() return stable (sorted) results

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: {offlinebackupdc,restoredc,customdc} are disconnected from other environments
Stefan Metzmacher [Thu, 31 Oct 2019 14:39:53 +0000 (15:39 +0100)] 
selftest: {offlinebackupdc,restoredc,customdc} are disconnected from other environments

These restore copies of others and better use their own resolv.conf
and use '--use-samba-tool --no-credentials' for samba_dnsupdate in order
to avoid talking to the real environments.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: correctly use RESOLV_CONF from the DC environment or "no_resolv.conf"
Stefan Metzmacher [Thu, 27 Feb 2020 11:33:48 +0000 (12:33 +0100)] 
selftest: correctly use RESOLV_CONF from the DC environment or "no_resolv.conf"

It's important to have the correct $resolv_conf variable within
provision(), because it also sets "RESOLV_WRAPPER_CONF" if needed,
instead of just setting "RESOLV_CONF".

There's also no point in creating an resolv.conf with the ip addresses
for other roles than "active directory domain controller".

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: always explicitly use RESOLV_CONF
Stefan Metzmacher [Wed, 30 Oct 2019 17:17:36 +0000 (18:17 +0100)] 
selftest: always explicitly use RESOLV_CONF

By default point RESOLV_CONF to a non-existing file and
use the per environment RESOLV_CONF explicitly where needed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: split out Samba::mk_resolv_conf() helper
Stefan Metzmacher [Thu, 31 Oct 2019 14:37:40 +0000 (15:37 +0100)] 
selftest: split out Samba::mk_resolv_conf() helper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: we have a global $ENV{UID_WRAPPER} = 1, don't set it again
Stefan Metzmacher [Thu, 27 Feb 2020 11:30:43 +0000 (12:30 +0100)] 
selftest: we have a global $ENV{UID_WRAPPER} = 1, don't set it again

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: let get_env_for_process() include RESOLV_CONF
Stefan Metzmacher [Thu, 27 Feb 2020 10:21:51 +0000 (11:21 +0100)] 
selftest: let get_env_for_process() include RESOLV_CONF

This is needed for all environments not just "samba".

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: handle proc{killdom,limit}.samba.example.com in dns_hub
Stefan Metzmacher [Thu, 27 Feb 2020 00:47:31 +0000 (01:47 +0100)] 
selftest: handle proc{killdom,limit}.samba.example.com in dns_hub

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: allow dns_hub.py to do forwarding to ipv6 servers
Stefan Metzmacher [Wed, 11 Mar 2020 16:09:13 +0000 (17:09 +0100)] 
selftest: allow dns_hub.py to do forwarding to ipv6 servers

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: allow dns_hub.py to listen on more than one address
Stefan Metzmacher [Wed, 11 Mar 2020 15:55:33 +0000 (16:55 +0100)] 
selftest: allow dns_hub.py to listen on more than one address

This makes it possible to serve ipv4 and ipv6 at the same time.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoselftest: make sure dns_hub.py exits on SIGINT
Stefan Metzmacher [Fri, 13 Mar 2020 06:06:05 +0000 (07:06 +0100)] 
selftest: make sure dns_hub.py exits on SIGINT

Otherwise we have a deadlock in the python threading
that prevents out EOF detection on stdin to work
if someone aborts 'make test' with strg+c.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agosamba_dnsupdate: fix delete (samba-tool) message
Stefan Metzmacher [Tue, 5 Nov 2019 10:25:52 +0000 (11:25 +0100)] 
samba_dnsupdate: fix delete (samba-tool) message

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agosamba_dnsupdate: fix --no-credentials handling
Stefan Metzmacher [Tue, 5 Nov 2019 10:25:14 +0000 (11:25 +0100)] 
samba_dnsupdate: fix --no-credentials handling

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agopython/netcmd/dns: improve exception handling in cmd_add_record()
Stefan Metzmacher [Tue, 5 Nov 2019 10:23:48 +0000 (11:23 +0100)] 
python/netcmd/dns: improve exception handling in cmd_add_record()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agopython/netcmd/dns: improve exception handling in cmd_delete_record()
Stefan Metzmacher [Tue, 5 Nov 2019 10:23:48 +0000 (11:23 +0100)] 
python/netcmd/dns: improve exception handling in cmd_delete_record()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agolibrpc/tests: make use of replace.h in test_ndr*.c
Stefan Metzmacher [Thu, 27 Feb 2020 00:51:18 +0000 (01:51 +0100)] 
librpc/tests: make use of replace.h in test_ndr*.c

This fixes the build on FreeBSD 12.1 and maybe other systems.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos4:torture/ldb: fix the build on FreeBSD
Stefan Metzmacher [Wed, 6 Nov 2019 07:49:30 +0000 (08:49 +0100)] 
s4:torture/ldb: fix the build on FreeBSD

clock_t is 'int' instead' of 'long' there.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos3:util_sec: fix the build on non-linux platforms
Stefan Metzmacher [Wed, 6 Nov 2019 07:47:31 +0000 (08:47 +0100)] 
s3:util_sec: fix the build on non-linux platforms

This fixes a regression introduced by
"util_sec.c: Move __thread variable to global scope"
(5a80f399b51221fb0b8661f30d940ca24e1ce627).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agosmbd: use a helper variable in filename_convert_internal()
Ralph Boehme [Thu, 26 Mar 2020 14:08:53 +0000 (15:08 +0100)] 
smbd: use a helper variable in filename_convert_internal()

Avoids the complicated pointer-to-pointer dereferencing.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 27 02:41:39 UTC 2020 on sn-devel-184

5 years agosmbd: use filename_convert() in smb_file_rename_information()
Ralph Boehme [Thu, 26 Mar 2020 13:49:33 +0000 (14:49 +0100)] 
smbd: use filename_convert() in smb_file_rename_information()

Replaces direct calls to resolve_dfspath_wcard() and filename_convert(). On the
way to consolidate all callers of pathname processing onto filename_convert().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: modernize DEBUG in unix_convert()
Ralph Boehme [Wed, 25 Mar 2020 18:00:32 +0000 (19:00 +0100)] 
smbd: modernize DEBUG in unix_convert()

I'm also consolidating on level 10 instead of 5 for "debug" level messages, as
that what's tend to be the canonical debug level these days.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: turn (*orig_path != '/') assert into a normal if check
Ralph Boehme [Wed, 25 Mar 2020 06:56:37 +0000 (07:56 +0100)] 
smbd: turn (*orig_path != '/') assert into a normal if check

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: consolidate comments in unix_convert()
Ralph Boehme [Wed, 25 Mar 2020 06:53:29 +0000 (07:53 +0100)] 
smbd: consolidate comments in unix_convert()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: modernize unix_convert() replacing True with true
Ralph Boehme [Wed, 25 Mar 2020 06:48:16 +0000 (07:48 +0100)] 
smbd: modernize unix_convert() replacing True with true

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: modernize unix_convert() replacing False with false
Ralph Boehme [Wed, 25 Mar 2020 06:47:22 +0000 (07:47 +0100)] 
smbd: modernize unix_convert() replacing False with false

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: initialize end to NULL in unix_convert()
Ralph Boehme [Wed, 25 Mar 2020 06:46:22 +0000 (07:46 +0100)] 
smbd: initialize end to NULL in unix_convert()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: leave start at NULL, it's not used before being set to smbfname->basename
Ralph Boehme [Wed, 25 Mar 2020 06:45:43 +0000 (07:45 +0100)] 
smbd: leave start at NULL, it's not used before being set to smbfname->basename

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotdbtorture: Use ARRAY_DEL_ELEMENT()
Volker Lendecke [Thu, 26 Mar 2020 10:15:28 +0000 (11:15 +0100)] 
tdbtorture: Use ARRAY_DEL_ELEMENT()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar 26 16:22:00 UTC 2020 on sn-devel-184

5 years agoldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_set_extended_component()
Volker Lendecke [Thu, 26 Mar 2020 10:12:55 +0000 (11:12 +0100)] 
ldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_set_extended_component()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_extended_filter()
Volker Lendecke [Thu, 26 Mar 2020 10:11:35 +0000 (11:11 +0100)] 
ldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_extended_filter()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoldb: Use ARRAY_DEL_ELEMENT() in ldb_kv_index_del_value()
Volker Lendecke [Thu, 26 Mar 2020 10:08:07 +0000 (11:08 +0100)] 
ldb: Use ARRAY_DEL_ELEMENT() in ldb_kv_index_del_value()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoldb: Use ARRAY_DEL_ELEMENT() in ldb_kv_msg_delete_element()
Volker Lendecke [Thu, 26 Mar 2020 10:06:23 +0000 (11:06 +0100)] 
ldb: Use ARRAY_DEL_ELEMENT() in ldb_kv_msg_delete_element()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolibcli: Use ARRAY_DEL_ELEMENT() in security_descriptor_acl_del()
Volker Lendecke [Thu, 26 Mar 2020 10:04:31 +0000 (11:04 +0100)] 
libcli: Use ARRAY_DEL_ELEMENT() in security_descriptor_acl_del()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agodsdb: Use ARRAY_DEL_ELEMENT() in dirsync_filter_entry()
Volker Lendecke [Thu, 26 Mar 2020 10:02:02 +0000 (11:02 +0100)] 
dsdb: Use ARRAY_DEL_ELEMENT() in dirsync_filter_entry()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agovfs_fruit: Use ARRAY_DEL_ELEMENT() in del_fruit_stream()
Volker Lendecke [Thu, 26 Mar 2020 09:41:30 +0000 (10:41 +0100)] 
vfs_fruit: Use ARRAY_DEL_ELEMENT() in del_fruit_stream()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agovfs_fruit: Use ARRAY_DEL_ELEMENT() in filter_empty_rsrc_stream()
Volker Lendecke [Thu, 26 Mar 2020 09:39:24 +0000 (10:39 +0100)] 
vfs_fruit: Use ARRAY_DEL_ELEMENT() in filter_empty_rsrc_stream()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolibsmb: Use ARRAY_DEL_ELEMENT() in remove_duplicate_addrs2()
Volker Lendecke [Thu, 26 Mar 2020 09:36:19 +0000 (10:36 +0100)] 
libsmb: Use ARRAY_DEL_ELEMENT() in remove_duplicate_addrs2()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Use ARRAY_DEL_ELEMENT() in merge_default_aces()
Volker Lendecke [Thu, 26 Mar 2020 09:34:09 +0000 (10:34 +0100)] 
smbd: Use ARRAY_DEL_ELEMENT() in merge_default_aces()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Use ARRAY_DEL_ELEMENT() in smbd_smb1_blocked_locks_cleanup()
Volker Lendecke [Thu, 26 Mar 2020 09:31:47 +0000 (10:31 +0100)] 
smbd: Use ARRAY_DEL_ELEMENT() in smbd_smb1_blocked_locks_cleanup()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Use ARRAY_DEL_ELEMENT() in brl_unlock_windows_default()
Volker Lendecke [Wed, 25 Mar 2020 21:37:34 +0000 (22:37 +0100)] 
smbd: Use ARRAY_DEL_ELEMENT() in brl_unlock_windows_default()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbcacls: Use ARRAY_DEL_ELEMENT() in sort_acl()
Volker Lendecke [Thu, 26 Mar 2020 10:39:56 +0000 (11:39 +0100)] 
smbcacls: Use ARRAY_DEL_ELEMENT() in sort_acl()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosharesec: Use ARRAY_DEL_ELEMENT() in sort_acl()
Volker Lendecke [Thu, 26 Mar 2020 10:39:08 +0000 (11:39 +0100)] 
sharesec: Use ARRAY_DEL_ELEMENT() in sort_acl()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolibsmb: Use ARRAY_DEL_ELEMENT() in sort_acl()
Volker Lendecke [Wed, 25 Mar 2020 21:36:48 +0000 (22:36 +0100)] 
libsmb: Use ARRAY_DEL_ELEMENT() in sort_acl()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolib: Use ARRAY_DEL_ELEMENT in messaging_dispatch_waiters()
Volker Lendecke [Wed, 25 Mar 2020 21:25:06 +0000 (22:25 +0100)] 
lib: Use ARRAY_DEL_ELEMENT in messaging_dispatch_waiters()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolib: Add macro ARRAY_DEL_ELEMENT()
Volker Lendecke [Wed, 25 Mar 2020 21:07:44 +0000 (22:07 +0100)] 
lib: Add macro ARRAY_DEL_ELEMENT()

Every time I have to remove an element from within an array I have to
scratch my head about the memmove arguments. Make this easier to use.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agolib: Try nonblocking writes in writev_send()
Volker Lendecke [Thu, 19 Mar 2020 16:00:59 +0000 (17:00 +0100)] 
lib: Try nonblocking writes in writev_send()

All callers now use nonblocking sockets, so that we can optimize by
doing early writes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Mar 25 10:41:29 UTC 2020 on sn-devel-184

5 years agolib: Use optimize_empty in writev_send()
Volker Lendecke [Thu, 12 Mar 2020 15:20:25 +0000 (16:20 +0100)] 
lib: Use optimize_empty in writev_send()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agowinbind: Set the parent->child sock nonblocking
Volker Lendecke [Fri, 20 Mar 2020 11:17:08 +0000 (12:17 +0100)] 
winbind: Set the parent->child sock nonblocking

The parent goes through wb_simple_trans_send(), which deals with short
writes fine.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolibsmb: Make sure that the TCP socket is non-blocking
Volker Lendecke [Fri, 20 Mar 2020 10:46:43 +0000 (11:46 +0100)] 
libsmb: Make sure that the TCP socket is non-blocking

All traffic goes through smbXcli_base.c, and that is prepared to deal
with short writes via the conn->outgoing queue. Instead of making sure
that all callers properly set the socket nonblocking, do it here, so
that we can later optimize sending out data to the server.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolib: Remove unused SOCKET_FLAG_BLOCK
Volker Lendecke [Fri, 20 Mar 2020 10:31:15 +0000 (11:31 +0100)] 
lib: Remove unused SOCKET_FLAG_BLOCK

Nobody in the code set this flag, so remove it

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolib: Simplify writev_cancel()
Volker Lendecke [Thu, 12 Mar 2020 10:42:41 +0000 (11:42 +0100)] 
lib: Simplify writev_cancel()

We can only reasonably cancel a writev request that is still
queued. Once writing has started, cancel is pointless. Simplify the
if-conditions.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agothird_party: Update resolv_wrapper to version 1.1.6
Stefan Metzmacher [Wed, 18 Mar 2020 13:51:12 +0000 (14:51 +0100)] 
third_party: Update resolv_wrapper to version 1.1.6

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Mar 25 08:33:17 UTC 2020 on sn-devel-184

5 years agothird_party: Update socket_wrapper to version 1.2.4
Stefan Metzmacher [Tue, 10 Mar 2020 12:27:27 +0000 (13:27 +0100)] 
third_party: Update socket_wrapper to version 1.2.4

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agothird_party: Update pam_wrapper to version 1.1.2
Andreas Schneider [Fri, 20 Mar 2020 14:25:47 +0000 (15:25 +0100)] 
third_party: Update pam_wrapper to version 1.1.2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agovfs: remove SMB_VFS_OPENDIR()
Ralph Boehme [Mon, 23 Mar 2020 09:44:08 +0000 (10:44 +0100)] 
vfs: remove SMB_VFS_OPENDIR()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 24 21:23:43 UTC 2020 on sn-devel-184

5 years agosmbd: use open_internal_dirfsp_at() and OpenDir_fsp() in OpenDir()
Ralph Boehme [Wed, 18 Mar 2020 15:01:17 +0000 (16:01 +0100)] 
smbd: use open_internal_dirfsp_at() and OpenDir_fsp() in OpenDir()

This allows consolidating symlink safe processing of pathnames to the low-level
function non_widelink_open() used in the file open codepath via fd_open() and
the new utility function open_internal_dirfsp_at().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: add open_internal_dirfsp_at()
Ralph Boehme [Mon, 16 Mar 2020 17:53:15 +0000 (18:53 +0100)] 
smbd: add open_internal_dirfsp_at()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: reformat OpenDir() function definition
Ralph Boehme [Mon, 23 Mar 2020 12:56:49 +0000 (13:56 +0100)] 
smbd: reformat OpenDir() function definition

Gives a nicer diff in the next commit. No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: update smb_Dir_destructor() to cope with fsp->dptr not being set
Ralph Boehme [Wed, 18 Mar 2020 17:25:33 +0000 (18:25 +0100)] 
smbd: update smb_Dir_destructor() to cope with fsp->dptr not being set

Currently the only caller of OpenDir_fsp() is dptr_create() which means
fsp->dptr will always be set by dptr_create().

A subsequent commit will add another caller so that fsp->dptr will end up being
NULL.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: remove fdopendir() fallback
Ralph Boehme [Wed, 18 Mar 2020 14:59:11 +0000 (15:59 +0100)] 
smbd: remove fdopendir() fallback

In order to get rid of SMB_VFS_OPENDIR, we have to require
fdopendir(). Everybody but macOS seems to have it, so RIP opendir() fallback.

This also prepares for a subsequent commit where we're going to start calling
OpenDir_fsp() from inside OpenDir(). Without removing the fallback this would
result in a recursion.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: simplify non_widelink_open()
Ralph Boehme [Tue, 17 Mar 2020 16:35:44 +0000 (17:35 +0100)] 
smbd: simplify non_widelink_open()

As fsp->is_directory is already correctly populated by our callers, we can drop
the complicated and possibly broken logic that relies on O_DIRECTORY being
defined.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_shadow_copy2: use create_internal_dirfsp_at() and SMB_VFS_FDOPENDIR()
Ralph Boehme [Sun, 22 Mar 2020 11:21:10 +0000 (12:21 +0100)] 
vfs_shadow_copy2: use create_internal_dirfsp_at() and SMB_VFS_FDOPENDIR()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: add create_internal_dirfsp_at()
Ralph Boehme [Mon, 23 Mar 2020 10:36:42 +0000 (11:36 +0100)] 
smbd: add create_internal_dirfsp_at()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_shadow_copy: use OpenDir() in shadow_copy_get_shadow_copy_data()
Ralph Boehme [Thu, 19 Mar 2020 11:03:27 +0000 (12:03 +0100)] 
vfs_shadow_copy: use OpenDir() in shadow_copy_get_shadow_copy_data()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_streams_depot: use OpenDir() in walk_streams()
Ralph Boehme [Thu, 19 Mar 2020 11:03:27 +0000 (12:03 +0100)] 
vfs_streams_depot: use OpenDir() in walk_streams()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: use OpenDir() in fruit_disk_free()
Ralph Boehme [Thu, 19 Mar 2020 11:03:27 +0000 (12:03 +0100)] 
vfs_fruit: use OpenDir() in fruit_disk_free()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: pass e->d_name directly to fruit_tmsize_do_dirent()
Ralph Boehme [Thu, 19 Mar 2020 11:42:45 +0000 (12:42 +0100)] 
vfs_fruit: pass e->d_name directly to fruit_tmsize_do_dirent()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: let fruit_get_num_bands() take bundle as const
Ralph Boehme [Thu, 19 Mar 2020 11:39:44 +0000 (12:39 +0100)] 
vfs_fruit: let fruit_get_num_bands() take bundle as const

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: use OpenDir() instead of SMB_VFS_OPENDIR() in fruit_get_num_bands()
Ralph Boehme [Thu, 19 Mar 2020 11:03:27 +0000 (12:03 +0100)] 
vfs_fruit: use OpenDir() instead of SMB_VFS_OPENDIR() in fruit_get_num_bands()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_ceph_snapshots: use OpenDir() in ceph_snap_gmt_convert_dir()
Ralph Boehme [Thu, 19 Mar 2020 11:03:27 +0000 (12:03 +0100)] 
vfs_ceph_snapshots: use OpenDir() in ceph_snap_gmt_convert_dir()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_ceph_snapshots: use OpenDir() in ceph_snap_enum_snapdir()
Ralph Boehme [Thu, 19 Mar 2020 11:03:27 +0000 (12:03 +0100)] 
vfs_ceph_snapshots: use OpenDir() in ceph_snap_enum_snapdir()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfstest: use OpenDir()
Ralph Boehme [Wed, 18 Mar 2020 16:40:29 +0000 (17:40 +0100)] 
vfstest: use OpenDir()

Note that as ReadDirName() returns translated names (in Windows "encoding"), in
cmd_translate_name() test we have to translate back to UNIX "encoding" to check
if the filename matches the user requested path which is also in UNIX
"encoding".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: use canonicalize_connect_path() in create_conn_struct_as_root()
Ralph Boehme [Thu, 19 Mar 2020 10:19:48 +0000 (11:19 +0100)] 
smbd: use canonicalize_connect_path() in create_conn_struct_as_root()

This fix ensures create_conn_struct_as_root() works the same way as
make_connection_snum() used in smbd for SMB sessions. Without this any caller of
create_conn_struct_as_root() will fail to use work on shares if the sharepath
contains a symlink.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: make canonicalize_connect_path() public
Ralph Boehme [Thu, 19 Mar 2020 10:19:34 +0000 (11:19 +0100)] 
smbd: make canonicalize_connect_path() public

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: use OpenDir() in form_junctions()
Ralph Boehme [Wed, 18 Mar 2020 15:12:09 +0000 (16:12 +0100)] 
smbd: use OpenDir() in form_junctions()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: use OpenDir() in count_dfs_links()
Ralph Boehme [Wed, 18 Mar 2020 11:05:06 +0000 (12:05 +0100)] 
smbd: use OpenDir() in count_dfs_links()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: move fruit_unlink_internal() back into fruit_unlinkat()
Ralph Boehme [Thu, 19 Mar 2020 13:07:23 +0000 (14:07 +0100)] 
vfs_fruit: move fruit_unlink_internal() back into fruit_unlinkat()

I think this makes fruit_unlinkat() easier to read. No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_fruit: remove internal directory cleanup logic
Ralph Boehme [Tue, 17 Mar 2020 18:03:53 +0000 (19:03 +0100)] 
vfs_fruit: remove internal directory cleanup logic

Currently fruit does a cleanup run on a directory when it is being removed: it
lists the directory and does an explicit unlink on any found file that is a
genuine AppleDouble file.

This is not realy needed: the ._ AppleDouble sidecar files are either vetoed by
default, so cleanup can be turned on by the built-in "delete veto files"
options. Or, if the user sets "fruit:veto_appledouble", the client will see the
file in a directory list as ordinary files, so the client is responsible for
deleting them first before removing the parent directory.

tl;dr

One caller of SMB_VFS_OPENDIR() less. :)

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoselftest: Fix string compare in DnsHandler() of dns_hub.py
Andreas Schneider [Fri, 13 Mar 2020 14:15:53 +0000 (15:15 +0100)] 
selftest: Fix string compare in DnsHandler() of dns_hub.py

dns_hub.py:115: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if forwarder is 'ignore':
dns_hub.py:117: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif forwarder is 'fail':

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Mar 24 14:31:25 UTC 2020 on sn-devel-184

5 years agoctdb-recoverd: Avoid dereferencing NULL rec->nodemap
Martin Schwenke [Sun, 22 Mar 2020 02:46:46 +0000 (13:46 +1100)] 
ctdb-recoverd: Avoid dereferencing NULL rec->nodemap

Inside the nested event loop in ctdb_ctrl_getnodemap(), various
asynchronous handlers may dereference rec->nodemap, which will be
NULL.

One example is lost_reclock_handler(), which causes rec->nodemap to be
unconditionally dereferenced in list_of_nodes() via this call chain:

  list_of_nodes()
  list_of_active_nodes()
  set_recovery_mode()
  force_election()
  lost_reclock_handler()

Instead of attempting to trace all of the cases, just avoid leaving
rec->nodemap set to NULL.  Attempting to use an old value is generally
harmless, especially since it will be the same as the new value in
most cases.

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

Reported-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Mar 24 01:22:45 UTC 2020 on sn-devel-184

5 years agoctdb-daemon: Don't allow attach from recovery if recovery is not active
Martin Schwenke [Tue, 25 Feb 2020 06:32:56 +0000 (17:32 +1100)] 
ctdb-daemon: Don't allow attach from recovery if recovery is not active

Neither the recovery daemon nor the recovery helper should attach
databases outside of the recovery process.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-daemon: Remove more unused old client database functions
Martin Schwenke [Mon, 24 Feb 2020 19:20:32 +0000 (06:20 +1100)] 
ctdb-daemon: Remove more unused old client database functions

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-recovery: Remove old code for creating missing databases
Martin Schwenke [Mon, 24 Feb 2020 08:51:19 +0000 (19:51 +1100)] 
ctdb-recovery: Remove old code for creating missing databases

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-recovery: Create database on nodes where it is missing
Martin Schwenke [Mon, 24 Feb 2020 00:31:33 +0000 (11:31 +1100)] 
ctdb-recovery: Create database on nodes where it is missing

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-recovery: Fetch database name from all nodes where it is attached
Martin Schwenke [Sun, 23 Feb 2020 23:26:34 +0000 (10:26 +1100)] 
ctdb-recovery: Fetch database name from all nodes where it is attached

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-recovery: Pass db structure for each database recovery
Martin Schwenke [Fri, 21 Feb 2020 05:51:10 +0000 (16:51 +1100)] 
ctdb-recovery: Pass db structure for each database recovery

Instead of db_id and db_flags.

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

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