From fd5746f1d1f261eab23c0761d4c65a1d1799dbe5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 16 Aug 2018 13:12:36 +0200 Subject: [PATCH 01/76] Fix python3 packaging --- samba-4.9.0rc3-fix-python37.patch | 26 ++++++++++++++++++++++++++ samba.spec | 15 ++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 samba-4.9.0rc3-fix-python37.patch diff --git a/samba-4.9.0rc3-fix-python37.patch b/samba-4.9.0rc3-fix-python37.patch new file mode 100644 index 0000000..763fef1 --- /dev/null +++ b/samba-4.9.0rc3-fix-python37.patch @@ -0,0 +1,26 @@ +From 8bc323356f1f1fe689d423a2c836aebac459b9f4 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 17 Aug 2018 12:06:38 +0200 +Subject: [PATCH] python: Fix print in dns_invalid.py + +Signed-off-by: Andreas Schneider +--- + python/samba/tests/dns_invalid.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/python/samba/tests/dns_invalid.py b/python/samba/tests/dns_invalid.py +index 9f87cd56084..46611eb57a0 100644 +--- a/python/samba/tests/dns_invalid.py ++++ b/python/samba/tests/dns_invalid.py +@@ -76,7 +76,7 @@ class TestBrokenQueries(DNSTest): + + name = "\x10\x11\x05\xa8.%s" % self.get_dns_domain() + q = self.make_name_question(name, dns.DNS_QTYPE_A, dns.DNS_QCLASS_IN) +- print "asking for ", q.name ++ print("asking for %s" % (q.name)) + questions.append(q) + + self.finish_name_packet(p, questions) +-- +2.17.1 + diff --git a/samba.spec b/samba.spec index 1b6a763..8164c39 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 2 +%define main_release 3 %define samba_version 4.9.0 %define talloc_version 2.1.14 @@ -122,7 +122,8 @@ Source14: samba.pamd Source200: README.dc Source201: README.downgrade -Patch1: samba-4.8.3-vscript.local.patch +Patch0: samba-4.8.3-vscript.local.patch +Patch1: samba-4.9.0rc3-fix-python37.patch Requires(pre): /usr/sbin/groupadd Requires(post): systemd @@ -2210,6 +2211,7 @@ fi %{python2_sitearch}/samba/tests/dns.py* %{python2_sitearch}/samba/tests/dns_base.py* %{python2_sitearch}/samba/tests/dns_forwarder.py* +%{python2_sitearch}/samba/tests/dns_invalid.py* %dir %{python2_sitearch}/samba/tests/dns_forwarder_helpers %{python2_sitearch}/samba/tests/dns_forwarder_helpers/server.py* %{python2_sitearch}/samba/tests/dns_tkey.py* @@ -2602,6 +2604,7 @@ fi %{python3_sitearch}/samba/tests/__pycache__/dns.*.pyc %{python3_sitearch}/samba/tests/__pycache__/dns_base.*.pyc %{python3_sitearch}/samba/tests/__pycache__/dns_forwarder.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/dns_invalid.*.pyc %{python3_sitearch}/samba/tests/__pycache__/dns_tkey.*.pyc %{python3_sitearch}/samba/tests/__pycache__/dns_wildcard.*.pyc %{python3_sitearch}/samba/tests/__pycache__/dsdb.*.pyc @@ -2733,7 +2736,10 @@ fi %{python3_sitearch}/samba/tests/dns.py %{python3_sitearch}/samba/tests/dns_base.py %{python3_sitearch}/samba/tests/dns_forwarder.py -%{python3_sitearch}/samba/tests/dns_forwarder_helpers +%dir %{python3_sitearch}/samba/tests/dns_forwarder_helpers +%{python3_sitearch}/samba/tests/dns_forwarder_helpers/__pycache__/server.*.pyc +%{python3_sitearch}/samba/tests/dns_forwarder_helpers/server.py +%{python3_sitearch}/samba/tests/dns_invalid.py %{python3_sitearch}/samba/tests/dns_tkey.py %{python3_sitearch}/samba/tests/dns_wildcard.py %{python3_sitearch}/samba/tests/dsdb.py @@ -3826,6 +3832,9 @@ fi %endif # with_clustering_support %changelog +* Thu Aug 16 2018 Andreas Schneider - 4.9.0rc3-3 +- Fix python3 packaging + * Wed Aug 15 2018 Guenther Deschner - 4.9.0rc3-2 - Update to Samba 4.9.0rc3 - resolves: #1589651, #1617916 - Security fixes for CVE-2018-1139 From 806044e1dcd8496dec4e32bf37151a4a31cfd23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Fri, 17 Aug 2018 15:27:47 +0200 Subject: [PATCH 02/76] More python3 cleanup Guenther --- samba.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/samba.spec b/samba.spec index 8164c39..abb2696 100644 --- a/samba.spec +++ b/samba.spec @@ -922,7 +922,6 @@ done filenames=$(echo " tests/dcerpc/integer.py tests/dcerpc/unix.py - tests/dns_invalid.py ") for file in $filenames; do filename="%{buildroot}/%{python3_sitearch}/samba/$file" @@ -2215,7 +2214,6 @@ fi %dir %{python2_sitearch}/samba/tests/dns_forwarder_helpers %{python2_sitearch}/samba/tests/dns_forwarder_helpers/server.py* %{python2_sitearch}/samba/tests/dns_tkey.py* -%{python2_sitearch}/samba/tests/dns_invalid.py* %{python2_sitearch}/samba/tests/dns_wildcard.py* %{python2_sitearch}/samba/tests/docs.py* %{python2_sitearch}/samba/tests/domain_backup.py* From 437bb44f4351ff2d4ab1bddbf25f08e45e0e7d80 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 20 Aug 2018 20:28:47 +0200 Subject: [PATCH 03/76] Add a dot to the License tag rpmdiff complains about a missing dot in the License tag to be valid. --- samba.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index abb2696..f7cc8b3 100644 --- a/samba.spec +++ b/samba.spec @@ -104,7 +104,7 @@ Epoch: 2 %endif Summary: Server and Client software to interoperate with Windows machines -License: GPLv3+ and LGPLv3+ +License: GPLv3+ and LGPLv3+. URL: http://www.samba.org/ # This is a xz recompressed file of https://ftp.samba.org/pub/samba/samba-%%{version}%%{pre_release}.tar.gz From 460c9949b86b328d9312a5e98377da8564473484 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 21 Aug 2018 16:03:20 +0200 Subject: [PATCH 04/76] Add missing Requires to python3-samba-libs Found by rpmdiff --- samba.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samba.spec b/samba.spec index f7cc8b3..a6e09a7 100644 --- a/samba.spec +++ b/samba.spec @@ -590,6 +590,8 @@ that use SMB, RPC and other Samba provided protocols in Python 3 programs. %package -n python3-samba-test Summary: Samba Python libraries Requires: python3-%{name} = %{samba_depver} +Requires: %{name}-client-libs = %{samba_depver} +Requires: %{name}-libs = %{samba_depver} %description -n python3-samba-test The python3-%{name}-test package contains the Python libraries used by the test suite of Samba. From c22327fe59ab7cd0120169b0790855b1185a0f27 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 21 Aug 2018 16:03:43 +0200 Subject: [PATCH 05/76] Update samba-client-libs samba-client-libs should not depend on samba-libs. Found by rpmdiff. --- samba.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samba.spec b/samba.spec index a6e09a7..67a6d5c 100644 --- a/samba.spec +++ b/samba.spec @@ -1484,6 +1484,8 @@ fi ### CLIENT-LIBS %files client-libs +%{_libdir}/samba/libMESSAGING-SEND-samba4.so + %{_libdir}/libdcerpc-binding.so.* %{_libdir}/libndr.so.* %{_libdir}/libndr-krb5pac.so.* @@ -1912,9 +1914,7 @@ fi %files libs %{_libdir}/libdcerpc-samr.so.* -# libraries needed by the public libraries %{_libdir}/samba/libMESSAGING-samba4.so -%{_libdir}/samba/libMESSAGING-SEND-samba4.so %{_libdir}/samba/libLIBWBCLIENT-OLD-samba4.so %{_libdir}/samba/libauth4-samba4.so %{_libdir}/samba/libauth-unix-token-samba4.so From c32b0a7c4f3eb2140b3384a512ad89ca05f8552e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 22 Aug 2018 12:27:26 +0200 Subject: [PATCH 06/76] Don't create a dc or dc-libs package if not enabled --- README.dc | 12 ------------ samba.spec | 25 ++++--------------------- 2 files changed, 4 insertions(+), 33 deletions(-) delete mode 100644 README.dc diff --git a/README.dc b/README.dc deleted file mode 100644 index d67a556..0000000 --- a/README.dc +++ /dev/null @@ -1,12 +0,0 @@ -MIT Kerberos 5 Support -======================= - -Fedora is using MIT Kerberos implementation as its Kerberos infrastructure of -choice. The Samba build in Fedora is using MIT Kerberos implementation in order -to allow system-wide interoperability between both desktop and server -applications running on the same machine. - -In this build the Active Directory support has been disabled. - -In case of further questions do not hesitate to send your inquiries to -samba-owner@fedoraproject.org diff --git a/samba.spec b/samba.spec index 67a6d5c..aba1bdb 100644 --- a/samba.spec +++ b/samba.spec @@ -119,7 +119,6 @@ Source12: smb.conf.example Source13: pam_winbind.conf Source14: samba.pamd -Source200: README.dc Source201: README.downgrade Patch0: samba-4.8.3-vscript.local.patch @@ -352,6 +351,7 @@ The samba-common-tools package contains tools for Samba servers and SMB/CIFS clients. ### DC +%if %{with_dc} %package dc Summary: Samba AD Domain Controller Requires: %{name} = %{samba_depver} @@ -360,7 +360,6 @@ Requires: %{name}-dc-libs = %{samba_depver} Requires: %{name}-winbind = %{samba_depver} # samb-tool needs tdbbackup Requires: tdb-tools -%if %{with_dc} # samba-tool requirements, explicitly require python2 right now Requires: python2 Requires: python2-%{name} = %{samba_depver} @@ -379,7 +378,6 @@ Requires: python3-%{name} = %{samba_depver} Requires: python3-%{name}-dc = %{samba_depver} %endif Requires: krb5-server >= %{required_mit_krb5} -%endif Provides: samba4-dc = %{samba_depver} Obsoletes: samba4-dc < %{samba_depver} @@ -401,7 +399,6 @@ The %{name}-dc-libs package contains the libraries needed by the DC to link against the SMB, RPC and other protocols. ### DC-BIND -%if %with_dc %package dc-bind-dlz Summary: Bind DLZ module for Samba AD Requires: %{name}-common = %{samba_depver} @@ -1008,11 +1005,6 @@ install -m 0644 ctdb/config/ctdb.conf %{buildroot}%{_sysconfdir}/ctdb/ctdb.conf install -m 0644 %{SOURCE201} packaging/README.downgrade -%if ! %with_dc -install -m 0644 %{SOURCE200} packaging/README.dc -install -m 0644 %{SOURCE200} packaging/README.dc-libs -%endif - %if %with_clustering_support install -m 0644 ctdb/config/ctdb.service %{buildroot}%{_unitdir} %endif @@ -1183,7 +1175,7 @@ fi %postun common-libs -p /sbin/ldconfig -%if %with_dc +%if %{with_dc} %post dc-libs -p /sbin/ldconfig %postun dc-libs -p /sbin/ldconfig @@ -1196,7 +1188,7 @@ fi %postun dc %systemd_postun_with_restart samba.service -%endif +%endif # with_dc %post krb5-printing %{_sbindir}/update-alternatives --install %{_libexecdir}/samba/cups_backend_smb \ @@ -1639,9 +1631,8 @@ fi %{_mandir}/man8/smbpasswd.8* ### DC +%if %{with_dc} %files dc - -%if %with_dc %{_unitdir}/samba.service %{_bindir}/samba-tool %{_sbindir}/samba @@ -1711,13 +1702,9 @@ fi %{_mandir}/man8/samba.8* %{_mandir}/man8/samba-gpupdate.8* %{_mandir}/man8/samba-tool.8* -%else # with_dc -%doc packaging/README.dc -%endif # with_dc ### DC-LIBS %files dc-libs -%if %with_dc %{_libdir}/samba/libdb-glue-samba4.so %{_libdir}/samba/libprocess-model-samba4.so %{_libdir}/samba/libservice-samba4.so @@ -1744,12 +1731,8 @@ fi %{_libdir}/samba/libdsdb-module-samba4.so %{_libdir}/samba/libdsdb-garbage-collect-tombstones-samba4.so %{_libdir}/samba/libscavenge-dns-records-samba4.so -%else -%doc packaging/README.dc-libs -%endif # with_dc ### DC-BIND -%if %with_dc %files dc-bind-dlz %attr(770,root,named) %dir /var/lib/samba/bind-dns %dir %{_libdir}/samba/bind9 From a1a51adf2b7536de3be30bc1f9723c1a4043d3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 29 Aug 2018 13:15:57 +0200 Subject: [PATCH 07/76] Update to Samba 4.9.0rc4 Guenther --- .gitignore | 2 + samba-4.8.3-vscript.local.patch | 96 ------------------------------- samba-4.9.0rc3-fix-python37.patch | 26 --------- samba.spec | 9 +-- sources | 4 +- 5 files changed, 9 insertions(+), 128 deletions(-) delete mode 100644 samba-4.8.3-vscript.local.patch delete mode 100644 samba-4.9.0rc3-fix-python37.patch diff --git a/.gitignore b/.gitignore index 339e281..16e6d40 100644 --- a/.gitignore +++ b/.gitignore @@ -133,3 +133,5 @@ samba-3.6.0pre1.tar.gz /samba-4.9.0rc2.tar.asc /samba-4.9.0rc3.tar.xz /samba-4.9.0rc3.tar.asc +/samba-4.9.0rc4.tar.xz +/samba-4.9.0rc4.tar.asc diff --git a/samba-4.8.3-vscript.local.patch b/samba-4.8.3-vscript.local.patch deleted file mode 100644 index a615f05..0000000 --- a/samba-4.8.3-vscript.local.patch +++ /dev/null @@ -1,96 +0,0 @@ -From dd9da7bc9306b95496d502589f95be0efc097fc0 Mon Sep 17 00:00:00 2001 -From: Alexander Bokovoy -Date: Thu, 12 Jul 2018 10:19:41 +0300 -Subject: [PATCH] wafsamba/samba_abi: always hide ABI symbols which must be - local - -binutils 2.31 is going to change how shared libraries are linked, such -that they always provide their own local definitions of the _end, _edata -and _bss_start symbols. This would all be fine, except for shared -libraries that export all symbols be default. (Rather than just -exporting those symbols that form part of their API). - -According to binutils developers, we should only export the symbols we -explicitly want to be used. We don't use this principle for all our -libraries and deliberately don't want to have ABI versioning control for -all of them, so the change I introduce here is to explicitly mark those -symbols that will always be added by default linker configuration with -binutils 2.31 as local. Right now these are '_end', '_edata', and -'__bss_start' symbols. - -Signed-off-by: Alexander Bokovoy ---- - buildtools/wafsamba/samba_abi.py | 10 ++++++---- - buildtools/wafsamba/tests/test_abi.py | 14 ++++++++++++++ - 2 files changed, 20 insertions(+), 4 deletions(-) - -diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py -index 196b468f5b3..4603e764fea 100644 ---- a/buildtools/wafsamba/samba_abi.py -+++ b/buildtools/wafsamba/samba_abi.py -@@ -192,10 +192,12 @@ def abi_write_vscript(f, libname, current_version, versions, symmap, abi_match): - f.write("\t\t%s;\n" % x) - else: - f.write("\t\t*;\n") -- if abi_match != ["*"]: -- f.write("\tlocal:\n") -- for x in local_abi: -- f.write("\t\t%s;\n" % x[1:]) -+ # Always hide symbols that must be local if exist -+ local_abi.extend(["!_end", "!__bss_start", "!_edata"]) -+ f.write("\tlocal:\n") -+ for x in local_abi: -+ f.write("\t\t%s;\n" % x[1:]) -+ if global_abi != ["*"]: - if len(global_abi) > 0: - f.write("\t\t*;\n") - f.write("};\n") -diff --git a/buildtools/wafsamba/tests/test_abi.py b/buildtools/wafsamba/tests/test_abi.py -index bba78c1ba07..74892146990 100644 ---- a/buildtools/wafsamba/tests/test_abi.py -+++ b/buildtools/wafsamba/tests/test_abi.py -@@ -66,6 +66,10 @@ class WriteVscriptTests(TestCase): - 1.0 { - \tglobal: - \t\t*; -+\tlocal: -+\t\t_end; -+\t\t__bss_start; -+\t\t_edata; - }; - """) - -@@ -84,6 +88,10 @@ MYLIB_0.1 { - 1.0 { - \tglobal: - \t\t*; -+\tlocal: -+\t\t_end; -+\t\t__bss_start; -+\t\t_edata; - }; - """) - -@@ -99,6 +107,9 @@ MYLIB_0.1 { - \t\t*; - \tlocal: - \t\texc_*; -+\t\t_end; -+\t\t__bss_start; -+\t\t_edata; - }; - """) - -@@ -115,6 +126,9 @@ MYLIB_0.1 { - \t\tpub_*; - \tlocal: - \t\texc_*; -+\t\t_end; -+\t\t__bss_start; -+\t\t_edata; - \t\t*; - }; - """) --- -2.17.1 - diff --git a/samba-4.9.0rc3-fix-python37.patch b/samba-4.9.0rc3-fix-python37.patch deleted file mode 100644 index 763fef1..0000000 --- a/samba-4.9.0rc3-fix-python37.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 8bc323356f1f1fe689d423a2c836aebac459b9f4 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Fri, 17 Aug 2018 12:06:38 +0200 -Subject: [PATCH] python: Fix print in dns_invalid.py - -Signed-off-by: Andreas Schneider ---- - python/samba/tests/dns_invalid.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/python/samba/tests/dns_invalid.py b/python/samba/tests/dns_invalid.py -index 9f87cd56084..46611eb57a0 100644 ---- a/python/samba/tests/dns_invalid.py -+++ b/python/samba/tests/dns_invalid.py -@@ -76,7 +76,7 @@ class TestBrokenQueries(DNSTest): - - name = "\x10\x11\x05\xa8.%s" % self.get_dns_domain() - q = self.make_name_question(name, dns.DNS_QTYPE_A, dns.DNS_QCLASS_IN) -- print "asking for ", q.name -+ print("asking for %s" % (q.name)) - questions.append(q) - - self.finish_name_packet(p, questions) --- -2.17.1 - diff --git a/samba.spec b/samba.spec index aba1bdb..a9cb3c5 100644 --- a/samba.spec +++ b/samba.spec @@ -14,7 +14,7 @@ %define tevent_version 0.9.37 %define ldb_version 1.4.2 # This should be rc1 or nil -%define pre_release rc3 +%define pre_release rc4 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -121,9 +121,6 @@ Source14: samba.pamd Source201: README.downgrade -Patch0: samba-4.8.3-vscript.local.patch -Patch1: samba-4.9.0rc3-fix-python37.patch - Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -3126,6 +3123,7 @@ fi %{_datadir}/ctdb/tests/cunit/config_test_004.sh %{_datadir}/ctdb/tests/cunit/config_test_005.sh %{_datadir}/ctdb/tests/cunit/config_test_006.sh +%{_datadir}/ctdb/tests/cunit/config_test_007.sh %{_datadir}/ctdb/tests/cunit/db_hash_test_001.sh %{_datadir}/ctdb/tests/cunit/event_protocol_test_001.sh %{_datadir}/ctdb/tests/cunit/event_script_test_001.sh @@ -3815,6 +3813,9 @@ fi %endif # with_clustering_support %changelog +* Wed Aug 29 2018 Guenther Deschner - 4.9.0rc4-3 +- Update to Samba 4.9.0rc4 + * Thu Aug 16 2018 Andreas Schneider - 4.9.0rc3-3 - Fix python3 packaging diff --git a/sources b/sources index ac6517e..c841e61 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.9.0rc3.tar.xz) = 42164fda5f7d75754893a0d66f2909608ca006c968e6031d4f68797ab9a07502330e96977f553c452f24737f4deddb9cc8cb836ab70d4909d1eb102bd14457fb -SHA512 (samba-4.9.0rc3.tar.asc) = 0b405e77d7e3a824916880f5f32716e69e94158dd519b6dac66fd2109f5e70e32a55ee827274d31f500b6ddf0aafd00efa54b58b6dfdc6a26ab46d3acb04a286 +SHA512 (samba-4.9.0rc4.tar.xz) = a3d2efa41c99ce378e570d909b5cfe8507f0cf14ad8303da6d115272de0239633e249a91fee754e8b6fa0ce13ea7354f2dbe26abe97d3eda091333681c3cc2ce +SHA512 (samba-4.9.0rc4.tar.asc) = 3cb8448c25e84d4895fd17057ea9c089d98edeb9eb3168e35cd3b6cf3df101408afa8897376b8b21b97e4a5e9ac74ecb1b7d5f582f935e0341109fc54c5fcd04 From 748de698fb010ff0d34bf59aca4b035eaac6196e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Sep 2018 13:25:53 +0200 Subject: [PATCH 08/76] Update to version 4.9.0rc5 --- .gitignore | 2 + samba-4.9.0rc5-parallel-builds.patch | 54 +++++++++++++ samba-4.9.0rc5-stack-protector.patch | 117 +++++++++++++++++++++++++++ samba.spec | 8 +- sources | 4 +- 5 files changed, 182 insertions(+), 3 deletions(-) create mode 100644 samba-4.9.0rc5-parallel-builds.patch create mode 100644 samba-4.9.0rc5-stack-protector.patch diff --git a/.gitignore b/.gitignore index 16e6d40..5bea2a9 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,5 @@ samba-3.6.0pre1.tar.gz /samba-4.9.0rc3.tar.asc /samba-4.9.0rc4.tar.xz /samba-4.9.0rc4.tar.asc +/samba-4.9.0rc5.tar.asc +/samba-4.9.0rc5.tar.xz diff --git a/samba-4.9.0rc5-parallel-builds.patch b/samba-4.9.0rc5-parallel-builds.patch new file mode 100644 index 0000000..9f8c014 --- /dev/null +++ b/samba-4.9.0rc5-parallel-builds.patch @@ -0,0 +1,54 @@ +From 45ff96780bad2c1f806b101ca1211f5c3cef1a4d Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Thu, 6 Sep 2018 12:40:10 +0200 +Subject: [PATCH] wafsamba: Deal with make -j + +Currently only make -j works for parallel builds and make -j4 results in +no parallel jobs at all. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13606 + +Signed-off-by: Andreas Schneider +--- + buildtools/wafsamba/samba_utils.py | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py +index 0f95c125854..ad46005519f 100644 +--- a/buildtools/wafsamba/samba_utils.py ++++ b/buildtools/wafsamba/samba_utils.py +@@ -466,7 +466,7 @@ def CHECK_MAKEFLAGS(bld): + makeflags = os.environ.get('MAKEFLAGS') + if makeflags is None: + return +- jobs_set = False ++ jobs = 1 + # we need to use shlex.split to cope with the escaping of spaces + # in makeflags + for opt in shlex.split(makeflags): +@@ -489,17 +489,15 @@ def CHECK_MAKEFLAGS(bld): + setattr(Options.options, opt[0:loc], opt[loc+1:]) + elif opt[0] != '-': + for v in opt: +- if v == 'j': +- jobs_set = True ++ if re.search(r'j[0-9]*$', v): ++ jobs = int(opt.strip('j')) + elif v == 'k': + Options.options.keep = True +- elif opt == '-j': +- jobs_set = True ++ elif re.search(r'-j[0-9]*$', opt): ++ jobs = int(opt.strip('-j')) + elif opt == '-k': + Options.options.keep = True +- if not jobs_set: +- # default to one job +- Options.options.jobs = 1 ++ Options.options.jobs = jobs + + Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS + +-- +2.18.0 + diff --git a/samba-4.9.0rc5-stack-protector.patch b/samba-4.9.0rc5-stack-protector.patch new file mode 100644 index 0000000..51bc83a --- /dev/null +++ b/samba-4.9.0rc5-stack-protector.patch @@ -0,0 +1,117 @@ +From e2dd47233f467e2ab80564968be4af6da6505161 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 3 Sep 2018 10:35:08 +0200 +Subject: [PATCH 1/2] waf: Check for -fstack-protect-strong support + +The -fstack-protector* flags are compiler only flags, don't pass them to +the linker. + +https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601 + +Signed-off-by: Andreas Schneider +Reviewed-by: Andrew Bartlett +(cherry picked from commit 38e97f8b52e85bdfcf2d74a4fb3c848fa46ba371) +--- + buildtools/wafsamba/samba_autoconf.py | 36 ++++++++++++++------------- + 1 file changed, 19 insertions(+), 17 deletions(-) + +diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py +index c4391d0c4dc..bfd6f9710db 100644 +--- a/buildtools/wafsamba/samba_autoconf.py ++++ b/buildtools/wafsamba/samba_autoconf.py +@@ -674,23 +674,25 @@ def SAMBA_CONFIG_H(conf, path=None): + return + + # we need to build real code that can't be optimized away to test +- if conf.check(fragment=''' +- #include +- +- int main(void) +- { +- char t[100000]; +- while (fgets(t, sizeof(t), stdin)); +- return 0; +- } +- ''', +- execute=0, +- ccflags='-fstack-protector', +- ldflags='-fstack-protector', +- mandatory=False, +- msg='Checking if toolchain accepts -fstack-protector'): +- conf.ADD_CFLAGS('-fstack-protector') +- conf.ADD_LDFLAGS('-fstack-protector') ++ stack_protect_list = ['-fstack-protector-strong', '-fstack-protector'] ++ for stack_protect_flag in stack_protect_list: ++ flag_supported = conf.check(fragment=''' ++ #include ++ ++ int main(void) ++ { ++ char t[100000]; ++ while (fgets(t, sizeof(t), stdin)); ++ return 0; ++ } ++ ''', ++ execute=0, ++ ccflags=[ '-Werror', '-Wp,-D_FORTIFY_SOURCE=2', stack_protect_flag], ++ mandatory=False, ++ msg='Checking if compiler accepts %s' % (stack_protect_flag)) ++ if flag_supported: ++ conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag)) ++ break + + if Options.options.debug: + conf.ADD_CFLAGS('-g', testflags=True) +-- +2.18.0 + + +From 09f3acb3497efb9ebb8a0d7d199726a8c318e4f8 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 3 Sep 2018 10:49:52 +0200 +Subject: [PATCH 2/2] waf: Add -fstack-clash-protection + +https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601 + +Signed-off-by: Andreas Schneider +Reviewed-by: Andrew Bartlett +(cherry picked from commit fc4df251c88365142515a81bea1120b2b84cc4a0) +--- + buildtools/wafsamba/samba_autoconf.py | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py +index bfd6f9710db..f2b3ec8db8d 100644 +--- a/buildtools/wafsamba/samba_autoconf.py ++++ b/buildtools/wafsamba/samba_autoconf.py +@@ -694,6 +694,23 @@ def SAMBA_CONFIG_H(conf, path=None): + conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag)) + break + ++ flag_supported = conf.check(fragment=''' ++ #include ++ ++ int main(void) ++ { ++ char t[100000]; ++ while (fgets(t, sizeof(t), stdin)); ++ return 0; ++ } ++ ''', ++ execute=0, ++ ccflags=[ '-Werror', '-fstack-clash-protection'], ++ mandatory=False, ++ msg='Checking if compiler accepts -fstack-clash-protection') ++ if flag_supported: ++ conf.ADD_CFLAGS('-fstack-clash-protection') ++ + if Options.options.debug: + conf.ADD_CFLAGS('-g', testflags=True) + +-- +2.18.0 + diff --git a/samba.spec b/samba.spec index a9cb3c5..2b28e4c 100644 --- a/samba.spec +++ b/samba.spec @@ -14,7 +14,7 @@ %define tevent_version 0.9.37 %define ldb_version 1.4.2 # This should be rc1 or nil -%define pre_release rc4 +%define pre_release rc5 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -121,6 +121,9 @@ Source14: samba.pamd Source201: README.downgrade +Patch0: samba-4.9.0rc5-stack-protector.patch +Patch1: samba-4.9.0rc5-parallel-builds.patch + Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -3813,6 +3816,9 @@ fi %endif # with_clustering_support %changelog +* Thu Sep 06 2018 Andreas Schneider - 4.9.0rc5-3 +- Update to Samba 4.9.0rc5 + * Wed Aug 29 2018 Guenther Deschner - 4.9.0rc4-3 - Update to Samba 4.9.0rc4 diff --git a/sources b/sources index c841e61..cc1cb0f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.9.0rc4.tar.xz) = a3d2efa41c99ce378e570d909b5cfe8507f0cf14ad8303da6d115272de0239633e249a91fee754e8b6fa0ce13ea7354f2dbe26abe97d3eda091333681c3cc2ce -SHA512 (samba-4.9.0rc4.tar.asc) = 3cb8448c25e84d4895fd17057ea9c089d98edeb9eb3168e35cd3b6cf3df101408afa8897376b8b21b97e4a5e9ac74ecb1b7d5f582f935e0341109fc54c5fcd04 +SHA512 (samba-4.9.0rc5.tar.asc) = c70796cd5ffdea99ce474c07695af652b21df41de0dfe9548eb178e37792eecef0acaa4610361a88dee2e8e67fd5ab1dfefb5c214ee7f31b6dc34f68400868ab +SHA512 (samba-4.9.0rc5.tar.xz) = e6c1d49868044a3d7a33d5baf99a09869a6a3bfec6a81ee0042f381f7065215d0204f190b2a6cb679b4544e1ed31c34a0d7c0237f7ddcf72a94933cbae138d91 From b939d51dfd3c7a26d985d8b2a70701f5c6d67dfc Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Sep 2018 13:54:16 +0200 Subject: [PATCH 09/76] Update samba-4.9.0rc5-parallel-builds.patch --- samba-4.9.0rc5-parallel-builds.patch | 35 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/samba-4.9.0rc5-parallel-builds.patch b/samba-4.9.0rc5-parallel-builds.patch index 9f8c014..06feaae 100644 --- a/samba-4.9.0rc5-parallel-builds.patch +++ b/samba-4.9.0rc5-parallel-builds.patch @@ -1,4 +1,4 @@ -From 45ff96780bad2c1f806b101ca1211f5c3cef1a4d Mon Sep 17 00:00:00 2001 +From 2f1c716ffef351a56aa5bd0a26c3dd1e34d3283a Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Sep 2018 12:40:10 +0200 Subject: [PATCH] wafsamba: Deal with make -j @@ -9,43 +9,44 @@ no parallel jobs at all. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13606 Signed-off-by: Andreas Schneider +Reviewed-by: Alexander Bokovoy --- - buildtools/wafsamba/samba_utils.py | 14 ++++++-------- - 1 file changed, 6 insertions(+), 8 deletions(-) + buildtools/wafsamba/samba_utils.py | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py -index 0f95c125854..ad46005519f 100644 +index 30e99432d1b..fd61b8425d8 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py -@@ -466,7 +466,7 @@ def CHECK_MAKEFLAGS(bld): - makeflags = os.environ.get('MAKEFLAGS') +@@ -448,6 +448,7 @@ def CHECK_MAKEFLAGS(bld): if makeflags is None: return -- jobs_set = False -+ jobs = 1 + jobs_set = False ++ jobs = None # we need to use shlex.split to cope with the escaping of spaces # in makeflags for opt in shlex.split(makeflags): -@@ -489,17 +489,15 @@ def CHECK_MAKEFLAGS(bld): +@@ -470,17 +471,21 @@ def CHECK_MAKEFLAGS(bld): setattr(Options.options, opt[0:loc], opt[loc+1:]) elif opt[0] != '-': for v in opt: - if v == 'j': -- jobs_set = True + if re.search(r'j[0-9]*$', v): -+ jobs = int(opt.strip('j')) + jobs_set = True ++ jobs = opt.strip('j') elif v == 'k': Options.options.keep = True - elif opt == '-j': -- jobs_set = True + elif re.search(r'-j[0-9]*$', opt): -+ jobs = int(opt.strip('-j')) + jobs_set = True ++ jobs = opt.strip('-j') elif opt == '-k': Options.options.keep = True -- if not jobs_set: -- # default to one job -- Options.options.jobs = 1 -+ Options.options.jobs = jobs + if not jobs_set: + # default to one job + Options.options.jobs = 1 ++ elif jobs_set and jobs: ++ Options.options.jobs = int(jobs) Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS From 90f5d3ce6a270e585ba65854257ce2437dea81d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Thu, 13 Sep 2018 12:23:53 +0200 Subject: [PATCH 10/76] Update to Samba 4.9.0 Guenther --- .gitignore | 2 + samba-4.9.0rc5-parallel-builds.patch | 55 ---------------------------- samba.spec | 8 ++-- sources | 4 +- 4 files changed, 9 insertions(+), 60 deletions(-) delete mode 100644 samba-4.9.0rc5-parallel-builds.patch diff --git a/.gitignore b/.gitignore index 5bea2a9..c13ab1e 100644 --- a/.gitignore +++ b/.gitignore @@ -137,3 +137,5 @@ samba-3.6.0pre1.tar.gz /samba-4.9.0rc4.tar.asc /samba-4.9.0rc5.tar.asc /samba-4.9.0rc5.tar.xz +/samba-4.9.0.tar.xz +/samba-4.9.0.tar.asc diff --git a/samba-4.9.0rc5-parallel-builds.patch b/samba-4.9.0rc5-parallel-builds.patch deleted file mode 100644 index 06feaae..0000000 --- a/samba-4.9.0rc5-parallel-builds.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 2f1c716ffef351a56aa5bd0a26c3dd1e34d3283a Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Thu, 6 Sep 2018 12:40:10 +0200 -Subject: [PATCH] wafsamba: Deal with make -j - -Currently only make -j works for parallel builds and make -j4 results in -no parallel jobs at all. - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13606 - -Signed-off-by: Andreas Schneider -Reviewed-by: Alexander Bokovoy ---- - buildtools/wafsamba/samba_utils.py | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py -index 30e99432d1b..fd61b8425d8 100644 ---- a/buildtools/wafsamba/samba_utils.py -+++ b/buildtools/wafsamba/samba_utils.py -@@ -448,6 +448,7 @@ def CHECK_MAKEFLAGS(bld): - if makeflags is None: - return - jobs_set = False -+ jobs = None - # we need to use shlex.split to cope with the escaping of spaces - # in makeflags - for opt in shlex.split(makeflags): -@@ -470,17 +471,21 @@ def CHECK_MAKEFLAGS(bld): - setattr(Options.options, opt[0:loc], opt[loc+1:]) - elif opt[0] != '-': - for v in opt: -- if v == 'j': -+ if re.search(r'j[0-9]*$', v): - jobs_set = True -+ jobs = opt.strip('j') - elif v == 'k': - Options.options.keep = True -- elif opt == '-j': -+ elif re.search(r'-j[0-9]*$', opt): - jobs_set = True -+ jobs = opt.strip('-j') - elif opt == '-k': - Options.options.keep = True - if not jobs_set: - # default to one job - Options.options.jobs = 1 -+ elif jobs_set and jobs: -+ Options.options.jobs = int(jobs) - - Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS - --- -2.18.0 - diff --git a/samba.spec b/samba.spec index 2b28e4c..9e039fa 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 3 +%define main_release 4 %define samba_version 4.9.0 %define talloc_version 2.1.14 @@ -14,7 +14,7 @@ %define tevent_version 0.9.37 %define ldb_version 1.4.2 # This should be rc1 or nil -%define pre_release rc5 +%define pre_release %nil %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -122,7 +122,6 @@ Source14: samba.pamd Source201: README.downgrade Patch0: samba-4.9.0rc5-stack-protector.patch -Patch1: samba-4.9.0rc5-parallel-builds.patch Requires(pre): /usr/sbin/groupadd Requires(post): systemd @@ -3816,6 +3815,9 @@ fi %endif # with_clustering_support %changelog +* Thu Sep 13 2018 Guenther Deschner - 4.9.0-4 +- Update to Samba 4.9.0 + * Thu Sep 06 2018 Andreas Schneider - 4.9.0rc5-3 - Update to Samba 4.9.0rc5 diff --git a/sources b/sources index cc1cb0f..3e8f4b5 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.9.0rc5.tar.asc) = c70796cd5ffdea99ce474c07695af652b21df41de0dfe9548eb178e37792eecef0acaa4610361a88dee2e8e67fd5ab1dfefb5c214ee7f31b6dc34f68400868ab -SHA512 (samba-4.9.0rc5.tar.xz) = e6c1d49868044a3d7a33d5baf99a09869a6a3bfec6a81ee0042f381f7065215d0204f190b2a6cb679b4544e1ed31c34a0d7c0237f7ddcf72a94933cbae138d91 +SHA512 (samba-4.9.0.tar.xz) = 817a3645e5692228b77a433550053a7c1c567a9b4bef42d5588fb3a6fc5839bbb7a5253a5fefb28006c1b5254ad8f8797a595d0d2a6f1f1a93c6c9c94d232d04 +SHA512 (samba-4.9.0.tar.asc) = 9c9b8490e96142584afb104bcff35a5b5e4a8e8e4615e78f9b11b75ba786ef1c51e9c0972f9e5404339c1a0e670223148dee1741403640d2df8a10d47a13db44 From d24ae51b78dd595effb20609e6553204a3bf8fad Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 24 Sep 2018 11:02:26 +0200 Subject: [PATCH 11/76] Update to version 4.9.1 --- .gitignore | 2 ++ samba.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c13ab1e..2a75afc 100644 --- a/.gitignore +++ b/.gitignore @@ -139,3 +139,5 @@ samba-3.6.0pre1.tar.gz /samba-4.9.0rc5.tar.xz /samba-4.9.0.tar.xz /samba-4.9.0.tar.asc +/samba-4.9.1.tar.asc +/samba-4.9.1.tar.xz diff --git a/samba.spec b/samba.spec index 9e039fa..6422f3d 100644 --- a/samba.spec +++ b/samba.spec @@ -6,9 +6,9 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 4 +%define main_release 1 -%define samba_version 4.9.0 +%define samba_version 4.9.1 %define talloc_version 2.1.14 %define tdb_version 1.3.16 %define tevent_version 0.9.37 @@ -3815,6 +3815,9 @@ fi %endif # with_clustering_support %changelog +* Mon Sep 24 2018 Andreas Schneider - 4.9.1-1 +- Update to Samba 4.9.1 + * Thu Sep 13 2018 Guenther Deschner - 4.9.0-4 - Update to Samba 4.9.0 diff --git a/sources b/sources index 3e8f4b5..ce75de9 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.9.0.tar.xz) = 817a3645e5692228b77a433550053a7c1c567a9b4bef42d5588fb3a6fc5839bbb7a5253a5fefb28006c1b5254ad8f8797a595d0d2a6f1f1a93c6c9c94d232d04 -SHA512 (samba-4.9.0.tar.asc) = 9c9b8490e96142584afb104bcff35a5b5e4a8e8e4615e78f9b11b75ba786ef1c51e9c0972f9e5404339c1a0e670223148dee1741403640d2df8a10d47a13db44 +SHA512 (samba-4.9.1.tar.asc) = 2e961c1bddf952fb28268fba1925e567b122a8385a05b5b936dc2affc5da79404620735f77120a79b984115b0702100af208c53a8eb46544a9939715aea74123 +SHA512 (samba-4.9.1.tar.xz) = b3d5a524382ae6f9f41add2bc342658097a63e756f95b4ea05f855c2aaa317b77e81a06d650e33c5b2afc2d6c558e03bafa4af4037ade071962b65407e91c9c0 From d78c05ea803f5a69529b76f4d6d219ebbaa7b9e0 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 24 Sep 2018 11:59:15 +0200 Subject: [PATCH 12/76] Use spaces instead of tabs --- samba.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samba.spec b/samba.spec index 6422f3d..2297d01 100644 --- a/samba.spec +++ b/samba.spec @@ -883,12 +883,12 @@ export PYTHON=%{__python2} --accel-aes=intelaesni \ %endif --with-systemd \ - --systemd-install-services \ - --with-systemddir=/usr/lib/systemd/system \ - --systemd-smb-extra=%{_systemd_extra} \ - --systemd-nmb-extra=%{_systemd_extra} \ - --systemd-winbind-extra=%{_systemd_extra} \ - --systemd-samba-extra=%{_systemd_extra} \ + --systemd-install-services \ + --with-systemddir=/usr/lib/systemd/system \ + --systemd-smb-extra=%{_systemd_extra} \ + --systemd-nmb-extra=%{_systemd_extra} \ + --systemd-winbind-extra=%{_systemd_extra} \ + --systemd-samba-extra=%{_systemd_extra} \ --extra-python=%{__python3} make %{?_smp_mflags} From 39c6fe7d44003f1869a371b5c2062971c4595fb6 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Wed, 26 Sep 2018 09:44:42 +0300 Subject: [PATCH 13/76] Add CTDB examples with a config migration script --- samba.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index 2297d01..4b53e71 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 1 +%define main_release 2 %define samba_version 4.9.1 %define talloc_version 2.1.14 @@ -2939,6 +2939,7 @@ fi %if %with_clustering_support %files -n ctdb %doc ctdb/README +%doc ctdb/doc/examples # Obsolete %config(noreplace, missingok) %{_sysconfdir}/sysconfig/ctdb @@ -3815,6 +3816,9 @@ fi %endif # with_clustering_support %changelog +* Wed Sep 26 2018 Alexander Bokovoy - 4.9.1-2 +- Package ctdb/doc/examples + * Mon Sep 24 2018 Andreas Schneider - 4.9.1-1 - Update to Samba 4.9.1 From 6505aa953fc6e4823cf4c6a9fa18701368a46432 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 26 Sep 2018 12:17:03 +0200 Subject: [PATCH 14/76] We always build with mit_krb5 in the meantime --- samba.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/samba.spec b/samba.spec index 4b53e71..5d51d1e 100644 --- a/samba.spec +++ b/samba.spec @@ -64,7 +64,6 @@ %global libwbc_alternatives_suffix -64 %endif -%global with_mitkrb5 1 %global with_dc 1 %if 0%{?rhel} @@ -861,9 +860,7 @@ export PYTHON=%{__python2} %if (! %with_libsmbclient) || (! %with_libwbclient) --private-libraries=%{_samba_private_libraries} \ %endif -%if %with_mitkrb5 --with-system-mitkrb5 \ -%endif %if ! %with_dc --without-ad-dc \ %endif From af6b03043690411e03ad51aa140ccdab748d3d35 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 28 Sep 2018 15:13:31 +0200 Subject: [PATCH 15/76] Move libMESSAGING-SEND-samba4.so a few lines down --- samba.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/samba.spec b/samba.spec index 5d51d1e..7e8fa78 100644 --- a/samba.spec +++ b/samba.spec @@ -1472,8 +1472,6 @@ fi ### CLIENT-LIBS %files client-libs -%{_libdir}/samba/libMESSAGING-SEND-samba4.so - %{_libdir}/libdcerpc-binding.so.* %{_libdir}/libndr.so.* %{_libdir}/libndr-krb5pac.so.* @@ -1493,6 +1491,7 @@ fi %dir %{_libdir}/samba %{_libdir}/samba/libCHARSET3-samba4.so +%{_libdir}/samba/libMESSAGING-SEND-samba4.so %{_libdir}/samba/libaddns-samba4.so %{_libdir}/samba/libads-samba4.so %{_libdir}/samba/libasn1util-samba4.so From 0516288a3b9bdbf3e16ec336913a20eb42df9407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Thu, 8 Nov 2018 11:12:44 +0100 Subject: [PATCH 16/76] Update to Samba 4.9.2 Guenther --- .gitignore | 2 + samba-4.9.0rc5-stack-protector.patch | 117 --------------------------- samba.spec | 17 ++-- sources | 4 +- 4 files changed, 16 insertions(+), 124 deletions(-) delete mode 100644 samba-4.9.0rc5-stack-protector.patch diff --git a/.gitignore b/.gitignore index 2a75afc..3fe1f0f 100644 --- a/.gitignore +++ b/.gitignore @@ -141,3 +141,5 @@ samba-3.6.0pre1.tar.gz /samba-4.9.0.tar.asc /samba-4.9.1.tar.asc /samba-4.9.1.tar.xz +/samba-4.9.2.tar.xz +/samba-4.9.2.tar.asc diff --git a/samba-4.9.0rc5-stack-protector.patch b/samba-4.9.0rc5-stack-protector.patch deleted file mode 100644 index 51bc83a..0000000 --- a/samba-4.9.0rc5-stack-protector.patch +++ /dev/null @@ -1,117 +0,0 @@ -From e2dd47233f467e2ab80564968be4af6da6505161 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 3 Sep 2018 10:35:08 +0200 -Subject: [PATCH 1/2] waf: Check for -fstack-protect-strong support - -The -fstack-protector* flags are compiler only flags, don't pass them to -the linker. - -https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601 - -Signed-off-by: Andreas Schneider -Reviewed-by: Andrew Bartlett -(cherry picked from commit 38e97f8b52e85bdfcf2d74a4fb3c848fa46ba371) ---- - buildtools/wafsamba/samba_autoconf.py | 36 ++++++++++++++------------- - 1 file changed, 19 insertions(+), 17 deletions(-) - -diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py -index c4391d0c4dc..bfd6f9710db 100644 ---- a/buildtools/wafsamba/samba_autoconf.py -+++ b/buildtools/wafsamba/samba_autoconf.py -@@ -674,23 +674,25 @@ def SAMBA_CONFIG_H(conf, path=None): - return - - # we need to build real code that can't be optimized away to test -- if conf.check(fragment=''' -- #include -- -- int main(void) -- { -- char t[100000]; -- while (fgets(t, sizeof(t), stdin)); -- return 0; -- } -- ''', -- execute=0, -- ccflags='-fstack-protector', -- ldflags='-fstack-protector', -- mandatory=False, -- msg='Checking if toolchain accepts -fstack-protector'): -- conf.ADD_CFLAGS('-fstack-protector') -- conf.ADD_LDFLAGS('-fstack-protector') -+ stack_protect_list = ['-fstack-protector-strong', '-fstack-protector'] -+ for stack_protect_flag in stack_protect_list: -+ flag_supported = conf.check(fragment=''' -+ #include -+ -+ int main(void) -+ { -+ char t[100000]; -+ while (fgets(t, sizeof(t), stdin)); -+ return 0; -+ } -+ ''', -+ execute=0, -+ ccflags=[ '-Werror', '-Wp,-D_FORTIFY_SOURCE=2', stack_protect_flag], -+ mandatory=False, -+ msg='Checking if compiler accepts %s' % (stack_protect_flag)) -+ if flag_supported: -+ conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag)) -+ break - - if Options.options.debug: - conf.ADD_CFLAGS('-g', testflags=True) --- -2.18.0 - - -From 09f3acb3497efb9ebb8a0d7d199726a8c318e4f8 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 3 Sep 2018 10:49:52 +0200 -Subject: [PATCH 2/2] waf: Add -fstack-clash-protection - -https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601 - -Signed-off-by: Andreas Schneider -Reviewed-by: Andrew Bartlett -(cherry picked from commit fc4df251c88365142515a81bea1120b2b84cc4a0) ---- - buildtools/wafsamba/samba_autoconf.py | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py -index bfd6f9710db..f2b3ec8db8d 100644 ---- a/buildtools/wafsamba/samba_autoconf.py -+++ b/buildtools/wafsamba/samba_autoconf.py -@@ -694,6 +694,23 @@ def SAMBA_CONFIG_H(conf, path=None): - conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag)) - break - -+ flag_supported = conf.check(fragment=''' -+ #include -+ -+ int main(void) -+ { -+ char t[100000]; -+ while (fgets(t, sizeof(t), stdin)); -+ return 0; -+ } -+ ''', -+ execute=0, -+ ccflags=[ '-Werror', '-fstack-clash-protection'], -+ mandatory=False, -+ msg='Checking if compiler accepts -fstack-clash-protection') -+ if flag_supported: -+ conf.ADD_CFLAGS('-fstack-clash-protection') -+ - if Options.options.debug: - conf.ADD_CFLAGS('-g', testflags=True) - --- -2.18.0 - diff --git a/samba.spec b/samba.spec index 7e8fa78..1117652 100644 --- a/samba.spec +++ b/samba.spec @@ -6,13 +6,13 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 2 +%define main_release 0 -%define samba_version 4.9.1 +%define samba_version 4.9.2 %define talloc_version 2.1.14 %define tdb_version 1.3.16 %define tevent_version 0.9.37 -%define ldb_version 1.4.2 +%define ldb_version 1.4.3 # This should be rc1 or nil %define pre_release %nil @@ -120,8 +120,6 @@ Source14: samba.pamd Source201: README.downgrade -Patch0: samba-4.9.0rc5-stack-protector.patch - Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -1504,6 +1502,7 @@ fi %{_libdir}/samba/libcli-smb-common-samba4.so %{_libdir}/samba/libcli-spoolss-samba4.so %{_libdir}/samba/libcliauth-samba4.so +%{_libdir}/samba/libcmdline-contexts-samba4.so %{_libdir}/samba/libcmdline-credentials-samba4.so %{_libdir}/samba/libcommon-auth-samba4.so %{_libdir}/samba/libctdb-event-client-samba4.so @@ -1599,6 +1598,7 @@ fi ### COMMON-libs %files common-libs # common libraries +%{_libdir}/samba/libpopt-samba3-cmdline-samba4.so %{_libdir}/samba/libpopt-samba3-samba4.so %if %{with_intel_aes_accel} %{_libdir}/samba/libaesni-intel-samba4.so @@ -2159,6 +2159,7 @@ fi %{python2_sitearch}/samba/tests/auth_log_samlogon.py* %dir %{python2_sitearch}/samba/tests/blackbox %{python2_sitearch}/samba/tests/blackbox/__init__.py* +%{python2_sitearch}/samba/tests/blackbox/bug13653.py* %{python2_sitearch}/samba/tests/blackbox/check_output.py* %{python2_sitearch}/samba/tests/blackbox/ndrdump.py* %{python2_sitearch}/samba/tests/blackbox/samba_dnsupdate.py* @@ -2663,6 +2664,7 @@ fi %{python3_sitearch}/samba/tests/blackbox/__init__.py %dir %{python3_sitearch}/samba/tests/blackbox/__pycache__ %{python3_sitearch}/samba/tests/blackbox/__pycache__/__init__.*.pyc +%{python3_sitearch}/samba/tests/blackbox/__pycache__/bug13653.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/check_output.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/ndrdump.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/samba_dnsupdate.*.pyc @@ -2670,6 +2672,7 @@ fi %{python3_sitearch}/samba/tests/blackbox/__pycache__/traffic_learner.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/traffic_replay.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/traffic_summary.*.pyc +%{python3_sitearch}/samba/tests/blackbox/bug13653.py %{python3_sitearch}/samba/tests/blackbox/check_output.py %{python3_sitearch}/samba/tests/blackbox/ndrdump.py %{python3_sitearch}/samba/tests/blackbox/samba_dnsupdate.py @@ -3566,6 +3569,7 @@ fi %{_datadir}/ctdb/tests/simple/56_replicated_transaction_recovery.sh %{_datadir}/ctdb/tests/simple/58_ctdb_restoredb.sh %{_datadir}/ctdb/tests/simple/60_recoverd_missing_ip.sh +%{_datadir}/ctdb/tests/simple/69_recovery_resurrect_deleted.sh %{_datadir}/ctdb/tests/simple/70_recoverpdbbyseqnum.sh %{_datadir}/ctdb/tests/simple/71_ctdb_wipedb.sh %{_datadir}/ctdb/tests/simple/72_update_record_persistent.sh @@ -3812,6 +3816,9 @@ fi %endif # with_clustering_support %changelog +* Thu Nov 08 2018 Guenther Deschner - 4.9.2-0 +- Update to Samba 4.9.2 + * Wed Sep 26 2018 Alexander Bokovoy - 4.9.1-2 - Package ctdb/doc/examples diff --git a/sources b/sources index ce75de9..7e7fa97 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.9.1.tar.asc) = 2e961c1bddf952fb28268fba1925e567b122a8385a05b5b936dc2affc5da79404620735f77120a79b984115b0702100af208c53a8eb46544a9939715aea74123 -SHA512 (samba-4.9.1.tar.xz) = b3d5a524382ae6f9f41add2bc342658097a63e756f95b4ea05f855c2aaa317b77e81a06d650e33c5b2afc2d6c558e03bafa4af4037ade071962b65407e91c9c0 +SHA512 (samba-4.9.2.tar.xz) = 0b4ff4a0417e9612fd6046ba7e7b0fc82ffffe71a49824808401ab9f4580f258bd83d97942fe4e97ea05743debcd943c8afab1c3694eb5267497e71cdcb08045 +SHA512 (samba-4.9.2.tar.asc) = 93155bebba6fe69b924761c268647f980669cf5ec75673ed5eb281d5864836d326a804b6853de58f716f13ff27645a0384a61e98e7be94137d4f7dc09c917c3e From c54f499f1b521385b0e22655996fc7915332444d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 12 Nov 2018 18:35:16 +0100 Subject: [PATCH 17/76] Add missing requirement to lmdb --- samba.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index 1117652..1fa50f8 100644 --- a/samba.spec +++ b/samba.spec @@ -354,8 +354,10 @@ Requires: %{name} = %{samba_depver} Requires: %{name}-libs = %{samba_depver} Requires: %{name}-dc-libs = %{samba_depver} Requires: %{name}-winbind = %{samba_depver} -# samb-tool needs tdbbackup +# samba-tool needs tdbbackup Requires: tdb-tools +# samba-tool needs mdb_copy +Requires: lmdb # samba-tool requirements, explicitly require python2 right now Requires: python2 Requires: python2-%{name} = %{samba_depver} From 86571df3f4dddb94bdd28ca8602781c7f3dc060c Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 12 Nov 2018 18:36:50 +0100 Subject: [PATCH 18/76] Add lmdb as a BuildRequire for 'make test' --- samba.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/samba.spec b/samba.spec index 1fa50f8..1d17f71 100644 --- a/samba.spec +++ b/samba.spec @@ -176,6 +176,7 @@ BuildRequires: libnsl2-devel BuildRequires: libtirpc-devel BuildRequires: libuuid-devel BuildRequires: libxslt +BuildRequires: lmdb BuildRequires: ncurses-devel BuildRequires: openldap-devel BuildRequires: pam-devel From beec0125b6c2ae09700fc4924fd288932a1bb3cc Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 16 Nov 2018 13:25:28 +0100 Subject: [PATCH 19/76] There are no pygpgme packages anymore --- samba.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samba.spec b/samba.spec index 1d17f71..543bd7d 100644 --- a/samba.spec +++ b/samba.spec @@ -248,9 +248,9 @@ BuildRequires: python3-ldb-devel >= %{ldb_version} %if %{with testsuite} BuildRequires: ldb-tools BuildRequires: tdb-tools -BuildRequires: python2-pygpgme +BuildRequires: python2-gpg BuildRequires: python2-markdown -BuildRequires: python3-pygpgme +BuildRequires: python3-gpg BuildRequires: python3-markdown %endif From 83383bda5efed8a91dc2d1c4ce4cc5a7069d9ad7 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 20 Nov 2018 08:53:09 +0100 Subject: [PATCH 20/76] Add missing Archive::Tar perl module for selftest --- samba.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index 543bd7d..b522578 100644 --- a/samba.spec +++ b/samba.spec @@ -181,9 +181,10 @@ BuildRequires: ncurses-devel BuildRequires: openldap-devel BuildRequires: pam-devel BuildRequires: perl-generators -BuildRequires: perl(Test::More) +BuildRequires: perl(Archive::Tar) BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(Parse::Yapp) +BuildRequires: perl(Test::More) BuildRequires: popt-devel BuildRequires: python2-devel BuildRequires: python3-devel @@ -637,6 +638,7 @@ Requires: libsmbclient = %{samba_depver} %if %with_libwbclient Requires: libwbclient = %{samba_depver} %endif +Requires: perl(Archive::Tar) Provides: samba4-test = %{samba_depver} Obsoletes: samba4-test < %{samba_depver} From 221435e850b9cba4f08d709ae92e186c9bbd4c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 27 Nov 2018 13:29:33 +0100 Subject: [PATCH 21/76] Update to Samba 4.9.3 resolves: #1625449, #1654078 - Security fixes for CVE-2018-14629 resolves: #1642545, #1654082 - Security fixes for CVE-2018-16841 resolves: #1646377, #1654091 - Security fixes for CVE-2018-16851 resolves: #1646386, #1654092 - Security fixes for CVE-2018-16852 resolves: #1647246, #1654093 - Security fixes for CVE-2018-16853 resolves: #1649278, #1654095 - Security fixes for CVE-2018-16857 Guenther --- .gitignore | 2 ++ samba.spec | 11 ++++++++++- sources | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3fe1f0f..3ff2304 100644 --- a/.gitignore +++ b/.gitignore @@ -143,3 +143,5 @@ samba-3.6.0pre1.tar.gz /samba-4.9.1.tar.xz /samba-4.9.2.tar.xz /samba-4.9.2.tar.asc +/samba-4.9.3.tar.xz +/samba-4.9.3.tar.asc diff --git a/samba.spec b/samba.spec index b522578..143d5d6 100644 --- a/samba.spec +++ b/samba.spec @@ -8,7 +8,7 @@ %define main_release 0 -%define samba_version 4.9.2 +%define samba_version 4.9.3 %define talloc_version 2.1.14 %define tdb_version 1.3.16 %define tevent_version 0.9.37 @@ -3821,6 +3821,15 @@ fi %endif # with_clustering_support %changelog +* Tue Nov 27 2018 Guenther Deschner - 4.9.3-0 +- Update to Samba 4.9.3 +- resolves: #1625449, #1654078 - Security fixes for CVE-2018-14629 +- resolves: #1642545, #1654082 - Security fixes for CVE-2018-16841 +- resolves: #1646377, #1654091 - Security fixes for CVE-2018-16851 +- resolves: #1646386, #1654092 - Security fixes for CVE-2018-16852 +- resolves: #1647246, #1654093 - Security fixes for CVE-2018-16853 +- resolves: #1649278, #1654095 - Security fixes for CVE-2018-16857 + * Thu Nov 08 2018 Guenther Deschner - 4.9.2-0 - Update to Samba 4.9.2 diff --git a/sources b/sources index 7e7fa97..f8d670a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.9.2.tar.xz) = 0b4ff4a0417e9612fd6046ba7e7b0fc82ffffe71a49824808401ab9f4580f258bd83d97942fe4e97ea05743debcd943c8afab1c3694eb5267497e71cdcb08045 -SHA512 (samba-4.9.2.tar.asc) = 93155bebba6fe69b924761c268647f980669cf5ec75673ed5eb281d5864836d326a804b6853de58f716f13ff27645a0384a61e98e7be94137d4f7dc09c917c3e +SHA512 (samba-4.9.3.tar.xz) = 4c173f641cf2c777a2fac66b0e18f37cd0fcdba13f6a58be6f97ffbf122e33f16aefc19ba165aac111fa46a580578fb128ddb5a791fa1c9253e2c6400c417073 +SHA512 (samba-4.9.3.tar.asc) = 48a5768a72a03d68932bc224097d14639636fd6f2c22b092c7db8b7f037f055649416573eab9c7c4da18f30af0bfc09bcaa578e752c5a9fc094e7120928af069 From 43997510381ac3a71ececd167f55fe0b248b809b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 27 Nov 2018 13:29:33 +0100 Subject: [PATCH 22/76] Keep building with MIT KDC support Guenther --- samba.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/samba.spec b/samba.spec index 143d5d6..5caee62 100644 --- a/samba.spec +++ b/samba.spec @@ -864,6 +864,7 @@ export PYTHON=%{__python2} --private-libraries=%{_samba_private_libraries} \ %endif --with-system-mitkrb5 \ + --with-experimental-mit-ad-dc \ %if ! %with_dc --without-ad-dc \ %endif From 271d438a35d95a4e044191a0fbbc340ef95ffa5b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 10 Dec 2018 18:25:24 +0100 Subject: [PATCH 23/76] Add missing Require to ldb-tools for samba-tool --- samba.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/samba.spec b/samba.spec index 5caee62..8a5035c 100644 --- a/samba.spec +++ b/samba.spec @@ -360,6 +360,7 @@ Requires: %{name}-winbind = %{samba_depver} Requires: tdb-tools # samba-tool needs mdb_copy Requires: lmdb +Requires: ldb-tools # samba-tool requirements, explicitly require python2 right now Requires: python2 Requires: python2-%{name} = %{samba_depver} From 08bc45b085290aaa26e74966bc525e48508df333 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 10 Dec 2018 18:25:46 +0100 Subject: [PATCH 24/76] Fix /var/run/samba -> /run/samba This also creates warnings on boot if /var/run in in a tmpfile. --- samba.spec | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/samba.spec b/samba.spec index 8a5035c..cf5c431 100644 --- a/samba.spec +++ b/samba.spec @@ -945,8 +945,8 @@ install -d -m 0755 %{buildroot}/var/lib/samba/sysvol install -d -m 0755 %{buildroot}/var/lib/samba/winbindd_privileged install -d -m 0755 %{buildroot}/var/log/samba/old install -d -m 0755 %{buildroot}/var/spool/samba -install -d -m 0755 %{buildroot}/var/run/samba -install -d -m 0755 %{buildroot}/var/run/winbindd +install -d -m 0755 %{buildroot}/run/samba +install -d -m 0755 %{buildroot}/run/winbindd install -d -m 0755 %{buildroot}/%{_libdir}/samba install -d -m 0755 %{buildroot}/%{_libdir}/samba/ldb install -d -m 0755 %{buildroot}/%{_libdir}/pkgconfig @@ -986,11 +986,10 @@ install -m644 examples/LDAP/samba.schema %{buildroot}%{_sysconfdir}/openldap/sch install -m 0744 packaging/printing/smbprint %{buildroot}%{_bindir}/smbprint install -d -m 0755 %{buildroot}%{_tmpfilesdir} -install -m644 packaging/systemd/samba.conf.tmp %{buildroot}%{_tmpfilesdir}/samba.conf -# create /run/samba too. -echo "d /run/samba 755 root root" >> %{buildroot}%{_tmpfilesdir}/samba.conf +# Create /run/samba. +echo "d /run/samba 755 root root" > %{buildroot}%{_tmpfilesdir}/samba.conf %if %with_clustering_support -echo "d /run/ctdb 755 root root" >> %{buildroot}%{_tmpfilesdir}/ctdb.conf +echo "d /run/ctdb 755 root root" > %{buildroot}%{_tmpfilesdir}/ctdb.conf %endif install -d -m 0755 %{buildroot}%{_sysconfdir}/sysconfig @@ -1587,8 +1586,8 @@ fi %config(noreplace) %{_sysconfdir}/logrotate.d/samba %attr(0700,root,root) %dir /var/log/samba %attr(0700,root,root) %dir /var/log/samba/old -%ghost %dir /var/run/samba -%ghost %dir /var/run/winbindd +%ghost %dir /run/samba +%ghost %dir /run/winbindd %dir /var/lib/samba %attr(700,root,root) %dir /var/lib/samba/private %dir /var/lib/samba/lock From 5eff0802dda36da4e754969c7261370565f78e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Thu, 20 Dec 2018 11:45:46 +0100 Subject: [PATCH 25/76] Update to Samba 4.9.4 Guenther --- .gitignore | 2 ++ samba.spec | 5 ++++- sources | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3ff2304..21c4b99 100644 --- a/.gitignore +++ b/.gitignore @@ -145,3 +145,5 @@ samba-3.6.0pre1.tar.gz /samba-4.9.2.tar.asc /samba-4.9.3.tar.xz /samba-4.9.3.tar.asc +/samba-4.9.4.tar.xz +/samba-4.9.4.tar.asc diff --git a/samba.spec b/samba.spec index cf5c431..ddc1150 100644 --- a/samba.spec +++ b/samba.spec @@ -8,7 +8,7 @@ %define main_release 0 -%define samba_version 4.9.3 +%define samba_version 4.9.4 %define talloc_version 2.1.14 %define tdb_version 1.3.16 %define tevent_version 0.9.37 @@ -3822,6 +3822,9 @@ fi %endif # with_clustering_support %changelog +* Thu Dec 20 2018 Guenther Deschner - 4.9.4-0 +- Update to Samba 4.9.4 + * Tue Nov 27 2018 Guenther Deschner - 4.9.3-0 - Update to Samba 4.9.3 - resolves: #1625449, #1654078 - Security fixes for CVE-2018-14629 diff --git a/sources b/sources index f8d670a..61d59db 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.9.3.tar.xz) = 4c173f641cf2c777a2fac66b0e18f37cd0fcdba13f6a58be6f97ffbf122e33f16aefc19ba165aac111fa46a580578fb128ddb5a791fa1c9253e2c6400c417073 -SHA512 (samba-4.9.3.tar.asc) = 48a5768a72a03d68932bc224097d14639636fd6f2c22b092c7db8b7f037f055649416573eab9c7c4da18f30af0bfc09bcaa578e752c5a9fc094e7120928af069 +SHA512 (samba-4.9.4.tar.xz) = 8ccaa018b522866ce1305d64eb98bf2eae9a7be72a011f4488238e8c34775649694a9b78ca52532ceec318108885b87c9b21f14e32dd5aef10ba15bc3368c1a3 +SHA512 (samba-4.9.4.tar.asc) = 0fce12e659d075f3be3add738ca2e2074e00a040a71a307f6ee177c884df47cee42027d9eff8c002f501bd3355e29a64a6f595a08cf0b430fc75aeeaab49898f From d59d5d69d25957d492146553aa749f2f1c8dfe5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Mon, 14 Jan 2019 19:16:02 +0100 Subject: [PATCH 26/76] Rebuilt for libcrypt.so.2 (#1666033) --- samba.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index ddc1150..94537aa 100644 --- a/samba.spec +++ b/samba.spec @@ -88,7 +88,7 @@ Name: samba Version: %{samba_version} -Release: %{samba_release} +Release: %{samba_release}.1 %if 0%{?rhel} Epoch: 0 @@ -3822,6 +3822,9 @@ fi %endif # with_clustering_support %changelog +* Mon Jan 14 2019 Björn Esser - 2:4.9.4-0.1 +- Rebuilt for libcrypt.so.2 (#1666033) + * Thu Dec 20 2018 Guenther Deschner - 4.9.4-0 - Update to Samba 4.9.4 From 8cb13b2d8b37d3ff1d1afb3a6eed360818327142 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 22 Jan 2019 18:40:53 +0100 Subject: [PATCH 27/76] Remove obsolete ldconfig scriptlets References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets Signed-off-by: Igor Gnatenko --- samba.spec | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/samba.spec b/samba.spec index 94537aa..960b14c 100644 --- a/samba.spec +++ b/samba.spec @@ -1148,7 +1148,7 @@ TDB_NO_FSYNC=1 make %{?_smp_mflags} test getent group printadmin >/dev/null || groupadd -r printadmin || : %post common -/sbin/ldconfig +%{?ldconfig} %tmpfiles_create %{_tmpfilesdir}/samba.conf if [ -d /var/cache/samba ]; then mv /var/cache/samba/netsamlogon_cache.tdb /var/lib/samba/ 2>/dev/null @@ -1167,18 +1167,12 @@ if [ $1 -eq 0 ] ; then %{_sbindir}/update-alternatives --remove cups_backend_smb %{_bindir}/smbspool fi -%post client-libs -p /sbin/ldconfig +%ldconfig_scriptlets client-libs -%postun client-libs -p /sbin/ldconfig - -%post common-libs -p /sbin/ldconfig - -%postun common-libs -p /sbin/ldconfig +%ldconfig_scriptlets common-libs %if %{with_dc} -%post dc-libs -p /sbin/ldconfig - -%postun dc-libs -p /sbin/ldconfig +%ldconfig_scriptlets dc-libs %post dc %systemd_post samba.service @@ -1200,14 +1194,10 @@ if [ $1 -eq 0 ] ; then %{_sbindir}/update-alternatives --remove cups_backend_smb %{_libexecdir}/samba/smbspool_krb5_wrapper fi -%post libs -p /sbin/ldconfig - -%postun libs -p /sbin/ldconfig +%ldconfig_scriptlets libs %if %with_libsmbclient -%post -n libsmbclient -p /sbin/ldconfig - -%postun -n libsmbclient -p /sbin/ldconfig +%ldconfig_scriptlets -n libsmbclient %endif %if %with_libwbclient @@ -1220,7 +1210,7 @@ fi libwbclient.so.%{libwbc_alternatives_version}%{libwbc_alternatives_suffix} \ %{_libdir}/samba/wbclient/libwbclient.so.%{libwbc_alternatives_version} \ 10 -/sbin/ldconfig +%{?ldconfig} %preun -n libwbclient %{_sbindir}/update-alternatives \ @@ -1250,9 +1240,7 @@ fi %endif # with_libwbclient -%post test -p /sbin/ldconfig - -%postun test -p /sbin/ldconfig +%ldconfig_scriptlets test %pre winbind /usr/sbin/groupadd -g 88 wbpriv >/dev/null 2>&1 || : @@ -1283,9 +1271,7 @@ if [ $1 -eq 0 ]; then %{_sbindir}/update-alternatives --remove winbind_krb5_locator.so %{_libdir}/samba/krb5/winbind_krb5_locator.so fi -%post winbind-modules -p /sbin/ldconfig - -%postun winbind-modules -p /sbin/ldconfig +%ldconfig_scriptlets winbind-modules %if %with_clustering_support %post -n ctdb From fa9745376a78caab5dce2ec49e2d33fc9bf2f3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 15 Jan 2019 20:45:03 +0100 Subject: [PATCH 28/76] Update to Samba 4.10.0rc1 Guenther --- .gitignore | 2 + samba.spec | 146 ++++++++++++++++++++++++++++++++--------------------- sources | 4 +- 3 files changed, 92 insertions(+), 60 deletions(-) diff --git a/.gitignore b/.gitignore index 21c4b99..9cd446f 100644 --- a/.gitignore +++ b/.gitignore @@ -147,3 +147,5 @@ samba-3.6.0pre1.tar.gz /samba-4.9.3.tar.asc /samba-4.9.4.tar.xz /samba-4.9.4.tar.asc +/samba-4.10.0rc1.tar.xz +/samba-4.10.0rc1.tar.asc diff --git a/samba.spec b/samba.spec index 960b14c..0c52228 100644 --- a/samba.spec +++ b/samba.spec @@ -8,13 +8,13 @@ %define main_release 0 -%define samba_version 4.9.4 -%define talloc_version 2.1.14 -%define tdb_version 1.3.16 -%define tevent_version 0.9.37 -%define ldb_version 1.4.3 +%define samba_version 4.10.0 +%define talloc_version 2.1.15 +%define tdb_version 1.3.17 +%define tevent_version 0.9.38 +%define ldb_version 1.5.2 # This should be rc1 or nil -%define pre_release %nil +%define pre_release rc1 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -58,7 +58,7 @@ %global with_intel_aes_accel 1 %endif -%global libwbc_alternatives_version 0.14 +%global libwbc_alternatives_version 0.15 %global libwbc_alternatives_suffix %nil %if 0%{?__isa_bits} == 64 %global libwbc_alternatives_suffix -64 @@ -88,7 +88,7 @@ Name: samba Version: %{samba_version} -Release: %{samba_release}.1 +Release: %{samba_release} %if 0%{?rhel} Epoch: 0 @@ -916,24 +916,6 @@ for i in %{buildroot}%{_bindir} %{buildroot}%{_sbindir} ; do -exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python2}|' {} \; done -# FIXME: Remove Python3 files with bad syntax -# (needs to be done after install; before that the py2 and py3 versions -# are the same) -filenames=$(echo " - tests/dcerpc/integer.py - tests/dcerpc/unix.py -") -for file in $filenames; do - filename="%{buildroot}/%{python3_sitearch}/samba/$file" - if python3 -c "with open('$filename') as f: compile(f.read(), '$file', 'exec')"; then - echo "python3 compilation of $file succeeded unexpectedly" - exit 1 - else - echo "python3 compilation of $file failed, removing" - rm "$filename" - fi -done - install -d -m 0755 %{buildroot}/usr/{sbin,bin} install -d -m 0755 %{buildroot}%{_libdir}/security install -d -m 0755 %{buildroot}/var/lib/samba @@ -1289,7 +1271,7 @@ fi ### SAMBA %files %license COPYING -%doc README WHATSNEW.txt +%doc README.md WHATSNEW.txt %doc examples/autofs examples/LDAP examples/misc %doc examples/printer-accounting examples/printing %doc packaging/README.downgrade @@ -1363,7 +1345,6 @@ fi %{_mandir}/man8/vfs_aio_pthread.8* %{_mandir}/man8/vfs_audit.8* %{_mandir}/man8/vfs_btrfs.8* -%{_mandir}/man8/vfs_cacheprime.8* %{_mandir}/man8/vfs_cap.8* %{_mandir}/man8/vfs_catia.8* %{_mandir}/man8/vfs_commit.8* @@ -1375,13 +1356,10 @@ fi %{_mandir}/man8/vfs_fileid.8* %{_mandir}/man8/vfs_fruit.8* %{_mandir}/man8/vfs_full_audit.8* -%{_mandir}/man8/vfs_gpfs.8* %{_mandir}/man8/vfs_linux_xfs_sgid.8* %{_mandir}/man8/vfs_media_harmony.8* %{_mandir}/man8/vfs_netatalk.8* -%{_mandir}/man8/vfs_nfs4acl_xattr.8* %{_mandir}/man8/vfs_offline.8* -%{_mandir}/man8/vfs_prealloc.8* %{_mandir}/man8/vfs_preopen.8* %{_mandir}/man8/vfs_readahead.8* %{_mandir}/man8/vfs_readonly.8* @@ -1394,7 +1372,6 @@ fi %{_mandir}/man8/vfs_streams_xattr.8* %{_mandir}/man8/vfs_syncops.8* %{_mandir}/man8/vfs_time_audit.8* -%{_mandir}/man8/vfs_tsmsm.8* %{_mandir}/man8/vfs_unityed_media.8* %{_mandir}/man8/vfs_virusfilter.8* %{_mandir}/man8/vfs_worm.8* @@ -1414,6 +1391,7 @@ fi %files client %{_bindir}/cifsdd %{_bindir}/dbwrap_tool +%{_bindir}/dumpmscat %{_bindir}/findsmb %{_bindir}/mvxattr %{_bindir}/nmblookup @@ -1494,6 +1472,7 @@ fi %{_libdir}/samba/libcli-smb-common-samba4.so %{_libdir}/samba/libcli-spoolss-samba4.so %{_libdir}/samba/libcliauth-samba4.so +%{_libdir}/samba/libclidns-samba4.so %{_libdir}/samba/libcmdline-contexts-samba4.so %{_libdir}/samba/libcmdline-credentials-samba4.so %{_libdir}/samba/libcommon-auth-samba4.so @@ -1516,6 +1495,7 @@ fi %{_libdir}/samba/liblibsmb-samba4.so %{_libdir}/samba/libmessages-dgm-samba4.so %{_libdir}/samba/libmessages-util-samba4.so +%{_libdir}/samba/libmscat-samba4.so %{_libdir}/samba/libmsghdr-samba4.so %{_libdir}/samba/libmsrpc3-samba4.so %{_libdir}/samba/libndr-samba-samba4.so @@ -1659,6 +1639,7 @@ fi %{_libdir}/samba/ldb/objectclass_attrs.so %{_libdir}/samba/ldb/objectguid.so %{_libdir}/samba/ldb/operational.so +%{_libdir}/samba/ldb/paged_results.so %{_libdir}/samba/ldb/partition.so %{_libdir}/samba/ldb/password_hash.so %{_libdir}/samba/ldb/ranged_results.so @@ -1727,6 +1708,7 @@ fi %{_libdir}/samba/bind9/dlz_bind9_9.so %{_libdir}/samba/bind9/dlz_bind9_10.so %{_libdir}/samba/bind9/dlz_bind9_11.so +%{_libdir}/samba/bind9/dlz_bind9_12.so %endif # with_dc ### DEVEL @@ -1848,9 +1830,6 @@ fi %{_includedir}/samba-4.0/dcerpc_server.h %{_libdir}/libdcerpc-server.so %{_libdir}/pkgconfig/dcerpc_server.pc - -%{_libdir}/libsamba-policy.so -%{_libdir}/pkgconfig/samba-policy.pc %endif %if ! %with_libsmbclient @@ -2304,11 +2283,13 @@ fi %{python3_sitearch}/samba/__pycache__/drs_utils.*.pyc %{python3_sitearch}/samba/__pycache__/getopt.*.pyc %{python3_sitearch}/samba/__pycache__/gpclass.*.pyc +%{python3_sitearch}/samba/__pycache__/gp_ext_loader.*.pyc %{python3_sitearch}/samba/__pycache__/gp_sec_ext.*.pyc %{python3_sitearch}/samba/__pycache__/graph.*.pyc %{python3_sitearch}/samba/__pycache__/hostconfig.*.pyc %{python3_sitearch}/samba/__pycache__/idmap.*.pyc %{python3_sitearch}/samba/__pycache__/join.*.pyc +%{python3_sitearch}/samba/__pycache__/logger.*.pyc %{python3_sitearch}/samba/__pycache__/mdb_util.*.pyc %{python3_sitearch}/samba/__pycache__/ms_display_specifiers.*.pyc %{python3_sitearch}/samba/__pycache__/ms_schema.*.pyc @@ -2320,6 +2301,7 @@ fi %{python3_sitearch}/samba/__pycache__/tdb_util.*.pyc %{python3_sitearch}/samba/__pycache__/upgrade.*.pyc %{python3_sitearch}/samba/__pycache__/upgradehelpers.*.pyc +%{python3_sitearch}/samba/__pycache__/uptodateness.*.pyc %{python3_sitearch}/samba/__pycache__/xattr.*.pyc %{python3_sitearch}/samba/_glue.*.so %{python3_sitearch}/samba/_ldb.*.so @@ -2356,15 +2338,20 @@ fi %{python3_sitearch}/samba/dcerpc/nbt.*.so %{python3_sitearch}/samba/dcerpc/netlogon.*.so %{python3_sitearch}/samba/dcerpc/ntlmssp.*.so +%{python3_sitearch}/samba/dcerpc/preg.*.so %{python3_sitearch}/samba/dcerpc/samr.*.so %{python3_sitearch}/samba/dcerpc/security.*.so %{python3_sitearch}/samba/dcerpc/server_id.*.so %{python3_sitearch}/samba/dcerpc/smb_acl.*.so +%{python3_sitearch}/samba/dcerpc/spoolss.*.so %{python3_sitearch}/samba/dcerpc/srvsvc.*.so %{python3_sitearch}/samba/dcerpc/svcctl.*.so %{python3_sitearch}/samba/dcerpc/unixinfo.*.so %{python3_sitearch}/samba/dcerpc/winbind.*.so +%{python3_sitearch}/samba/dcerpc/windows_event_ids.*.so %{python3_sitearch}/samba/dcerpc/winreg.*.so +%{python3_sitearch}/samba/dcerpc/winspool.*.so +%{python3_sitearch}/samba/dcerpc/witness.*.so %{python3_sitearch}/samba/dcerpc/wkssvc.*.so %{python3_sitearch}/samba/dcerpc/xattr.*.so %{python3_sitearch}/samba/descriptor.py @@ -2391,6 +2378,22 @@ fi %{python3_sitearch}/samba/emulate/__init__.py %{python3_sitearch}/samba/emulate/traffic.py %{python3_sitearch}/samba/emulate/traffic_packets.py +%{python3_sitearch}/samba/gp_ext_loader.py +%dir %{python3_sitearch}/samba/gp_parse +%{python3_sitearch}/samba/gp_parse/__init__.py +%dir %{python3_sitearch}/samba/gp_parse/__pycache__ +%{python3_sitearch}/samba/gp_parse/__pycache__/__init__.*.pyc +%{python3_sitearch}/samba/gp_parse/__pycache__/gp_aas.*.pyc +%{python3_sitearch}/samba/gp_parse/__pycache__/gp_csv.*.pyc +%{python3_sitearch}/samba/gp_parse/__pycache__/gp_inf.*.pyc +%{python3_sitearch}/samba/gp_parse/__pycache__/gp_ini.*.pyc +%{python3_sitearch}/samba/gp_parse/__pycache__/gp_pol.*.pyc +%{python3_sitearch}/samba/gp_parse/gp_aas.py +%{python3_sitearch}/samba/gp_parse/gp_csv.py +%{python3_sitearch}/samba/gp_parse/gp_inf.py +%{python3_sitearch}/samba/gp_parse/gp_ini.py +%{python3_sitearch}/samba/gp_parse/gp_pol.py +%{python3_sitearch}/samba/logger.py %{python3_sitearch}/samba/mdb_util.py %{python3_sitearch}/samba/ms_display_specifiers.py %{python3_sitearch}/samba/ms_schema.py @@ -2569,6 +2572,7 @@ fi %{python3_sitearch}/samba/tests/__pycache__/auth_log_netlogon_bad_creds.*.pyc %{python3_sitearch}/samba/tests/__pycache__/auth_log_samlogon.*.pyc %{python3_sitearch}/samba/tests/__pycache__/common.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/complex_expressions.*.pyc %{python3_sitearch}/samba/tests/__pycache__/core.*.pyc %{python3_sitearch}/samba/tests/__pycache__/credentials.*.pyc %{python3_sitearch}/samba/tests/__pycache__/dckeytab.*.pyc @@ -2583,6 +2587,7 @@ fi %{python3_sitearch}/samba/tests/__pycache__/dsdb_schema_attributes.*.pyc %{python3_sitearch}/samba/tests/__pycache__/docs.*.pyc %{python3_sitearch}/samba/tests/__pycache__/domain_backup.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/domain_backup_offline.*.pyc %{python3_sitearch}/samba/tests/__pycache__/encrypted_secrets.*.pyc %{python3_sitearch}/samba/tests/__pycache__/gensec.*.pyc %{python3_sitearch}/samba/tests/__pycache__/get_opt.*.pyc @@ -2594,8 +2599,8 @@ fi %{python3_sitearch}/samba/tests/__pycache__/hostconfig.*.pyc %{python3_sitearch}/samba/tests/__pycache__/join.*.pyc %{python3_sitearch}/samba/tests/__pycache__/krb5_credentials.*.pyc -%{python3_sitearch}/samba/tests/__pycache__/libsmb_samba_internal.*.pyc %{python3_sitearch}/samba/tests/__pycache__/loadparm.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/libsmb.*.pyc %{python3_sitearch}/samba/tests/__pycache__/lsa_string.*.pyc %{python3_sitearch}/samba/tests/__pycache__/messaging.*.pyc %{python3_sitearch}/samba/tests/__pycache__/netbios.*.pyc @@ -2606,7 +2611,11 @@ fi %{python3_sitearch}/samba/tests/__pycache__/ntacls.*.pyc %{python3_sitearch}/samba/tests/__pycache__/ntacls_backup.*.pyc %{python3_sitearch}/samba/tests/__pycache__/ntlmdisabled.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/ntlm_auth.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/ntlm_auth_base.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/ntlm_auth_krb5.*.pyc %{python3_sitearch}/samba/tests/__pycache__/pam_winbind.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/pam_winbind_chauthtok.*.pyc %{python3_sitearch}/samba/tests/__pycache__/pam_winbind_warn_pwd_expire.*.pyc %{python3_sitearch}/samba/tests/__pycache__/param.*.pyc %{python3_sitearch}/samba/tests/__pycache__/password_hash.*.pyc @@ -2618,6 +2627,8 @@ fi %{python3_sitearch}/samba/tests/__pycache__/password_test.*.pyc %{python3_sitearch}/samba/tests/__pycache__/policy.*.pyc %{python3_sitearch}/samba/tests/__pycache__/posixacl.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/prefork_restart.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/process_limits.*.pyc %{python3_sitearch}/samba/tests/__pycache__/provision.*.pyc %{python3_sitearch}/samba/tests/__pycache__/pso.*.pyc %{python3_sitearch}/samba/tests/__pycache__/py_credentials.*.pyc @@ -2636,7 +2647,6 @@ fi %{python3_sitearch}/samba/tests/__pycache__/strings.*.pyc %{python3_sitearch}/samba/tests/__pycache__/subunitrun.*.pyc %{python3_sitearch}/samba/tests/__pycache__/tdb_util.*.pyc -%{python3_sitearch}/samba/tests/__pycache__/unicodenames.*.pyc %{python3_sitearch}/samba/tests/__pycache__/upgrade.*.pyc %{python3_sitearch}/samba/tests/__pycache__/upgradeprovision.*.pyc %{python3_sitearch}/samba/tests/__pycache__/upgradeprovisionneeddc.*.pyc @@ -2659,20 +2669,25 @@ fi %{python3_sitearch}/samba/tests/blackbox/__pycache__/bug13653.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/check_output.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/ndrdump.*.pyc +%{python3_sitearch}/samba/tests/blackbox/__pycache__/netads_json.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/samba_dnsupdate.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/smbcontrol.*.pyc +%{python3_sitearch}/samba/tests/blackbox/__pycache__/smbcontrol_process.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/traffic_learner.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/traffic_replay.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/traffic_summary.*.pyc %{python3_sitearch}/samba/tests/blackbox/bug13653.py %{python3_sitearch}/samba/tests/blackbox/check_output.py %{python3_sitearch}/samba/tests/blackbox/ndrdump.py +%{python3_sitearch}/samba/tests/blackbox/netads_json.py %{python3_sitearch}/samba/tests/blackbox/samba_dnsupdate.py %{python3_sitearch}/samba/tests/blackbox/smbcontrol.py +%{python3_sitearch}/samba/tests/blackbox/smbcontrol_process.py %{python3_sitearch}/samba/tests/blackbox/traffic_learner.py %{python3_sitearch}/samba/tests/blackbox/traffic_replay.py %{python3_sitearch}/samba/tests/blackbox/traffic_summary.py %{python3_sitearch}/samba/tests/common.py +%{python3_sitearch}/samba/tests/complex_expressions.py %{python3_sitearch}/samba/tests/core.py %{python3_sitearch}/samba/tests/credentials.py %dir %{python3_sitearch}/samba/tests/dcerpc @@ -2682,6 +2697,7 @@ fi %{python3_sitearch}/samba/tests/dcerpc/__pycache__/array.*.pyc %{python3_sitearch}/samba/tests/dcerpc/__pycache__/bare.*.pyc %{python3_sitearch}/samba/tests/dcerpc/__pycache__/dnsserver.*.pyc +%{python3_sitearch}/samba/tests/dcerpc/__pycache__/integer.*.pyc %{python3_sitearch}/samba/tests/dcerpc/__pycache__/misc.*.pyc %{python3_sitearch}/samba/tests/dcerpc/__pycache__/raw_protocol.*.pyc %{python3_sitearch}/samba/tests/dcerpc/__pycache__/raw_testcase.*.pyc @@ -2690,11 +2706,13 @@ fi %{python3_sitearch}/samba/tests/dcerpc/__pycache__/rpcecho.*.pyc %{python3_sitearch}/samba/tests/dcerpc/__pycache__/sam.*.pyc %{python3_sitearch}/samba/tests/dcerpc/__pycache__/srvsvc.*.pyc -%{python3_sitearch}/samba/tests/dcerpc/__pycache__/string.*.pyc +%{python3_sitearch}/samba/tests/dcerpc/__pycache__/string_tests.*.pyc %{python3_sitearch}/samba/tests/dcerpc/__pycache__/testrpc.*.pyc +%{python3_sitearch}/samba/tests/dcerpc/__pycache__/unix.*.pyc %{python3_sitearch}/samba/tests/dcerpc/array.py %{python3_sitearch}/samba/tests/dcerpc/bare.py %{python3_sitearch}/samba/tests/dcerpc/dnsserver.py +%{python3_sitearch}/samba/tests/dcerpc/integer.py %{python3_sitearch}/samba/tests/dcerpc/misc.py %{python3_sitearch}/samba/tests/dcerpc/raw_protocol.py %{python3_sitearch}/samba/tests/dcerpc/raw_testcase.py @@ -2703,14 +2721,17 @@ fi %{python3_sitearch}/samba/tests/dcerpc/rpcecho.py %{python3_sitearch}/samba/tests/dcerpc/sam.py %{python3_sitearch}/samba/tests/dcerpc/srvsvc.py -%{python3_sitearch}/samba/tests/dcerpc/string.py +%{python3_sitearch}/samba/tests/dcerpc/string_tests.py %{python3_sitearch}/samba/tests/dcerpc/testrpc.py +%{python3_sitearch}/samba/tests/dcerpc/unix.py %{python3_sitearch}/samba/tests/dckeytab.py %{python3_sitearch}/samba/tests/dns.py %{python3_sitearch}/samba/tests/dns_base.py %{python3_sitearch}/samba/tests/dns_forwarder.py %dir %{python3_sitearch}/samba/tests/dns_forwarder_helpers +%{python3_sitearch}/samba/tests/dns_forwarder_helpers/__pycache__/dns_hub.*.pyc %{python3_sitearch}/samba/tests/dns_forwarder_helpers/__pycache__/server.*.pyc +%{python3_sitearch}/samba/tests/dns_forwarder_helpers/dns_hub.py %{python3_sitearch}/samba/tests/dns_forwarder_helpers/server.py %{python3_sitearch}/samba/tests/dns_invalid.py %{python3_sitearch}/samba/tests/dns_tkey.py @@ -2720,6 +2741,7 @@ fi %{python3_sitearch}/samba/tests/dsdb_schema_attributes.py %{python3_sitearch}/samba/tests/docs.py %{python3_sitearch}/samba/tests/domain_backup.py +%{python3_sitearch}/samba/tests/domain_backup_offline.py %dir %{python3_sitearch}/samba/tests/emulate %{python3_sitearch}/samba/tests/emulate/__init__.py %dir %{python3_sitearch}/samba/tests/emulate/__pycache__ @@ -2751,7 +2773,7 @@ fi %{python3_sitearch}/samba/tests/kcc/kcc_utils.py %{python3_sitearch}/samba/tests/kcc/ldif_import_export.py %{python3_sitearch}/samba/tests/krb5_credentials.py -%{python3_sitearch}/samba/tests/libsmb_samba_internal.py +%{python3_sitearch}/samba/tests/libsmb.py %{python3_sitearch}/samba/tests/loadparm.py %{python3_sitearch}/samba/tests/lsa_string.py %{python3_sitearch}/samba/tests/messaging.py @@ -2763,7 +2785,11 @@ fi %{python3_sitearch}/samba/tests/ntacls.py %{python3_sitearch}/samba/tests/ntacls_backup.py %{python3_sitearch}/samba/tests/ntlmdisabled.py +%{python3_sitearch}/samba/tests/ntlm_auth.py +%{python3_sitearch}/samba/tests/ntlm_auth_base.py +%{python3_sitearch}/samba/tests/ntlm_auth_krb5.py %{python3_sitearch}/samba/tests/pam_winbind.py +%{python3_sitearch}/samba/tests/pam_winbind_chauthtok.py %{python3_sitearch}/samba/tests/pam_winbind_warn_pwd_expire.py %{python3_sitearch}/samba/tests/param.py %{python3_sitearch}/samba/tests/password_hash.py @@ -2775,6 +2801,8 @@ fi %{python3_sitearch}/samba/tests/password_test.py %{python3_sitearch}/samba/tests/policy.py %{python3_sitearch}/samba/tests/posixacl.py +%{python3_sitearch}/samba/tests/prefork_restart.py +%{python3_sitearch}/samba/tests/process_limits.py %{python3_sitearch}/samba/tests/provision.py %{python3_sitearch}/samba/tests/pso.py %{python3_sitearch}/samba/tests/py_credentials.py @@ -2847,11 +2875,15 @@ fi %{python3_sitearch}/samba/tests/strings.py %{python3_sitearch}/samba/tests/subunitrun.py %{python3_sitearch}/samba/tests/tdb_util.py -%{python3_sitearch}/samba/tests/unicodenames.py %{python3_sitearch}/samba/tests/upgrade.py %{python3_sitearch}/samba/tests/upgradeprovision.py %{python3_sitearch}/samba/tests/upgradeprovisionneeddc.py %{python3_sitearch}/samba/tests/xattr.py +%dir %{python3_sitearch}/samba/third_party +%{python3_sitearch}/samba/third_party/__init__.py +%dir %{python3_sitearch}/samba/third_party/__pycache__ +%{python3_sitearch}/samba/third_party/__pycache__/__init__.*.pyc +%{python3_sitearch}/samba/uptodateness.py %dir %{python3_sitearch}/samba/web_server %{python3_sitearch}/samba/web_server/__init__.py %dir %{python3_sitearch}/samba/web_server/__pycache__ @@ -2966,6 +2998,7 @@ fi %{_sbindir}/ctdbd %{_sbindir}/ctdbd_wrapper %{_bindir}/ctdb +%{_bindir}/ctdb_local_daemons %{_bindir}/ping_pong %{_bindir}/ltdbtool %{_bindir}/ctdb_diagnostics @@ -3074,6 +3107,7 @@ fi %{_libexecdir}/ctdb/tests/sock_daemon_test %{_libexecdir}/ctdb/tests/sock_io_test %{_libexecdir}/ctdb/tests/srvid_test +%{_libexecdir}/ctdb/tests/system_socket_test %{_libexecdir}/ctdb/tests/test_mutex_raw %{_libexecdir}/ctdb/tests/transaction_loop %{_libexecdir}/ctdb/tests/tunnel_cmd @@ -3085,7 +3119,6 @@ fi %dir %{_datadir}/ctdb/tests/complex %{_datadir}/ctdb/tests/complex/README -%{_datadir}/ctdb/tests/complex/00_ctdb_init.sh %{_datadir}/ctdb/tests/complex/11_ctdb_delip_removes_ip.sh %{_datadir}/ctdb/tests/complex/18_ctdb_reloadips.sh %{_datadir}/ctdb/tests/complex/30_nfs_tickle_killtcp.sh @@ -3141,7 +3174,11 @@ fi %{_datadir}/ctdb/tests/cunit/sock_daemon_test_001.sh %{_datadir}/ctdb/tests/cunit/sock_io_test_001.sh %{_datadir}/ctdb/tests/cunit/srvid_test_001.sh - +%{_datadir}/ctdb/tests/cunit/system_socket_test_001.sh +%dir %{_datadir}/ctdb/tests/etc-ctdb +%dir %{_datadir}/ctdb/tests/etc-ctdb/events +%dir %{_datadir}/ctdb/tests/etc-ctdb/events/legacy +%{_datadir}/ctdb/tests/etc-ctdb/events/legacy/00.test.script %dir %{_datadir}/ctdb/tests/eventd %{_datadir}/ctdb/tests/eventd/README %dir %{_datadir}/ctdb/tests/eventd/etc-ctdb @@ -3483,6 +3520,8 @@ fi %{_datadir}/ctdb/tests/onnode/0004.sh %{_datadir}/ctdb/tests/onnode/0005.sh %{_datadir}/ctdb/tests/onnode/0006.sh +%{_datadir}/ctdb/tests/onnode/0010.sh +%{_datadir}/ctdb/tests/onnode/0011.sh %{_datadir}/ctdb/tests/onnode/0070.sh %{_datadir}/ctdb/tests/onnode/0071.sh %{_datadir}/ctdb/tests/onnode/0072.sh @@ -3519,12 +3558,8 @@ fi %dir %{_datadir}/ctdb/tests/simple %{_datadir}/ctdb/tests/simple/README -%{_datadir}/ctdb/tests/simple/00_ctdb_init.sh %{_datadir}/ctdb/tests/simple/00_ctdb_onnode.sh -%{_datadir}/ctdb/tests/simple/01_ctdb_version.sh -%{_datadir}/ctdb/tests/simple/02_ctdb_listvars.sh -%{_datadir}/ctdb/tests/simple/03_ctdb_getvar.sh -%{_datadir}/ctdb/tests/simple/04_ctdb_setvar.sh +%{_datadir}/ctdb/tests/simple/02_ctdb_tunables.sh %{_datadir}/ctdb/tests/simple/05_ctdb_listnodes.sh %{_datadir}/ctdb/tests/simple/06_ctdb_getpid.sh %{_datadir}/ctdb/tests/simple/07_ctdb_process_exists.sh @@ -3547,11 +3582,9 @@ fi %{_datadir}/ctdb/tests/simple/26_ctdb_config_check_error_on_unreachable_ctdb.sh %{_datadir}/ctdb/tests/simple/27_ctdb_detach.sh %{_datadir}/ctdb/tests/simple/28_zero_eventscripts.sh -%{_datadir}/ctdb/tests/simple/31_ctdb_disable.sh -%{_datadir}/ctdb/tests/simple/32_ctdb_enable.sh +%{_datadir}/ctdb/tests/simple/32_ctdb_disable_enable.sh %{_datadir}/ctdb/tests/simple/35_ctdb_getreclock.sh -%{_datadir}/ctdb/tests/simple/41_ctdb_stop.sh -%{_datadir}/ctdb/tests/simple/42_ctdb_continue.sh +%{_datadir}/ctdb/tests/simple/42_ctdb_stop_continue.sh %{_datadir}/ctdb/tests/simple/43_stop_recmaster_yield.sh %{_datadir}/ctdb/tests/simple/51_message_ring.sh %{_datadir}/ctdb/tests/simple/52_fetch_ring.sh @@ -3574,17 +3607,11 @@ fi %{_datadir}/ctdb/tests/simple/80_ctdb_traverse.sh %{_datadir}/ctdb/tests/simple/81_tunnel_ring.sh %{_datadir}/ctdb/tests/simple/90_debug_hung_script.sh -%{_datadir}/ctdb/tests/simple/99_daemons_shutdown.sh -%dir %{_datadir}/ctdb/tests/simple/etc-ctdb -%dir %{_datadir}/ctdb/tests/simple/etc-ctdb/events -%dir %{_datadir}/ctdb/tests/simple/etc-ctdb/events/legacy -%{_datadir}/ctdb/tests/simple/etc-ctdb/events/legacy/00.test.script %dir %{_datadir}/ctdb/tests/simple/scripts %{_datadir}/ctdb/tests/simple/scripts/local.bash %{_datadir}/ctdb/tests/simple/scripts/local_daemons.bash -%{_datadir}/ctdb/tests/simple/scripts/ssh_local_daemons.sh %dir %{_datadir}/ctdb/tests/takeover %{_datadir}/ctdb/tests/takeover/README @@ -3808,6 +3835,9 @@ fi %endif # with_clustering_support %changelog +* Tue Jan 15 2019 Guenther Deschner - 4.10.0rc1-0 +- Update to Samba 4.10.0rc1 + * Mon Jan 14 2019 Björn Esser - 2:4.9.4-0.1 - Rebuilt for libcrypt.so.2 (#1666033) diff --git a/sources b/sources index 61d59db..60c2ce0 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.9.4.tar.xz) = 8ccaa018b522866ce1305d64eb98bf2eae9a7be72a011f4488238e8c34775649694a9b78ca52532ceec318108885b87c9b21f14e32dd5aef10ba15bc3368c1a3 -SHA512 (samba-4.9.4.tar.asc) = 0fce12e659d075f3be3add738ca2e2074e00a040a71a307f6ee177c884df47cee42027d9eff8c002f501bd3355e29a64a6f595a08cf0b430fc75aeeaab49898f +SHA512 (samba-4.10.0rc1.tar.xz) = fb68d164eac257ca40c9dd0165ad401827fda8d60aedfcbd192ff65d8918bbce686a2cc8e445b1dfe9d2dcd40ffb79528a9345e97b235f5e9e2247fa1d03c656 +SHA512 (samba-4.10.0rc1.tar.asc) = 5ba8f02f80be421b019b3087afebe62b6ef7e0249c30cae3684dbf6ced9f9e076403da7f238cc45316afb35267b9dd6714593617afa2d7b41b36bc5d3732c59c From 3167ab636210b280e6de2afea9d9d9d592e0b744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Thu, 31 Jan 2019 16:25:00 +0100 Subject: [PATCH 29/76] Remove python2 from the build Guenther --- samba.spec | 446 +---------------------------------------------------- 1 file changed, 1 insertion(+), 445 deletions(-) diff --git a/samba.spec b/samba.spec index 0c52228..422c19d 100644 --- a/samba.spec +++ b/samba.spec @@ -82,8 +82,6 @@ %global with_clustering_support 1 %endif -%{!?python2_sitearch: %define python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} - %global _systemd_extra "Environment=KRB5CCNAME=FILE:/run/samba/krb5cc_samba" Name: samba @@ -186,13 +184,8 @@ BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(Parse::Yapp) BuildRequires: perl(Test::More) BuildRequires: popt-devel -BuildRequires: python2-devel BuildRequires: python3-devel %if %{with_dc} -BuildRequires: python2-dns -# Add python2-iso8601 to avoid that the -# version in Samba is being packaged -BuildRequires: python2-iso8601 # Add python3-iso8601 to avoid that the # version in Samba is being packaged BuildRequires: python3-iso8601 @@ -223,7 +216,6 @@ BuildRequires: gnutls-devel >= 3.4.7 BuildRequires: krb5-server >= %{required_mit_krb5} # Required by samba-tool to run tests -BuildRequires: python2-crypto BuildRequires: python3-crypto %endif @@ -231,26 +223,20 @@ BuildRequires: python3-crypto BuildRequires: perl(Parse::Yapp) BuildRequires: libtalloc-devel >= %{talloc_version} -BuildRequires: python2-talloc-devel >= %{talloc_version} BuildRequires: python3-talloc-devel >= %{talloc_version} BuildRequires: libtevent-devel >= %{tevent_version} -BuildRequires: python2-tevent >= %{tevent_version} BuildRequires: python3-tevent >= %{tevent_version} BuildRequires: libtdb-devel >= %{tdb_version} -BuildRequires: python2-tdb >= %{tdb_version} BuildRequires: python3-tdb >= %{tdb_version} BuildRequires: libldb-devel >= %{ldb_version} -BuildRequires: python2-ldb-devel >= %{ldb_version} BuildRequires: python3-ldb-devel >= %{ldb_version} %if %{with testsuite} BuildRequires: ldb-tools BuildRequires: tdb-tools -BuildRequires: python2-gpg -BuildRequires: python2-markdown BuildRequires: python3-gpg BuildRequires: python3-markdown %endif @@ -361,18 +347,11 @@ Requires: tdb-tools # samba-tool needs mdb_copy Requires: lmdb Requires: ldb-tools -# samba-tool requirements, explicitly require python2 right now -Requires: python2 -Requires: python2-%{name} = %{samba_depver} -Requires: python2-%{name}-dc = %{samba_depver} -Requires: python2-crypto # Force using libldb version to be the same as build version # Otherwise LDB modules will not be loaded and samba-tool will fail # See bug 1507420 %requires_eq libldb -### Note that samba-dc right now cannot be used with Python 3 -### so we should make sure it does use python2 explicitly %if 0 Requires: python3-crypto Requires: python3-%{name} = %{samba_depver} @@ -526,48 +505,6 @@ The libwbclient-devel package provides developer tools for the wbclient library. %endif # with_libwbclient -### PYTHON2 -%if %{with_dc} -### PYTHON 2 is required for Samba AD DC right now -%package -n python2-%{name} -Summary: Samba Python libraries -Requires: %{name} = %{samba_depver} -Requires: %{name}-client-libs = %{samba_depver} -Requires: %{name}-common-libs = %{samba_depver} -Requires: %{name}-libs = %{samba_depver} -Requires: python2-tevent -Requires: python2-tdb -Requires: python2-ldb -Requires: python2-talloc -Requires: python2-dns - -Provides: samba-python = %{samba_depver} -Obsoletes: samba-python < %{samba_depver} - -Provides: samba4-python = %{samba_depver} -Obsoletes: samba4-python < %{samba_depver} - -%description -n python2-%{name} -The %{name}-python package contains the Python libraries needed by programs -that use SMB, RPC and other Samba provided protocols in Python programs. - -%package -n python2-samba-test -Summary: Samba Python libraries -Requires: python2-%{name} = %{samba_depver} - -%description -n python2-samba-test -The python2-%{name}-test package contains the Python libraries used by the test suite of Samba. -If you want to run full set of Samba tests, you need to install this package. - -%package -n python2-samba-dc -Summary: Samba Python libraries for Samba AD -Requires: python2-%{name} = %{samba_depver} - -%description -n python2-samba-dc -The python2-%{name}-dc package contains the Python libraries needed by programs -to manage Samba AD. -%endif - ### PYTHON3 %package -n python3-%{name} Summary: Samba Python3 libraries @@ -843,8 +780,6 @@ pathfix.py -n -p -i %{__python2} buildtools/bin/waf export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 %endif # rhel -export PYTHON=%{__python2} - %configure \ --enable-fhs \ --with-piddir=/run \ @@ -890,8 +825,7 @@ export PYTHON=%{__python2} --systemd-smb-extra=%{_systemd_extra} \ --systemd-nmb-extra=%{_systemd_extra} \ --systemd-winbind-extra=%{_systemd_extra} \ - --systemd-samba-extra=%{_systemd_extra} \ - --extra-python=%{__python3} + --systemd-samba-extra=%{_systemd_extra} make %{?_smp_mflags} @@ -901,21 +835,9 @@ rm -rf %{buildroot} %if 0%{?rhel} export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 %endif # rhel -export PYTHON=%{__python2} make %{?_smp_mflags} install DESTDIR=%{buildroot} -# Workaround: make sure all general Python shebangs are pointing to Python 2 -# otherwise it will not work when default python is different from Python 2. -# Samba tools aren't ready for Python 3 yet. -for i in %{buildroot}%{_bindir} %{buildroot}%{_sbindir} ; do - find $i \ - ! -name '*.pyc' -a \ - ! -name '*.pyo' -a \ - -type f -exec grep -qsm1 '^#!.*\bpython' {} \; \ - -exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!%{__python2}|' {} \; -done - install -d -m 0755 %{buildroot}/usr/{sbin,bin} install -d -m 0755 %{buildroot}%{_libdir}/security install -d -m 0755 %{buildroot}/var/lib/samba @@ -1012,33 +934,6 @@ for i in \ %{_libdir}/samba/ldb/ildap.so \ %{_libdir}/samba/ldb/ldbsamba_extensions.so \ %{_unitdir}/samba.service \ - %{python2_sitearch}/samba/dcerpc/dnsserver.so \ - %{python2_sitearch}/samba/dnsserver.py* \ - %{python2_sitearch}/samba/domain_update.py* \ - %{python2_sitearch}/samba/dsdb_dns.so \ - %{python2_sitearch}/samba/dsdb.so \ - %{python2_sitearch}/samba/forest_update.py* \ - %{python2_sitearch}/samba/gpclass.py* \ - %{python2_sitearch}/samba/gpo.so \ - %{python2_sitearch}/samba/gp_sec_ext.py* \ - %{python2_sitearch}/samba/kcc/debug.py* \ - %{python2_sitearch}/samba/kcc/graph.py* \ - %{python2_sitearch}/samba/kcc/graph_utils.py* \ - %{python2_sitearch}/samba/kcc/__init__.py* \ - %{python2_sitearch}/samba/kcc/kcc_utils.py* \ - %{python2_sitearch}/samba/kcc/ldif_import_export.py* \ - %{python2_sitearch}/samba/mdb_util.py* \ - %{python2_sitearch}/samba/ms_forest_updates_markdown.py* \ - %{python2_sitearch}/samba/ms_schema_markdown.py* \ - %{python2_sitearch}/samba/provision/backend.py* \ - %{python2_sitearch}/samba/provision/common.py* \ - %{python2_sitearch}/samba/provision/__init__.py* \ - %{python2_sitearch}/samba/provision/kerberos_implementation.py* \ - %{python2_sitearch}/samba/provision/kerberos.py* \ - %{python2_sitearch}/samba/provision/sambadns.py* \ - %{python2_sitearch}/samba/samdb.py* \ - %{python2_sitearch}/samba/schema.py* \ - %{python2_sitearch}/samba/web_server/__init__.py* \ %{python3_sitearch}/samba/dcerpc/dnsserver.*.so \ %{python3_sitearch}/samba/dnsserver.py \ %{python3_sitearch}/samba/domain_update.py \ @@ -1088,14 +983,7 @@ done # the ldconfig-created links be recorded in the RPM. /sbin/ldconfig -N -n %{buildroot}%{_libdir} -# FIXME -find %{buildroot}%{python2_sitearch} -name "*.pyc" -print -delete - %if ! %with_dc -# Remove whole %python2_sitearch for non-DC build -# Also remove libraries specific to DC or only used for test generation -# but requiring Python 2 -rm -rf %{buildroot}%{python2_sitearch} for f in samba/libsamba-net-samba4.so \ samba/libsamba-python-samba4.so \ libsamba-policy.so* \ @@ -1109,7 +997,6 @@ done %if 0%{?rhel} export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 %endif # rhel -export PYTHON=%{__python2} TDB_NO_FSYNC=1 make %{?_smp_mflags} test %endif # with testsuite @@ -1938,337 +1825,6 @@ fi %{_mandir}/man1/pidl* %{_mandir}/man3/Parse::Pidl* -### PYTHON2 -%if %{with_dc} -%files -n python2-%{name} -%{_libdir}/samba/libsamba-python-samba4.so -%{_libdir}/samba/libsamba-net-samba4.so -%{_libdir}/libsamba-policy.so.* - -%dir %{python2_sitearch}/samba -%{python2_sitearch}/samba/__init__.py* -%{python2_sitearch}/samba/_glue.so -%{python2_sitearch}/samba/_ldb.so -%{python2_sitearch}/samba/auth.so -%{python2_sitearch}/samba/colour.py* -%{python2_sitearch}/samba/common.py* -%{python2_sitearch}/samba/compat.py* -%{python2_sitearch}/samba/credentials.so -%{python2_sitearch}/samba/crypto.so -%{python2_sitearch}/samba/dbchecker.py* -%{python2_sitearch}/samba/descriptor.py* -%{python2_sitearch}/samba/drs_utils.py* -%{python2_sitearch}/samba/gensec.so -%{python2_sitearch}/samba/getopt.py* -%{python2_sitearch}/samba/graph.py* -%{python2_sitearch}/samba/hostconfig.py* -%{python2_sitearch}/samba/idmap.py* -%{python2_sitearch}/samba/join.py* -%{python2_sitearch}/samba/messaging.so -%{python2_sitearch}/samba/ms_display_specifiers.py* -%{python2_sitearch}/samba/ms_schema.py* -%{python2_sitearch}/samba/ndr.py* -%{python2_sitearch}/samba/net.so -%{python2_sitearch}/samba/netbios.so -%{python2_sitearch}/samba/ntacls.py* -%{python2_sitearch}/samba/ntstatus.so -%{python2_sitearch}/samba/param.so -%{python2_sitearch}/samba/policy.so -%{python2_sitearch}/samba/posix_eadb.so -%{python2_sitearch}/samba/registry.so -%{python2_sitearch}/samba/remove_dc.py* -%{python2_sitearch}/samba/sd_utils.py* -%{python2_sitearch}/samba/security.so -%{python2_sitearch}/samba/sites.py* -%{python2_sitearch}/samba/smb.so -%{python2_sitearch}/samba/subnets.py* -%{python2_sitearch}/samba/upgrade.py* -%{python2_sitearch}/samba/upgradehelpers.py* -%{python2_sitearch}/samba/werror.so -%{python2_sitearch}/samba/xattr.py* -%{python2_sitearch}/samba/xattr_native.so -%{python2_sitearch}/samba/xattr_tdb.so - -%dir %{python2_sitearch}/samba/dcerpc -%{python2_sitearch}/samba/dcerpc/__init__.py* -%{python2_sitearch}/samba/dcerpc/atsvc.so -%{python2_sitearch}/samba/dcerpc/auth.so -%{python2_sitearch}/samba/dcerpc/base.so -%{python2_sitearch}/samba/dcerpc/dcerpc.so -%{python2_sitearch}/samba/dcerpc/dfs.so -%{python2_sitearch}/samba/dcerpc/dns.so -%{python2_sitearch}/samba/dcerpc/dnsp.so -%{python2_sitearch}/samba/dcerpc/drsblobs.so -%{python2_sitearch}/samba/dcerpc/drsuapi.so -%{python2_sitearch}/samba/dcerpc/echo.so -%{python2_sitearch}/samba/dcerpc/epmapper.so -%{python2_sitearch}/samba/dcerpc/idmap.so -%{python2_sitearch}/samba/dcerpc/initshutdown.so -%{python2_sitearch}/samba/dcerpc/irpc.so -%{python2_sitearch}/samba/dcerpc/krb5pac.so -%{python2_sitearch}/samba/dcerpc/lsa.so -%{python2_sitearch}/samba/dcerpc/messaging.so -%{python2_sitearch}/samba/dcerpc/mgmt.so -%{python2_sitearch}/samba/dcerpc/misc.so -%{python2_sitearch}/samba/dcerpc/nbt.so -%{python2_sitearch}/samba/dcerpc/netlogon.so -%{python2_sitearch}/samba/dcerpc/ntlmssp.so -%{python2_sitearch}/samba/dcerpc/samr.so -%{python2_sitearch}/samba/dcerpc/security.so -%{python2_sitearch}/samba/dcerpc/server_id.so -%{python2_sitearch}/samba/dcerpc/smb_acl.so -%{python2_sitearch}/samba/dcerpc/srvsvc.so -%{python2_sitearch}/samba/dcerpc/svcctl.so -%{python2_sitearch}/samba/dcerpc/unixinfo.so -%{python2_sitearch}/samba/dcerpc/winbind.so -%{python2_sitearch}/samba/dcerpc/winreg.so -%{python2_sitearch}/samba/dcerpc/wkssvc.so -%{python2_sitearch}/samba/dcerpc/xattr.so - -%dir %{python2_sitearch}/samba/emulate -%{python2_sitearch}/samba/emulate/__init__.py* -%{python2_sitearch}/samba/emulate/traffic.py* -%{python2_sitearch}/samba/emulate/traffic_packets.py* - -%dir %{python2_sitearch}/samba/netcmd -%{python2_sitearch}/samba/netcmd/__init__.py* -%{python2_sitearch}/samba/netcmd/common.py* -%{python2_sitearch}/samba/netcmd/computer.py* -%{python2_sitearch}/samba/netcmd/dbcheck.py* -%{python2_sitearch}/samba/netcmd/delegation.py* -%{python2_sitearch}/samba/netcmd/dns.py* -%{python2_sitearch}/samba/netcmd/domain.py* -%{python2_sitearch}/samba/netcmd/domain_backup.py* -%{python2_sitearch}/samba/netcmd/drs.py* -%{python2_sitearch}/samba/netcmd/dsacl.py* -%{python2_sitearch}/samba/netcmd/forest.py* -%{python2_sitearch}/samba/netcmd/fsmo.py* -%{python2_sitearch}/samba/netcmd/gpo.py* -%{python2_sitearch}/samba/netcmd/group.py* -%{python2_sitearch}/samba/netcmd/ldapcmp.py* -%{python2_sitearch}/samba/netcmd/main.py* -%{python2_sitearch}/samba/netcmd/nettime.py* -%{python2_sitearch}/samba/netcmd/ntacl.py* -%{python2_sitearch}/samba/netcmd/ou.py* -%{python2_sitearch}/samba/netcmd/processes.py* -%{python2_sitearch}/samba/netcmd/pso.py* -%{python2_sitearch}/samba/netcmd/rodc.py* -%{python2_sitearch}/samba/netcmd/schema.py* -%{python2_sitearch}/samba/netcmd/sites.py* -%{python2_sitearch}/samba/netcmd/spn.py* -%{python2_sitearch}/samba/netcmd/testparm.py* -%{python2_sitearch}/samba/netcmd/user.py* -%{python2_sitearch}/samba/netcmd/visualize.py* - -%dir %{python2_sitearch}/samba/samba3 -%{python2_sitearch}/samba/samba3/__init__.py* -%{python2_sitearch}/samba/samba3/libsmb_samba_internal.so -%{python2_sitearch}/samba/samba3/param.so -%{python2_sitearch}/samba/samba3/passdb.so -%{python2_sitearch}/samba/samba3/smbd.so - -%dir %{python2_sitearch}/samba/subunit -%{python2_sitearch}/samba/subunit/__init__.py* -%{python2_sitearch}/samba/subunit/run.py* -%{python2_sitearch}/samba/tdb_util.py* - -%dir %{python2_sitearch}/samba/third_party -%{python2_sitearch}/samba/third_party/__init__.py* - -%if %{with_dc} -%files -n python2-%{name}-dc -%{python2_sitearch}/samba/domain_update.py* -%{python2_sitearch}/samba/dckeytab.so -%{python2_sitearch}/samba/dsdb.so -%{python2_sitearch}/samba/dsdb_dns.so -%{python2_sitearch}/samba/dnsserver.py* -%{python2_sitearch}/samba/forest_update.py* -%{python2_sitearch}/samba/gpclass.py* -%{python2_sitearch}/samba/gpo.so -%{python2_sitearch}/samba/gp_sec_ext.py* -%{python2_sitearch}/samba/mdb_util.py* -%{python2_sitearch}/samba/ms_forest_updates_markdown.py* -%{python2_sitearch}/samba/ms_schema_markdown.py* -%{python2_sitearch}/samba/samdb.py* -%{python2_sitearch}/samba/schema.py* - -%{python2_sitearch}/samba/dcerpc/dnsserver.so - -%dir %{python2_sitearch}/samba/kcc -%{python2_sitearch}/samba/kcc/__init__.py* -%{python2_sitearch}/samba/kcc/debug.py* -%{python2_sitearch}/samba/kcc/graph.py* -%{python2_sitearch}/samba/kcc/graph_utils.py* -%{python2_sitearch}/samba/kcc/kcc_utils.py* -%{python2_sitearch}/samba/kcc/ldif_import_export.py* - -%dir %{python2_sitearch}/samba/provision -%{python2_sitearch}/samba/provision/__init__.py* -%{python2_sitearch}/samba/provision/backend.py* -%{python2_sitearch}/samba/provision/common.py* -%{python2_sitearch}/samba/provision/kerberos.py* -%{python2_sitearch}/samba/provision/kerberos_implementation.py* -%{python2_sitearch}/samba/provision/sambadns.py* - -%dir %{python2_sitearch}/samba/web_server -%{python2_sitearch}/samba/web_server/__init__.py* -%endif - -%files -n python2-%{name}-test -%dir %{python2_sitearch}/samba/tests -%{python2_sitearch}/samba/tests/__init__.py* -%{python2_sitearch}/samba/tests/audit_log_base.py* -%{python2_sitearch}/samba/tests/audit_log_dsdb.py* -%{python2_sitearch}/samba/tests/audit_log_pass_change.py* -%{python2_sitearch}/samba/tests/auth.py* -%{python2_sitearch}/samba/tests/auth_log.py* -%{python2_sitearch}/samba/tests/auth_log_base.py* -%{python2_sitearch}/samba/tests/auth_log_ncalrpc.py* -%{python2_sitearch}/samba/tests/auth_log_netlogon.py* -%{python2_sitearch}/samba/tests/auth_log_netlogon_bad_creds.py* -%{python2_sitearch}/samba/tests/auth_log_pass_change.py* -%{python2_sitearch}/samba/tests/auth_log_samlogon.py* -%dir %{python2_sitearch}/samba/tests/blackbox -%{python2_sitearch}/samba/tests/blackbox/__init__.py* -%{python2_sitearch}/samba/tests/blackbox/bug13653.py* -%{python2_sitearch}/samba/tests/blackbox/check_output.py* -%{python2_sitearch}/samba/tests/blackbox/ndrdump.py* -%{python2_sitearch}/samba/tests/blackbox/samba_dnsupdate.py* -%{python2_sitearch}/samba/tests/blackbox/smbcontrol.py* -%{python2_sitearch}/samba/tests/blackbox/traffic_learner.py* -%{python2_sitearch}/samba/tests/blackbox/traffic_replay.py* -%{python2_sitearch}/samba/tests/blackbox/traffic_summary.py* -%{python2_sitearch}/samba/tests/common.py* -%{python2_sitearch}/samba/tests/core.py* -%{python2_sitearch}/samba/tests/credentials.py* -%dir %{python2_sitearch}/samba/tests/dcerpc -%{python2_sitearch}/samba/tests/dcerpc/__init__.py* -%{python2_sitearch}/samba/tests/dcerpc/array.py* -%{python2_sitearch}/samba/tests/dcerpc/bare.py* -%{python2_sitearch}/samba/tests/dcerpc/dnsserver.py* -%{python2_sitearch}/samba/tests/dcerpc/integer.py* -%{python2_sitearch}/samba/tests/dcerpc/misc.py* -%{python2_sitearch}/samba/tests/dcerpc/raw_protocol.py* -%{python2_sitearch}/samba/tests/dcerpc/raw_testcase.py* -%{python2_sitearch}/samba/tests/dcerpc/registry.py* -%{python2_sitearch}/samba/tests/dcerpc/rpc_talloc.py* -%{python2_sitearch}/samba/tests/dcerpc/rpcecho.py* -%{python2_sitearch}/samba/tests/dcerpc/sam.py* -%{python2_sitearch}/samba/tests/dcerpc/srvsvc.py* -%{python2_sitearch}/samba/tests/dcerpc/string.py* -%{python2_sitearch}/samba/tests/dcerpc/testrpc.py* -%{python2_sitearch}/samba/tests/dcerpc/unix.py* -%{python2_sitearch}/samba/tests/dckeytab.py* -%{python2_sitearch}/samba/tests/dns.py* -%{python2_sitearch}/samba/tests/dns_base.py* -%{python2_sitearch}/samba/tests/dns_forwarder.py* -%{python2_sitearch}/samba/tests/dns_invalid.py* -%dir %{python2_sitearch}/samba/tests/dns_forwarder_helpers -%{python2_sitearch}/samba/tests/dns_forwarder_helpers/server.py* -%{python2_sitearch}/samba/tests/dns_tkey.py* -%{python2_sitearch}/samba/tests/dns_wildcard.py* -%{python2_sitearch}/samba/tests/docs.py* -%{python2_sitearch}/samba/tests/domain_backup.py* -%{python2_sitearch}/samba/tests/dsdb.py* -%{python2_sitearch}/samba/tests/dsdb_lock.py* -%{python2_sitearch}/samba/tests/dsdb_schema_attributes.py* -%dir %{python2_sitearch}/samba/tests/emulate -%{python2_sitearch}/samba/tests/emulate/__init__.py* -%{python2_sitearch}/samba/tests/emulate/traffic.py* -%{python2_sitearch}/samba/tests/emulate/traffic_packet.py* -%{python2_sitearch}/samba/tests/encrypted_secrets.py* -%{python2_sitearch}/samba/tests/gensec.py* -%{python2_sitearch}/samba/tests/getdcname.py* -%{python2_sitearch}/samba/tests/get_opt.py* -%{python2_sitearch}/samba/tests/glue.py* -%{python2_sitearch}/samba/tests/gpo.py* -%{python2_sitearch}/samba/tests/graph.py* -%{python2_sitearch}/samba/tests/group_audit.py* -%{python2_sitearch}/samba/tests/hostconfig.py* -%{python2_sitearch}/samba/tests/join.py* -%dir %{python2_sitearch}/samba/tests/kcc -%{python2_sitearch}/samba/tests/kcc/__init__.py* -%{python2_sitearch}/samba/tests/kcc/graph.py* -%{python2_sitearch}/samba/tests/kcc/graph_utils.py* -%{python2_sitearch}/samba/tests/kcc/kcc_utils.py* -%{python2_sitearch}/samba/tests/kcc/ldif_import_export.py* -%{python2_sitearch}/samba/tests/krb5_credentials.py* -%{python2_sitearch}/samba/tests/libsmb_samba_internal.py* -%{python2_sitearch}/samba/tests/loadparm.py* -%{python2_sitearch}/samba/tests/lsa_string.py* -%{python2_sitearch}/samba/tests/messaging.py* -%{python2_sitearch}/samba/tests/net_join.py* -%{python2_sitearch}/samba/tests/net_join_no_spnego.py* -%{python2_sitearch}/samba/tests/netbios.py* -%{python2_sitearch}/samba/tests/netcmd.py* -%{python2_sitearch}/samba/tests/netlogonsvc.py* -%{python2_sitearch}/samba/tests/ntacls.py* -%{python2_sitearch}/samba/tests/ntacls_backup.py* -%{python2_sitearch}/samba/tests/ntlmdisabled.py* -%{python2_sitearch}/samba/tests/pam_winbind.py* -%{python2_sitearch}/samba/tests/pam_winbind_warn_pwd_expire.py* -%{python2_sitearch}/samba/tests/param.py* -%{python2_sitearch}/samba/tests/password_hash.py* -%{python2_sitearch}/samba/tests/password_hash_fl2003.py* -%{python2_sitearch}/samba/tests/password_hash_fl2008.py* -%{python2_sitearch}/samba/tests/password_hash_gpgme.py* -%{python2_sitearch}/samba/tests/password_hash_ldap.py* -%{python2_sitearch}/samba/tests/password_quality.py* -%{python2_sitearch}/samba/tests/password_test.py* -%{python2_sitearch}/samba/tests/policy.py* -%{python2_sitearch}/samba/tests/posixacl.py* -%{python2_sitearch}/samba/tests/provision.py* -%{python2_sitearch}/samba/tests/pso.py* -%{python2_sitearch}/samba/tests/py_credentials.py* -%{python2_sitearch}/samba/tests/registry.py* -%{python2_sitearch}/samba/tests/s3idmapdb.py* -%{python2_sitearch}/samba/tests/s3param.py* -%{python2_sitearch}/samba/tests/s3passdb.py* -%{python2_sitearch}/samba/tests/s3registry.py* -%{python2_sitearch}/samba/tests/s3windb.py* -%{python2_sitearch}/samba/tests/samba3sam.py* -%dir %{python2_sitearch}/samba/tests/samba_tool -%{python2_sitearch}/samba/tests/samba_tool/__init__.py* -%{python2_sitearch}/samba/tests/samba_tool/base.py* -%{python2_sitearch}/samba/tests/samba_tool/computer.py* -%{python2_sitearch}/samba/tests/samba_tool/demote.py* -%{python2_sitearch}/samba/tests/samba_tool/dnscmd.py* -%{python2_sitearch}/samba/tests/samba_tool/forest.py* -%{python2_sitearch}/samba/tests/samba_tool/fsmo.py* -%{python2_sitearch}/samba/tests/samba_tool/gpo.py* -%{python2_sitearch}/samba/tests/samba_tool/group.py* -%{python2_sitearch}/samba/tests/samba_tool/help.py* -%{python2_sitearch}/samba/tests/samba_tool/join.py* -%{python2_sitearch}/samba/tests/samba_tool/ntacl.py* -%{python2_sitearch}/samba/tests/samba_tool/ou.py* -%{python2_sitearch}/samba/tests/samba_tool/passwordsettings.py* -%{python2_sitearch}/samba/tests/samba_tool/processes.py* -%{python2_sitearch}/samba/tests/samba_tool/provision_password_check.py* -%{python2_sitearch}/samba/tests/samba_tool/rodc.py* -%{python2_sitearch}/samba/tests/samba_tool/schema.py* -%{python2_sitearch}/samba/tests/samba_tool/sites.py* -%{python2_sitearch}/samba/tests/samba_tool/timecmd.py* -%{python2_sitearch}/samba/tests/samba_tool/user.py* -%{python2_sitearch}/samba/tests/samba_tool/user_check_password_script.py* -%{python2_sitearch}/samba/tests/samba_tool/user_virtualCryptSHA.py* -%{python2_sitearch}/samba/tests/samba_tool/user_wdigest.py* -%{python2_sitearch}/samba/tests/samba_tool/visualize.py* -%{python2_sitearch}/samba/tests/samba_tool/visualize_drs.py* -%{python2_sitearch}/samba/tests/samdb.py* -%{python2_sitearch}/samba/tests/samdb_api.py* -%{python2_sitearch}/samba/tests/security.py* -%{python2_sitearch}/samba/tests/smb.py* -%{python2_sitearch}/samba/tests/source.py* -%{python2_sitearch}/samba/tests/strings.py* -%{python2_sitearch}/samba/tests/subunitrun.py* -%{python2_sitearch}/samba/tests/tdb_util.py* -%{python2_sitearch}/samba/tests/unicodenames.py* -%{python2_sitearch}/samba/tests/upgrade.py* -%{python2_sitearch}/samba/tests/upgradeprovision.py* -%{python2_sitearch}/samba/tests/upgradeprovisionneeddc.py* -%{python2_sitearch}/samba/tests/xattr.py* -%endif # rhel - ### PYTHON3 %files -n python3-%{name} %dir %{python3_sitearch}/samba/ From 2961c3a68301f44610c717a015c0924128a27316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 6 Feb 2019 16:38:48 +0100 Subject: [PATCH 30/76] Update to Samba 4.10.0rc2 Guenther --- .gitignore | 2 ++ samba.spec | 8 +++++++- sources | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9cd446f..dc38cda 100644 --- a/.gitignore +++ b/.gitignore @@ -149,3 +149,5 @@ samba-3.6.0pre1.tar.gz /samba-4.9.4.tar.asc /samba-4.10.0rc1.tar.xz /samba-4.10.0rc1.tar.asc +/samba-4.10.0rc2.tar.xz +/samba-4.10.0rc2.tar.asc diff --git a/samba.spec b/samba.spec index 422c19d..79ecdd6 100644 --- a/samba.spec +++ b/samba.spec @@ -14,7 +14,7 @@ %define tevent_version 0.9.38 %define ldb_version 1.5.2 # This should be rc1 or nil -%define pre_release rc1 +%define pre_release rc2 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -1266,6 +1266,7 @@ fi %if ! %{with_vfs_glusterfs} %exclude %{_mandir}/man8/vfs_glusterfs.8* +%exclude %{_mandir}/man8/vfs_glusterfs_fuse.8* %endif %if ! %{with_vfs_cephfs} @@ -1738,7 +1739,9 @@ fi %if %{with_vfs_glusterfs} %files vfs-glusterfs %{_libdir}/samba/vfs/glusterfs.so +%{_libdir}/samba/vfs/glusterfs_fuse.so %{_mandir}/man8/vfs_glusterfs.8* +%{_mandir}/man8/vfs_glusterfs_fuse.8* %endif ### KRB5-PRINTING @@ -3391,6 +3394,9 @@ fi %endif # with_clustering_support %changelog +* Wed Feb 06 2019 Guenther Deschner - 4.10.0rc2-0 +- Update to Samba 4.10.0rc2 + * Tue Jan 15 2019 Guenther Deschner - 4.10.0rc1-0 - Update to Samba 4.10.0rc1 diff --git a/sources b/sources index 60c2ce0..6705aca 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.0rc1.tar.xz) = fb68d164eac257ca40c9dd0165ad401827fda8d60aedfcbd192ff65d8918bbce686a2cc8e445b1dfe9d2dcd40ffb79528a9345e97b235f5e9e2247fa1d03c656 -SHA512 (samba-4.10.0rc1.tar.asc) = 5ba8f02f80be421b019b3087afebe62b6ef7e0249c30cae3684dbf6ced9f9e076403da7f238cc45316afb35267b9dd6714593617afa2d7b41b36bc5d3732c59c +SHA512 (samba-4.10.0rc2.tar.xz) = d97cefd6284f05deb78484a348c36fa36d5cdd6da67935701626216b0f5fecd24328b63569ac0821bf69551edc1cbb4e6399c404935e8776966954e669fd4411 +SHA512 (samba-4.10.0rc2.tar.asc) = df94e93aa361eee40ef3243457acc6340ee87048724143960a49d64dd7f3ebe32d978a776a3c8e754ebafc7e5b382bb779b30ea35e67768e5ab0e6422d2204a8 From 737284e448f374bb2ff6e6f6f9730eb7fefb70af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 12 Feb 2019 14:45:42 +0100 Subject: [PATCH 31/76] Move samba.xattr modules out of python3 test package resolves: #1674547 Guenther --- samba.spec | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/samba.spec b/samba.spec index 79ecdd6..a8d6985 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 0 +%define main_release 1 %define samba_version 4.10.0 %define talloc_version 2.1.15 @@ -2039,8 +2039,20 @@ fi %{python3_sitearch}/samba/subunit/__pycache__/run.*.pyc %{python3_sitearch}/samba/subunit/run.py %{python3_sitearch}/samba/tdb_util.py +%dir %{python3_sitearch}/samba/third_party +%{python3_sitearch}/samba/third_party/__init__.py +%dir %{python3_sitearch}/samba/third_party/__pycache__ +%{python3_sitearch}/samba/third_party/__pycache__/__init__.*.pyc %{python3_sitearch}/samba/upgrade.py %{python3_sitearch}/samba/upgradehelpers.py +%dir %{python3_sitearch}/samba/web_server +%{python3_sitearch}/samba/web_server/__init__.py +%dir %{python3_sitearch}/samba/web_server/__pycache__ +%{python3_sitearch}/samba/web_server/__pycache__/__init__.*.pyc +%{python3_sitearch}/samba/werror.*.so +%{python3_sitearch}/samba/xattr.py +%{python3_sitearch}/samba/xattr_native.*.so +%{python3_sitearch}/samba/xattr_tdb.*.so # FIXME: # /usr/lib64/libsamba-policy.cpython-36m-x86-64-linux-gnu.so # /usr/lib64/libsamba-policy.cpython-36m-x86-64-linux-gnu.so.0 @@ -2112,6 +2124,7 @@ fi %{python3_sitearch}/samba/provision/__pycache__/sambadns.*.pyc %{python3_sitearch}/samba/remove_dc.py +%{python3_sitearch}/samba/uptodateness.py %endif %files -n python3-%{name}-test @@ -2438,19 +2451,6 @@ fi %{python3_sitearch}/samba/tests/upgradeprovision.py %{python3_sitearch}/samba/tests/upgradeprovisionneeddc.py %{python3_sitearch}/samba/tests/xattr.py -%dir %{python3_sitearch}/samba/third_party -%{python3_sitearch}/samba/third_party/__init__.py -%dir %{python3_sitearch}/samba/third_party/__pycache__ -%{python3_sitearch}/samba/third_party/__pycache__/__init__.*.pyc -%{python3_sitearch}/samba/uptodateness.py -%dir %{python3_sitearch}/samba/web_server -%{python3_sitearch}/samba/web_server/__init__.py -%dir %{python3_sitearch}/samba/web_server/__pycache__ -%{python3_sitearch}/samba/web_server/__pycache__/__init__.*.pyc -%{python3_sitearch}/samba/werror.*.so -%{python3_sitearch}/samba/xattr.py -%{python3_sitearch}/samba/xattr_native.*.so -%{python3_sitearch}/samba/xattr_tdb.*.so ### TEST %files test @@ -3394,6 +3394,9 @@ fi %endif # with_clustering_support %changelog +* Tue Feb 12 2019 Guenther Deschner - 4.10.0rc2-1 +- resolves: #1674547 - Move samba.xattr modules out of python3 test package + * Wed Feb 06 2019 Guenther Deschner - 4.10.0rc2-0 - Update to Samba 4.10.0rc2 From 22af7371c7e922705341700ef748ba8808843807 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Mon, 11 Feb 2019 12:03:57 +0530 Subject: [PATCH 32/76] Fix mailman hyperlink in README Signed-off-by: Anoop C S --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4776ac3..39d4bfb 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ subscribe go to [mailman](http://lists.samba.org) or send mail to samba list, so you only need to be on one. For details of other Samba mailing lists and for access to archives, see -[mailman]( Date: Thu, 14 Feb 2019 15:09:59 +0100 Subject: [PATCH 33/76] Fix public NDR API resolves: #1672231 --- samba-4.10-fix_ndr_public_api.patch | 691 ++++++++++++++++++++++++++++ samba.spec | 13 +- 2 files changed, 700 insertions(+), 4 deletions(-) create mode 100644 samba-4.10-fix_ndr_public_api.patch diff --git a/samba-4.10-fix_ndr_public_api.patch b/samba-4.10-fix_ndr_public_api.patch new file mode 100644 index 0000000..c59e4aa --- /dev/null +++ b/samba-4.10-fix_ndr_public_api.patch @@ -0,0 +1,691 @@ +From 3ef3c708b4ae4f2637d3307dc363389df0b7f05a Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Wed, 13 Feb 2019 10:35:13 +0100 +Subject: [PATCH 1/5] librpc:ndr: Implement ndr_zero_memory() + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 + +Signed-off-by: Andreas Schneider +(cherry picked from commit e1325697c868c6e423d7551e4316e7c72e250dab) +--- + librpc/ABI/ndr-0.2.0.sigs | 264 ++++++++++++++++++++++++++++++++++++++ + librpc/ndr/libndr.h | 1 + + librpc/ndr/util.c | 5 + + librpc/wscript_build | 2 +- + 4 files changed, 271 insertions(+), 1 deletion(-) + create mode 100644 librpc/ABI/ndr-0.2.0.sigs + +diff --git a/librpc/ABI/ndr-0.2.0.sigs b/librpc/ABI/ndr-0.2.0.sigs +new file mode 100644 +index 00000000000..6346f2fb491 +--- /dev/null ++++ b/librpc/ABI/ndr-0.2.0.sigs +@@ -0,0 +1,264 @@ ++GUID_all_zero: bool (const struct GUID *) ++GUID_buf_string: char *(const struct GUID *, struct GUID_txt_buf *) ++GUID_compare: int (const struct GUID *, const struct GUID *) ++GUID_equal: bool (const struct GUID *, const struct GUID *) ++GUID_from_data_blob: NTSTATUS (const DATA_BLOB *, struct GUID *) ++GUID_from_ndr_blob: NTSTATUS (const DATA_BLOB *, struct GUID *) ++GUID_from_string: NTSTATUS (const char *, struct GUID *) ++GUID_hexstring: char *(TALLOC_CTX *, const struct GUID *) ++GUID_random: struct GUID (void) ++GUID_string: char *(TALLOC_CTX *, const struct GUID *) ++GUID_string2: char *(TALLOC_CTX *, const struct GUID *) ++GUID_to_ndr_blob: NTSTATUS (const struct GUID *, TALLOC_CTX *, DATA_BLOB *) ++GUID_zero: struct GUID (void) ++ndr_align_size: size_t (uint32_t, size_t) ++ndr_charset_length: uint32_t (const void *, charset_t) ++ndr_check_array_length: enum ndr_err_code (struct ndr_pull *, void *, uint32_t) ++ndr_check_array_size: enum ndr_err_code (struct ndr_pull *, void *, uint32_t) ++ndr_check_padding: void (struct ndr_pull *, size_t) ++ndr_check_pipe_chunk_trailer: enum ndr_err_code (struct ndr_pull *, int, uint32_t) ++ndr_check_string_terminator: enum ndr_err_code (struct ndr_pull *, uint32_t, uint32_t) ++ndr_get_array_length: uint32_t (struct ndr_pull *, const void *) ++ndr_get_array_size: uint32_t (struct ndr_pull *, const void *) ++ndr_map_error2errno: int (enum ndr_err_code) ++ndr_map_error2ntstatus: NTSTATUS (enum ndr_err_code) ++ndr_map_error2string: const char *(enum ndr_err_code) ++ndr_policy_handle_empty: bool (const struct policy_handle *) ++ndr_policy_handle_equal: bool (const struct policy_handle *, const struct policy_handle *) ++ndr_print_DATA_BLOB: void (struct ndr_print *, const char *, DATA_BLOB) ++ndr_print_GUID: void (struct ndr_print *, const char *, const struct GUID *) ++ndr_print_HRESULT: void (struct ndr_print *, const char *, HRESULT) ++ndr_print_KRB5_EDATA_NTSTATUS: void (struct ndr_print *, const char *, const struct KRB5_EDATA_NTSTATUS *) ++ndr_print_NTSTATUS: void (struct ndr_print *, const char *, NTSTATUS) ++ndr_print_NTTIME: void (struct ndr_print *, const char *, NTTIME) ++ndr_print_NTTIME_1sec: void (struct ndr_print *, const char *, NTTIME) ++ndr_print_NTTIME_hyper: void (struct ndr_print *, const char *, NTTIME) ++ndr_print_WERROR: void (struct ndr_print *, const char *, WERROR) ++ndr_print_array_uint8: void (struct ndr_print *, const char *, const uint8_t *, uint32_t) ++ndr_print_bad_level: void (struct ndr_print *, const char *, uint16_t) ++ndr_print_bitmap_flag: void (struct ndr_print *, size_t, const char *, uint32_t, uint32_t) ++ndr_print_bool: void (struct ndr_print *, const char *, const bool) ++ndr_print_debug: void (ndr_print_fn_t, const char *, void *) ++ndr_print_debug_helper: void (struct ndr_print *, const char *, ...) ++ndr_print_debugc: void (int, ndr_print_fn_t, const char *, void *) ++ndr_print_debugc_helper: void (struct ndr_print *, const char *, ...) ++ndr_print_dlong: void (struct ndr_print *, const char *, int64_t) ++ndr_print_double: void (struct ndr_print *, const char *, double) ++ndr_print_enum: void (struct ndr_print *, const char *, const char *, const char *, uint32_t) ++ndr_print_function_debug: void (ndr_print_function_t, const char *, int, void *) ++ndr_print_function_string: char *(TALLOC_CTX *, ndr_print_function_t, const char *, int, void *) ++ndr_print_get_switch_value: uint32_t (struct ndr_print *, const void *) ++ndr_print_gid_t: void (struct ndr_print *, const char *, gid_t) ++ndr_print_hyper: void (struct ndr_print *, const char *, uint64_t) ++ndr_print_int16: void (struct ndr_print *, const char *, int16_t) ++ndr_print_int32: void (struct ndr_print *, const char *, int32_t) ++ndr_print_int3264: void (struct ndr_print *, const char *, int32_t) ++ndr_print_int8: void (struct ndr_print *, const char *, int8_t) ++ndr_print_ipv4address: void (struct ndr_print *, const char *, const char *) ++ndr_print_ipv6address: void (struct ndr_print *, const char *, const char *) ++ndr_print_ndr_syntax_id: void (struct ndr_print *, const char *, const struct ndr_syntax_id *) ++ndr_print_netr_SamDatabaseID: void (struct ndr_print *, const char *, enum netr_SamDatabaseID) ++ndr_print_netr_SchannelType: void (struct ndr_print *, const char *, enum netr_SchannelType) ++ndr_print_null: void (struct ndr_print *) ++ndr_print_pointer: void (struct ndr_print *, const char *, void *) ++ndr_print_policy_handle: void (struct ndr_print *, const char *, const struct policy_handle *) ++ndr_print_printf_helper: void (struct ndr_print *, const char *, ...) ++ndr_print_ptr: void (struct ndr_print *, const char *, const void *) ++ndr_print_set_switch_value: enum ndr_err_code (struct ndr_print *, const void *, uint32_t) ++ndr_print_sockaddr_storage: void (struct ndr_print *, const char *, const struct sockaddr_storage *) ++ndr_print_string: void (struct ndr_print *, const char *, const char *) ++ndr_print_string_array: void (struct ndr_print *, const char *, const char **) ++ndr_print_string_helper: void (struct ndr_print *, const char *, ...) ++ndr_print_struct: void (struct ndr_print *, const char *, const char *) ++ndr_print_struct_string: char *(TALLOC_CTX *, ndr_print_fn_t, const char *, void *) ++ndr_print_svcctl_ServerType: void (struct ndr_print *, const char *, uint32_t) ++ndr_print_time_t: void (struct ndr_print *, const char *, time_t) ++ndr_print_timespec: void (struct ndr_print *, const char *, const struct timespec *) ++ndr_print_timeval: void (struct ndr_print *, const char *, const struct timeval *) ++ndr_print_udlong: void (struct ndr_print *, const char *, uint64_t) ++ndr_print_udlongr: void (struct ndr_print *, const char *, uint64_t) ++ndr_print_uid_t: void (struct ndr_print *, const char *, uid_t) ++ndr_print_uint16: void (struct ndr_print *, const char *, uint16_t) ++ndr_print_uint32: void (struct ndr_print *, const char *, uint32_t) ++ndr_print_uint3264: void (struct ndr_print *, const char *, uint32_t) ++ndr_print_uint8: void (struct ndr_print *, const char *, uint8_t) ++ndr_print_union: void (struct ndr_print *, const char *, int, const char *) ++ndr_print_union_debug: void (ndr_print_fn_t, const char *, uint32_t, void *) ++ndr_print_union_string: char *(TALLOC_CTX *, ndr_print_fn_t, const char *, uint32_t, void *) ++ndr_print_winreg_Data: void (struct ndr_print *, const char *, const union winreg_Data *) ++ndr_print_winreg_Data_GPO: void (struct ndr_print *, const char *, const union winreg_Data_GPO *) ++ndr_print_winreg_Type: void (struct ndr_print *, const char *, enum winreg_Type) ++ndr_pull_DATA_BLOB: enum ndr_err_code (struct ndr_pull *, int, DATA_BLOB *) ++ndr_pull_GUID: enum ndr_err_code (struct ndr_pull *, int, struct GUID *) ++ndr_pull_HRESULT: enum ndr_err_code (struct ndr_pull *, int, HRESULT *) ++ndr_pull_KRB5_EDATA_NTSTATUS: enum ndr_err_code (struct ndr_pull *, int, struct KRB5_EDATA_NTSTATUS *) ++ndr_pull_NTSTATUS: enum ndr_err_code (struct ndr_pull *, int, NTSTATUS *) ++ndr_pull_NTTIME: enum ndr_err_code (struct ndr_pull *, int, NTTIME *) ++ndr_pull_NTTIME_1sec: enum ndr_err_code (struct ndr_pull *, int, NTTIME *) ++ndr_pull_NTTIME_hyper: enum ndr_err_code (struct ndr_pull *, int, NTTIME *) ++ndr_pull_WERROR: enum ndr_err_code (struct ndr_pull *, int, WERROR *) ++ndr_pull_advance: enum ndr_err_code (struct ndr_pull *, uint32_t) ++ndr_pull_align: enum ndr_err_code (struct ndr_pull *, size_t) ++ndr_pull_append: enum ndr_err_code (struct ndr_pull *, DATA_BLOB *) ++ndr_pull_array_length: enum ndr_err_code (struct ndr_pull *, const void *) ++ndr_pull_array_size: enum ndr_err_code (struct ndr_pull *, const void *) ++ndr_pull_array_uint8: enum ndr_err_code (struct ndr_pull *, int, uint8_t *, uint32_t) ++ndr_pull_bytes: enum ndr_err_code (struct ndr_pull *, uint8_t *, uint32_t) ++ndr_pull_charset: enum ndr_err_code (struct ndr_pull *, int, const char **, uint32_t, uint8_t, charset_t) ++ndr_pull_charset_to_null: enum ndr_err_code (struct ndr_pull *, int, const char **, uint32_t, uint8_t, charset_t) ++ndr_pull_dlong: enum ndr_err_code (struct ndr_pull *, int, int64_t *) ++ndr_pull_double: enum ndr_err_code (struct ndr_pull *, int, double *) ++ndr_pull_enum_uint16: enum ndr_err_code (struct ndr_pull *, int, uint16_t *) ++ndr_pull_enum_uint1632: enum ndr_err_code (struct ndr_pull *, int, uint16_t *) ++ndr_pull_enum_uint32: enum ndr_err_code (struct ndr_pull *, int, uint32_t *) ++ndr_pull_enum_uint8: enum ndr_err_code (struct ndr_pull *, int, uint8_t *) ++ndr_pull_error: enum ndr_err_code (struct ndr_pull *, enum ndr_err_code, const char *, ...) ++ndr_pull_generic_ptr: enum ndr_err_code (struct ndr_pull *, uint32_t *) ++ndr_pull_get_relative_base_offset: uint32_t (struct ndr_pull *) ++ndr_pull_get_switch_value: uint32_t (struct ndr_pull *, const void *) ++ndr_pull_gid_t: enum ndr_err_code (struct ndr_pull *, int, gid_t *) ++ndr_pull_hyper: enum ndr_err_code (struct ndr_pull *, int, uint64_t *) ++ndr_pull_init_blob: struct ndr_pull *(const DATA_BLOB *, TALLOC_CTX *) ++ndr_pull_int16: enum ndr_err_code (struct ndr_pull *, int, int16_t *) ++ndr_pull_int32: enum ndr_err_code (struct ndr_pull *, int, int32_t *) ++ndr_pull_int8: enum ndr_err_code (struct ndr_pull *, int, int8_t *) ++ndr_pull_ipv4address: enum ndr_err_code (struct ndr_pull *, int, const char **) ++ndr_pull_ipv6address: enum ndr_err_code (struct ndr_pull *, int, const char **) ++ndr_pull_ndr_syntax_id: enum ndr_err_code (struct ndr_pull *, int, struct ndr_syntax_id *) ++ndr_pull_netr_SamDatabaseID: enum ndr_err_code (struct ndr_pull *, int, enum netr_SamDatabaseID *) ++ndr_pull_netr_SchannelType: enum ndr_err_code (struct ndr_pull *, int, enum netr_SchannelType *) ++ndr_pull_pointer: enum ndr_err_code (struct ndr_pull *, int, void **) ++ndr_pull_policy_handle: enum ndr_err_code (struct ndr_pull *, int, struct policy_handle *) ++ndr_pull_pop: enum ndr_err_code (struct ndr_pull *) ++ndr_pull_ref_ptr: enum ndr_err_code (struct ndr_pull *, uint32_t *) ++ndr_pull_relative_ptr1: enum ndr_err_code (struct ndr_pull *, const void *, uint32_t) ++ndr_pull_relative_ptr2: enum ndr_err_code (struct ndr_pull *, const void *) ++ndr_pull_relative_ptr_short: enum ndr_err_code (struct ndr_pull *, uint16_t *) ++ndr_pull_restore_relative_base_offset: void (struct ndr_pull *, uint32_t) ++ndr_pull_set_switch_value: enum ndr_err_code (struct ndr_pull *, const void *, uint32_t) ++ndr_pull_setup_relative_base_offset1: enum ndr_err_code (struct ndr_pull *, const void *, uint32_t) ++ndr_pull_setup_relative_base_offset2: enum ndr_err_code (struct ndr_pull *, const void *) ++ndr_pull_steal_switch_value: uint32_t (struct ndr_pull *, const void *) ++ndr_pull_string: enum ndr_err_code (struct ndr_pull *, int, const char **) ++ndr_pull_string_array: enum ndr_err_code (struct ndr_pull *, int, const char ***) ++ndr_pull_struct_blob: enum ndr_err_code (const DATA_BLOB *, TALLOC_CTX *, void *, ndr_pull_flags_fn_t) ++ndr_pull_struct_blob_all: enum ndr_err_code (const DATA_BLOB *, TALLOC_CTX *, void *, ndr_pull_flags_fn_t) ++ndr_pull_struct_blob_all_noalloc: enum ndr_err_code (const DATA_BLOB *, void *, ndr_pull_flags_fn_t) ++ndr_pull_subcontext_end: enum ndr_err_code (struct ndr_pull *, struct ndr_pull *, size_t, ssize_t) ++ndr_pull_subcontext_start: enum ndr_err_code (struct ndr_pull *, struct ndr_pull **, size_t, ssize_t) ++ndr_pull_svcctl_ServerType: enum ndr_err_code (struct ndr_pull *, int, uint32_t *) ++ndr_pull_time_t: enum ndr_err_code (struct ndr_pull *, int, time_t *) ++ndr_pull_timespec: enum ndr_err_code (struct ndr_pull *, int, struct timespec *) ++ndr_pull_timeval: enum ndr_err_code (struct ndr_pull *, int, struct timeval *) ++ndr_pull_trailer_align: enum ndr_err_code (struct ndr_pull *, size_t) ++ndr_pull_udlong: enum ndr_err_code (struct ndr_pull *, int, uint64_t *) ++ndr_pull_udlongr: enum ndr_err_code (struct ndr_pull *, int, uint64_t *) ++ndr_pull_uid_t: enum ndr_err_code (struct ndr_pull *, int, uid_t *) ++ndr_pull_uint16: enum ndr_err_code (struct ndr_pull *, int, uint16_t *) ++ndr_pull_uint1632: enum ndr_err_code (struct ndr_pull *, int, uint16_t *) ++ndr_pull_uint32: enum ndr_err_code (struct ndr_pull *, int, uint32_t *) ++ndr_pull_uint3264: enum ndr_err_code (struct ndr_pull *, int, uint32_t *) ++ndr_pull_uint8: enum ndr_err_code (struct ndr_pull *, int, uint8_t *) ++ndr_pull_union_align: enum ndr_err_code (struct ndr_pull *, size_t) ++ndr_pull_union_blob: enum ndr_err_code (const DATA_BLOB *, TALLOC_CTX *, void *, uint32_t, ndr_pull_flags_fn_t) ++ndr_pull_union_blob_all: enum ndr_err_code (const DATA_BLOB *, TALLOC_CTX *, void *, uint32_t, ndr_pull_flags_fn_t) ++ndr_pull_winreg_Data: enum ndr_err_code (struct ndr_pull *, int, union winreg_Data *) ++ndr_pull_winreg_Data_GPO: enum ndr_err_code (struct ndr_pull *, int, union winreg_Data_GPO *) ++ndr_pull_winreg_Type: enum ndr_err_code (struct ndr_pull *, int, enum winreg_Type *) ++ndr_push_DATA_BLOB: enum ndr_err_code (struct ndr_push *, int, DATA_BLOB) ++ndr_push_GUID: enum ndr_err_code (struct ndr_push *, int, const struct GUID *) ++ndr_push_HRESULT: enum ndr_err_code (struct ndr_push *, int, HRESULT) ++ndr_push_KRB5_EDATA_NTSTATUS: enum ndr_err_code (struct ndr_push *, int, const struct KRB5_EDATA_NTSTATUS *) ++ndr_push_NTSTATUS: enum ndr_err_code (struct ndr_push *, int, NTSTATUS) ++ndr_push_NTTIME: enum ndr_err_code (struct ndr_push *, int, NTTIME) ++ndr_push_NTTIME_1sec: enum ndr_err_code (struct ndr_push *, int, NTTIME) ++ndr_push_NTTIME_hyper: enum ndr_err_code (struct ndr_push *, int, NTTIME) ++ndr_push_WERROR: enum ndr_err_code (struct ndr_push *, int, WERROR) ++ndr_push_align: enum ndr_err_code (struct ndr_push *, size_t) ++ndr_push_array_uint8: enum ndr_err_code (struct ndr_push *, int, const uint8_t *, uint32_t) ++ndr_push_blob: DATA_BLOB (struct ndr_push *) ++ndr_push_bytes: enum ndr_err_code (struct ndr_push *, const uint8_t *, uint32_t) ++ndr_push_charset: enum ndr_err_code (struct ndr_push *, int, const char *, uint32_t, uint8_t, charset_t) ++ndr_push_charset_to_null: enum ndr_err_code (struct ndr_push *, int, const char *, uint32_t, uint8_t, charset_t) ++ndr_push_dlong: enum ndr_err_code (struct ndr_push *, int, int64_t) ++ndr_push_double: enum ndr_err_code (struct ndr_push *, int, double) ++ndr_push_enum_uint16: enum ndr_err_code (struct ndr_push *, int, uint16_t) ++ndr_push_enum_uint1632: enum ndr_err_code (struct ndr_push *, int, uint16_t) ++ndr_push_enum_uint32: enum ndr_err_code (struct ndr_push *, int, uint32_t) ++ndr_push_enum_uint8: enum ndr_err_code (struct ndr_push *, int, uint8_t) ++ndr_push_error: enum ndr_err_code (struct ndr_push *, enum ndr_err_code, const char *, ...) ++ndr_push_expand: enum ndr_err_code (struct ndr_push *, uint32_t) ++ndr_push_full_ptr: enum ndr_err_code (struct ndr_push *, const void *) ++ndr_push_get_relative_base_offset: uint32_t (struct ndr_push *) ++ndr_push_get_switch_value: uint32_t (struct ndr_push *, const void *) ++ndr_push_gid_t: enum ndr_err_code (struct ndr_push *, int, gid_t) ++ndr_push_hyper: enum ndr_err_code (struct ndr_push *, int, uint64_t) ++ndr_push_init_ctx: struct ndr_push *(TALLOC_CTX *) ++ndr_push_int16: enum ndr_err_code (struct ndr_push *, int, int16_t) ++ndr_push_int32: enum ndr_err_code (struct ndr_push *, int, int32_t) ++ndr_push_int8: enum ndr_err_code (struct ndr_push *, int, int8_t) ++ndr_push_ipv4address: enum ndr_err_code (struct ndr_push *, int, const char *) ++ndr_push_ipv6address: enum ndr_err_code (struct ndr_push *, int, const char *) ++ndr_push_ndr_syntax_id: enum ndr_err_code (struct ndr_push *, int, const struct ndr_syntax_id *) ++ndr_push_netr_SamDatabaseID: enum ndr_err_code (struct ndr_push *, int, enum netr_SamDatabaseID) ++ndr_push_netr_SchannelType: enum ndr_err_code (struct ndr_push *, int, enum netr_SchannelType) ++ndr_push_pipe_chunk_trailer: enum ndr_err_code (struct ndr_push *, int, uint32_t) ++ndr_push_pointer: enum ndr_err_code (struct ndr_push *, int, void *) ++ndr_push_policy_handle: enum ndr_err_code (struct ndr_push *, int, const struct policy_handle *) ++ndr_push_ref_ptr: enum ndr_err_code (struct ndr_push *) ++ndr_push_relative_ptr1: enum ndr_err_code (struct ndr_push *, const void *) ++ndr_push_relative_ptr2_end: enum ndr_err_code (struct ndr_push *, const void *) ++ndr_push_relative_ptr2_start: enum ndr_err_code (struct ndr_push *, const void *) ++ndr_push_restore_relative_base_offset: void (struct ndr_push *, uint32_t) ++ndr_push_set_switch_value: enum ndr_err_code (struct ndr_push *, const void *, uint32_t) ++ndr_push_setup_relative_base_offset1: enum ndr_err_code (struct ndr_push *, const void *, uint32_t) ++ndr_push_setup_relative_base_offset2: enum ndr_err_code (struct ndr_push *, const void *) ++ndr_push_short_relative_ptr1: enum ndr_err_code (struct ndr_push *, const void *) ++ndr_push_short_relative_ptr2: enum ndr_err_code (struct ndr_push *, const void *) ++ndr_push_string: enum ndr_err_code (struct ndr_push *, int, const char *) ++ndr_push_string_array: enum ndr_err_code (struct ndr_push *, int, const char **) ++ndr_push_struct_blob: enum ndr_err_code (DATA_BLOB *, TALLOC_CTX *, const void *, ndr_push_flags_fn_t) ++ndr_push_struct_into_fixed_blob: enum ndr_err_code (DATA_BLOB *, const void *, ndr_push_flags_fn_t) ++ndr_push_subcontext_end: enum ndr_err_code (struct ndr_push *, struct ndr_push *, size_t, ssize_t) ++ndr_push_subcontext_start: enum ndr_err_code (struct ndr_push *, struct ndr_push **, size_t, ssize_t) ++ndr_push_svcctl_ServerType: enum ndr_err_code (struct ndr_push *, int, uint32_t) ++ndr_push_time_t: enum ndr_err_code (struct ndr_push *, int, time_t) ++ndr_push_timespec: enum ndr_err_code (struct ndr_push *, int, const struct timespec *) ++ndr_push_timeval: enum ndr_err_code (struct ndr_push *, int, const struct timeval *) ++ndr_push_trailer_align: enum ndr_err_code (struct ndr_push *, size_t) ++ndr_push_udlong: enum ndr_err_code (struct ndr_push *, int, uint64_t) ++ndr_push_udlongr: enum ndr_err_code (struct ndr_push *, int, uint64_t) ++ndr_push_uid_t: enum ndr_err_code (struct ndr_push *, int, uid_t) ++ndr_push_uint16: enum ndr_err_code (struct ndr_push *, int, uint16_t) ++ndr_push_uint1632: enum ndr_err_code (struct ndr_push *, int, uint16_t) ++ndr_push_uint32: enum ndr_err_code (struct ndr_push *, int, uint32_t) ++ndr_push_uint3264: enum ndr_err_code (struct ndr_push *, int, uint32_t) ++ndr_push_uint8: enum ndr_err_code (struct ndr_push *, int, uint8_t) ++ndr_push_union_align: enum ndr_err_code (struct ndr_push *, size_t) ++ndr_push_union_blob: enum ndr_err_code (DATA_BLOB *, TALLOC_CTX *, void *, uint32_t, ndr_push_flags_fn_t) ++ndr_push_unique_ptr: enum ndr_err_code (struct ndr_push *, const void *) ++ndr_push_winreg_Data: enum ndr_err_code (struct ndr_push *, int, const union winreg_Data *) ++ndr_push_winreg_Data_GPO: enum ndr_err_code (struct ndr_push *, int, const union winreg_Data_GPO *) ++ndr_push_winreg_Type: enum ndr_err_code (struct ndr_push *, int, enum winreg_Type) ++ndr_push_zero: enum ndr_err_code (struct ndr_push *, uint32_t) ++ndr_set_flags: void (uint32_t *, uint32_t) ++ndr_size_DATA_BLOB: uint32_t (int, const DATA_BLOB *, int) ++ndr_size_GUID: size_t (const struct GUID *, int) ++ndr_size_string: uint32_t (int, const char * const *, int) ++ndr_size_string_array: size_t (const char **, uint32_t, int) ++ndr_size_struct: size_t (const void *, int, ndr_push_flags_fn_t) ++ndr_size_union: size_t (const void *, int, uint32_t, ndr_push_flags_fn_t) ++ndr_size_winreg_Data_GPO: size_t (const union winreg_Data_GPO *, uint32_t, int) ++ndr_string_array_size: size_t (struct ndr_push *, const char *) ++ndr_string_length: uint32_t (const void *, uint32_t) ++ndr_syntax_id_equal: bool (const struct ndr_syntax_id *, const struct ndr_syntax_id *) ++ndr_syntax_id_from_string: bool (const char *, struct ndr_syntax_id *) ++ndr_syntax_id_null: uuid = {time_low = 0, time_mid = 0, time_hi_and_version = 0, clock_seq = "\000", node = "\000\000\000\000\000"}, if_version = 0 ++ndr_syntax_id_to_string: char *(TALLOC_CTX *, const struct ndr_syntax_id *) ++ndr_token_peek: uint32_t (struct ndr_token_list *, const void *) ++ndr_token_retrieve: enum ndr_err_code (struct ndr_token_list *, const void *, uint32_t *) ++ndr_token_retrieve_cmp_fn: enum ndr_err_code (struct ndr_token_list *, const void *, uint32_t *, comparison_fn_t, bool) ++ndr_token_store: enum ndr_err_code (TALLOC_CTX *, struct ndr_token_list *, const void *, uint32_t) ++ndr_transfer_syntax_ndr: uuid = {time_low = 2324192516, time_mid = 7403, time_hi_and_version = 4553, clock_seq = "\237\350", node = "\b\000+\020H`"}, if_version = 2 ++ndr_transfer_syntax_ndr64: uuid = {time_low = 1903232307, time_mid = 48826, time_hi_and_version = 18743, clock_seq = "\203\031", node = "\265\333\357\234\314\066"}, if_version = 1 ++ndr_zero_memory: void (void *, size_t) +diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h +index c31496fe1dc..1f0f3c227cf 100644 +--- a/librpc/ndr/libndr.h ++++ b/librpc/ndr/libndr.h +@@ -493,6 +493,7 @@ void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct do + size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags); + void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid); + void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss); ++void ndr_zero_memory(void *ptr, size_t len); + bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1, const struct ndr_syntax_id *i2); + char *ndr_syntax_id_to_string(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *id); + bool ndr_syntax_id_from_string(const char *s, struct ndr_syntax_id *id); +diff --git a/librpc/ndr/util.c b/librpc/ndr/util.c +index b2df28dde09..0eb7eba9e5e 100644 +--- a/librpc/ndr/util.c ++++ b/librpc/ndr/util.c +@@ -29,3 +29,8 @@ _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name + char addr[INET6_ADDRSTRLEN]; + ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss)); + } ++ ++_PUBLIC_ void ndr_zero_memory(void *ptr, size_t len) ++{ ++ memset_s(ptr, len, 0, len); ++} +diff --git a/librpc/wscript_build b/librpc/wscript_build +index 9669dfce2bf..8e113c422b2 100644 +--- a/librpc/wscript_build ++++ b/librpc/wscript_build +@@ -725,7 +725,7 @@ bld.SAMBA_LIBRARY('ndr', + public_deps='samba-errors talloc samba-util util_str_hex', + public_headers='gen_ndr/misc.h gen_ndr/ndr_misc.h ndr/libndr.h:ndr.h', + header_path= [('*gen_ndr*', 'gen_ndr')], +- vnum='0.1.2', ++ vnum='0.2.0', + abi_directory='ABI', + abi_match='ndr_* GUID_*', + ) +-- +2.20.1 + + +From 0923cd3b6d50355a292bf0bc1012e49f71d15683 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Wed, 13 Feb 2019 10:38:02 +0100 +Subject: [PATCH 2/5] librpc:ndr: Add NDR_ZERO_STRUCT(P) macros + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 + +Signed-off-by: Andreas Schneider +(cherry picked from commit e3c49978057e3b81c69d1dfbe65182fd91ad79d4) +--- + librpc/ndr/libndr.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h +index 1f0f3c227cf..9c403319b6e 100644 +--- a/librpc/ndr/libndr.h ++++ b/librpc/ndr/libndr.h +@@ -411,6 +411,13 @@ enum ndr_compression_alg { + if (unlikely(!(s))) return ndr_push_error(ndr, NDR_ERR_ALLOC, "push alloc %s failed: %s\n", # s, __location__); \ + } while (0) + ++#define NDR_ZERO_STRUCT(x) ndr_zero_memory(&(x), sizeof(x)) ++#define NDR_ZERO_STRUCTP(x) do { \ ++ if ((x) != NULL) { \ ++ ndr_zero_memory((x), sizeof(*(x))); \ ++ } \ ++} while(0) ++ + /* these are used when generic fn pointers are needed for ndr push/pull fns */ + typedef enum ndr_err_code (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, const void *); + typedef enum ndr_err_code (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void *); +-- +2.20.1 + + +From 2580d726f35f1d8e323d3d9cb82dd70b22d18ba0 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Wed, 13 Feb 2019 10:41:19 +0100 +Subject: [PATCH 3/5] pidl: Use NDR_ZERO_STRUCT(P) macros + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 + +Signed-off-by: Andreas Schneider +(cherry picked from commit b5a3f338d9840a1569da65f5ed784a62ed2094a7) +--- + pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm | 2 +- + pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm | 2 +- + pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 6 +++--- + pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 6 +++--- + 4 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm +index c87d17a5a78..fa7303b8543 100644 +--- a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm ++++ b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm +@@ -103,7 +103,7 @@ sub CallWithStruct($$$$$$) + if (grep(/out/, @{$_->{DIRECTION}})) { $hasout = 1; } + } + +- pidl "ZERO_STRUCT(r->out);" if ($hasout); ++ pidl "NDR_ZERO_STRUCT(r->out);" if ($hasout); + + foreach (@{$fn->{ELEMENTS}}) { + my @dir = @{$_->{DIRECTION}}; +diff --git a/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm b/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm +index 35e6e3f0d19..de050e8f8c6 100644 +--- a/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm ++++ b/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm +@@ -101,7 +101,7 @@ static $tn dcom_proxy_$interface->{NAME}_$name(struct $interface->{NAME} *d, TAL + return status; + } + +- ZERO_STRUCT(r.in.ORPCthis); ++ NDR_ZERO_STRUCT(r.in.ORPCthis); + r.in.ORPCthis.version.MajorVersion = COM_MAJOR_VERSION; + r.in.ORPCthis.version.MinorVersion = COM_MINOR_VERSION; + "; +diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +index 040cd5a4bd3..734e86dd183 100644 +--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm ++++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +@@ -496,7 +496,7 @@ sub ParseFunction_Send($$$$) + + if (defined($fn->{RETURN_TYPE})) { + $self->pidl("/* Result */"); +- $self->pidl("ZERO_STRUCT(state->orig.out.result);"); ++ $self->pidl("NDR_ZERO_STRUCT(state->orig.out.result);"); + $self->pidl(""); + } + +@@ -585,7 +585,7 @@ sub ParseFunction_Done($$$$) + } + + $self->pidl("/* Reset temporary structure */"); +- $self->pidl("ZERO_STRUCT(state->tmp);"); ++ $self->pidl("NDR_ZERO_STRUCT(state->tmp);"); + $self->pidl(""); + + $self->pidl("tevent_req_done(req);"); +@@ -698,7 +698,7 @@ sub ParseFunction_Sync($$$$) + + if (defined($fn->{RETURN_TYPE})) { + $self->pidl("/* Result */"); +- $self->pidl("ZERO_STRUCT(r.out.result);"); ++ $self->pidl("NDR_ZERO_STRUCT(r.out.result);"); + $self->pidl(""); + } + +diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +index eae58a9a432..432e52f89c4 100644 +--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm ++++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +@@ -1134,7 +1134,7 @@ sub ParseElementPullLevel + if (has_property($e, "skip") or has_property($e, "skip_noinit")) { + $self->pidl("/* [skip] '$var_name' */"); + if (not has_property($e, "skip_noinit")) { +- $self->pidl("ZERO_STRUCT($var_name);"); ++ $self->pidl("NDR_ZERO_STRUCT($var_name);"); + } + return; + } +@@ -2551,7 +2551,7 @@ sub ParseFunctionPull($$) + # out to be too tricky (tridge) + foreach my $e (@{$fn->{ELEMENTS}}) { + next unless grep(/out/, @{$e->{DIRECTION}}); +- $self->pidl("ZERO_STRUCT(r->out);"); ++ $self->pidl("NDR_ZERO_STRUCT(r->out);"); + $self->pidl(""); + last; + } +@@ -2600,7 +2600,7 @@ sub ParseFunctionPull($$) + if (grep(/in/, @{$e->{DIRECTION}})) { + $self->pidl("*r->out.$e->{NAME} = *r->in.$e->{NAME};"); + } else { +- $self->pidl("ZERO_STRUCTP(r->out.$e->{NAME});"); ++ $self->pidl("NDR_ZERO_STRUCTP(r->out.$e->{NAME});"); + } + } + } +-- +2.20.1 + + +From aaaa4cbd6194cc2cb4d16d08545ef6c15e84e9c3 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Wed, 6 Feb 2019 16:05:48 +0100 +Subject: [PATCH 4/5] lib:util: Move discard_const(_p) to own header for + libndr.h + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 + +Signed-off-by: Andreas Schneider +Reviewed-by: Guenther Deschner +(cherry picked from commit 69fd926b8a8c601c77006bc3cd156ce189464d45) +--- + lib/util/discard.h | 51 +++++++++++++++++++++++++++++++++ + lib/util/memory.h | 27 ----------------- + lib/util/samba_util.h | 1 + + lib/util/wscript_build | 2 +- + librpc/ndr/libndr.h | 2 +- + source3/libsmb/samlogon_cache.c | 1 + + 6 files changed, 55 insertions(+), 29 deletions(-) + create mode 100644 lib/util/discard.h + +diff --git a/lib/util/discard.h b/lib/util/discard.h +new file mode 100644 +index 00000000000..d2b74ac989c +--- /dev/null ++++ b/lib/util/discard.h +@@ -0,0 +1,51 @@ ++/* ++ Unix SMB/CIFS implementation. ++ Samba utility functions ++ Copyright (C) Andrew Tridgell 1992-1999 ++ Copyright (C) Jelmer Vernooij 2008 ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++*/ ++ ++#ifndef _SAMBA_DISCARD_H_ ++#define _SAMBA_DISCARD_H_ ++ ++/** ++ this is a warning hack. The idea is to use this everywhere that we ++ get the "discarding const" warning from gcc. That doesn't actually ++ fix the problem of course, but it means that when we do get to ++ cleaning them up we can do it by searching the code for ++ discard_const. ++ ++ It also means that other error types aren't as swamped by the noise ++ of hundreds of const warnings, so we are more likely to notice when ++ we get new errors. ++ ++ Please only add more uses of this macro when you find it ++ _really_ hard to fix const warnings. Our aim is to eventually use ++ this function in only a very few places. ++ ++ Also, please call this via the discard_const_p() macro interface, as that ++ makes the return type safe. ++*/ ++#ifndef discard_const ++#define discard_const(ptr) ((void *)((uintptr_t)(ptr))) ++#endif ++ ++/** Type-safe version of discard_const */ ++#ifndef discard_const_p ++#define discard_const_p(type, ptr) ((type *)discard_const(ptr)) ++#endif ++ ++#endif /* _SAMBA_DISCARD_H_ */ +diff --git a/lib/util/memory.h b/lib/util/memory.h +index 3278f6b3c21..0e151cc5f66 100644 +--- a/lib/util/memory.h ++++ b/lib/util/memory.h +@@ -94,31 +94,4 @@ + #define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2))) + #endif + +-/** +- this is a warning hack. The idea is to use this everywhere that we +- get the "discarding const" warning from gcc. That doesn't actually +- fix the problem of course, but it means that when we do get to +- cleaning them up we can do it by searching the code for +- discard_const. +- +- It also means that other error types aren't as swamped by the noise +- of hundreds of const warnings, so we are more likely to notice when +- we get new errors. +- +- Please only add more uses of this macro when you find it +- _really_ hard to fix const warnings. Our aim is to eventually use +- this function in only a very few places. +- +- Also, please call this via the discard_const_p() macro interface, as that +- makes the return type safe. +-*/ +-#ifndef discard_const +-#define discard_const(ptr) ((void *)((uintptr_t)(ptr))) +-#endif +- +-/** Type-safe version of discard_const */ +-#ifndef discard_const_p +-#define discard_const_p(type, ptr) ((type *)discard_const(ptr)) +-#endif +- + #endif /* _SAMBA_MEMORY_H_ */ +diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h +index 7b96a595d43..11c95b5bfe3 100644 +--- a/lib/util/samba_util.h ++++ b/lib/util/samba_util.h +@@ -54,6 +54,7 @@ extern const char *panic_action; + #endif + + #include "lib/util/memory.h" ++#include "lib/util/discard.h" + + #include "fault.h" + +diff --git a/lib/util/wscript_build b/lib/util/wscript_build +index 8fc402062fb..9c9652b26cd 100644 +--- a/lib/util/wscript_build ++++ b/lib/util/wscript_build +@@ -126,7 +126,7 @@ else: + tevent_debug.c memcache.c unix_match.c tfork.c''', + deps='samba-util-core DYNCONFIG close-low-fd tiniparser genrand util_str_hex', + public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid', +- public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h string_wrappers.h idtree.h idtree_random.h blocking.h signal.h substitute.h fault.h genrand.h tfork.h', ++ public_headers='debug.h attr.h byteorder.h data_blob.h discard.h memory.h safe_string.h time.h talloc_stack.h string_wrappers.h idtree.h idtree_random.h blocking.h signal.h substitute.h fault.h genrand.h tfork.h', + header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ], + local_include=False, + vnum='0.0.1', +diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h +index 9c403319b6e..8a15fccfe09 100644 +--- a/librpc/ndr/libndr.h ++++ b/librpc/ndr/libndr.h +@@ -26,7 +26,7 @@ + #define __LIBNDR_H__ + + #include +-#include "../lib/util/memory.h" /* for discard_const */ ++#include "../lib/util/discard.h" /* for discard_const */ + #include "../lib/util/byteorder.h" + #include "../lib/util/data_blob.h" + #include "../lib/util/time.h" +diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c +index 494eb10a6a8..a9ddaab1a41 100644 +--- a/source3/libsmb/samlogon_cache.c ++++ b/source3/libsmb/samlogon_cache.c +@@ -27,6 +27,7 @@ + #include "system/time.h" + #include "lib/util/debug.h" + #include "lib/util/talloc_stack.h" ++#include "lib/util/memory.h" /* for SAFE_FREE() */ + #include "source3/lib/util_path.h" + #include "librpc/gen_ndr/ndr_krb5pac.h" + #include "../libcli/security/security.h" +-- +2.20.1 + + +From 7f05bfa0d0f4e970e655d94ec73582ce28a4b436 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Wed, 13 Feb 2019 10:44:45 +0100 +Subject: [PATCH 5/5] waf: Do not install internal header + +We should not install header files without an public API: + +- memory.h +- safe_strings.h +- talloc_stack.h + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 + +Signed-off-by: Andreas Schneider +(cherry picked from commit a68287f7f978b94b4a63081a71c56f92be5b1efe) +--- + lib/util/wscript_build | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/lib/util/wscript_build b/lib/util/wscript_build +index 9c9652b26cd..e3a004fa3c6 100644 +--- a/lib/util/wscript_build ++++ b/lib/util/wscript_build +@@ -126,7 +126,23 @@ else: + tevent_debug.c memcache.c unix_match.c tfork.c''', + deps='samba-util-core DYNCONFIG close-low-fd tiniparser genrand util_str_hex', + public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid', +- public_headers='debug.h attr.h byteorder.h data_blob.h discard.h memory.h safe_string.h time.h talloc_stack.h string_wrappers.h idtree.h idtree_random.h blocking.h signal.h substitute.h fault.h genrand.h tfork.h', ++ public_headers=''' ++ attr.h ++ byteorder.h ++ data_blob.h ++ debug.h ++ discard.h ++ time.h ++ string_wrappers.h ++ idtree.h ++ idtree_random.h ++ blocking.h ++ signal.h ++ substitute.h ++ fault.h ++ genrand.h ++ tfork.h ++ ''', + header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ], + local_include=False, + vnum='0.0.1', +-- +2.20.1 + diff --git a/samba.spec b/samba.spec index a8d6985..8152492 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 1 +%define main_release 2 %define samba_version 4.10.0 %define talloc_version 2.1.15 @@ -118,6 +118,8 @@ Source14: samba.pamd Source201: README.downgrade +Patch0: samba-4.10-fix_ndr_public_api.patch + Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -178,6 +180,7 @@ BuildRequires: lmdb BuildRequires: ncurses-devel BuildRequires: openldap-devel BuildRequires: pam-devel +BuildRequires: perl-interpreter BuildRequires: perl-generators BuildRequires: perl(Archive::Tar) BuildRequires: perl(ExtUtils::MakeMaker) @@ -545,6 +548,7 @@ to manage Samba AD. ### PIDL %package pidl Summary: Perl IDL compiler +Requires: perl-interpreter Requires: perl(Parse::Yapp) Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) BuildArch: noarch @@ -1669,16 +1673,14 @@ fi %{_includedir}/samba-4.0/util/byteorder.h %{_includedir}/samba-4.0/util/data_blob.h %{_includedir}/samba-4.0/util/debug.h +%{_includedir}/samba-4.0/util/discard.h %{_includedir}/samba-4.0/util/fault.h %{_includedir}/samba-4.0/util/genrand.h %{_includedir}/samba-4.0/util/idtree.h %{_includedir}/samba-4.0/util/idtree_random.h -%{_includedir}/samba-4.0/util/memory.h -%{_includedir}/samba-4.0/util/safe_string.h %{_includedir}/samba-4.0/util/signal.h %{_includedir}/samba-4.0/util/string_wrappers.h %{_includedir}/samba-4.0/util/substitute.h -%{_includedir}/samba-4.0/util/talloc_stack.h %{_includedir}/samba-4.0/util/tevent_ntstatus.h %{_includedir}/samba-4.0/util/tevent_unix.h %{_includedir}/samba-4.0/util/tevent_werror.h @@ -3394,6 +3396,9 @@ fi %endif # with_clustering_support %changelog +* Thu Feb 14 2019 Andreas Schneider - 4.10.0rc2-2 +- resolves: #1672231 - Fix public NDR API + * Tue Feb 12 2019 Guenther Deschner - 4.10.0rc2-1 - resolves: #1674547 - Move samba.xattr modules out of python3 test package From d5a38cc8ab2d9935fdab349ec58133ee30a7be63 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sun, 17 Feb 2019 09:31:07 +0100 Subject: [PATCH 34/76] Rebuild for readline 8.0 --- samba.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index 8152492..58b6ee1 100644 --- a/samba.spec +++ b/samba.spec @@ -86,7 +86,7 @@ Name: samba Version: %{samba_version} -Release: %{samba_release} +Release: %{samba_release}.1 %if 0%{?rhel} Epoch: 0 @@ -3396,6 +3396,9 @@ fi %endif # with_clustering_support %changelog +* Sun Feb 17 2019 Igor Gnatenko - 2:4.10.0-0.2.rc2.1 +- Rebuild for readline 8.0 + * Thu Feb 14 2019 Andreas Schneider - 4.10.0rc2-2 - resolves: #1672231 - Fix public NDR API From f537739911a6a9de2e67c9876308d5ca55073a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Fri, 22 Feb 2019 11:11:53 +0100 Subject: [PATCH 35/76] Update to Samba 4.10.0rc3 Guenther --- .gitignore | 2 + samba-4.10-fix_ndr_public_api.patch | 691 ---------------------------- samba.spec | 11 +- sources | 4 +- 4 files changed, 10 insertions(+), 698 deletions(-) delete mode 100644 samba-4.10-fix_ndr_public_api.patch diff --git a/.gitignore b/.gitignore index dc38cda..f1d3393 100644 --- a/.gitignore +++ b/.gitignore @@ -151,3 +151,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.0rc1.tar.asc /samba-4.10.0rc2.tar.xz /samba-4.10.0rc2.tar.asc +/samba-4.10.0rc3.tar.xz +/samba-4.10.0rc3.tar.asc diff --git a/samba-4.10-fix_ndr_public_api.patch b/samba-4.10-fix_ndr_public_api.patch deleted file mode 100644 index c59e4aa..0000000 --- a/samba-4.10-fix_ndr_public_api.patch +++ /dev/null @@ -1,691 +0,0 @@ -From 3ef3c708b4ae4f2637d3307dc363389df0b7f05a Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Wed, 13 Feb 2019 10:35:13 +0100 -Subject: [PATCH 1/5] librpc:ndr: Implement ndr_zero_memory() - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 - -Signed-off-by: Andreas Schneider -(cherry picked from commit e1325697c868c6e423d7551e4316e7c72e250dab) ---- - librpc/ABI/ndr-0.2.0.sigs | 264 ++++++++++++++++++++++++++++++++++++++ - librpc/ndr/libndr.h | 1 + - librpc/ndr/util.c | 5 + - librpc/wscript_build | 2 +- - 4 files changed, 271 insertions(+), 1 deletion(-) - create mode 100644 librpc/ABI/ndr-0.2.0.sigs - -diff --git a/librpc/ABI/ndr-0.2.0.sigs b/librpc/ABI/ndr-0.2.0.sigs -new file mode 100644 -index 00000000000..6346f2fb491 ---- /dev/null -+++ b/librpc/ABI/ndr-0.2.0.sigs -@@ -0,0 +1,264 @@ -+GUID_all_zero: bool (const struct GUID *) -+GUID_buf_string: char *(const struct GUID *, struct GUID_txt_buf *) -+GUID_compare: int (const struct GUID *, const struct GUID *) -+GUID_equal: bool (const struct GUID *, const struct GUID *) -+GUID_from_data_blob: NTSTATUS (const DATA_BLOB *, struct GUID *) -+GUID_from_ndr_blob: NTSTATUS (const DATA_BLOB *, struct GUID *) -+GUID_from_string: NTSTATUS (const char *, struct GUID *) -+GUID_hexstring: char *(TALLOC_CTX *, const struct GUID *) -+GUID_random: struct GUID (void) -+GUID_string: char *(TALLOC_CTX *, const struct GUID *) -+GUID_string2: char *(TALLOC_CTX *, const struct GUID *) -+GUID_to_ndr_blob: NTSTATUS (const struct GUID *, TALLOC_CTX *, DATA_BLOB *) -+GUID_zero: struct GUID (void) -+ndr_align_size: size_t (uint32_t, size_t) -+ndr_charset_length: uint32_t (const void *, charset_t) -+ndr_check_array_length: enum ndr_err_code (struct ndr_pull *, void *, uint32_t) -+ndr_check_array_size: enum ndr_err_code (struct ndr_pull *, void *, uint32_t) -+ndr_check_padding: void (struct ndr_pull *, size_t) -+ndr_check_pipe_chunk_trailer: enum ndr_err_code (struct ndr_pull *, int, uint32_t) -+ndr_check_string_terminator: enum ndr_err_code (struct ndr_pull *, uint32_t, uint32_t) -+ndr_get_array_length: uint32_t (struct ndr_pull *, const void *) -+ndr_get_array_size: uint32_t (struct ndr_pull *, const void *) -+ndr_map_error2errno: int (enum ndr_err_code) -+ndr_map_error2ntstatus: NTSTATUS (enum ndr_err_code) -+ndr_map_error2string: const char *(enum ndr_err_code) -+ndr_policy_handle_empty: bool (const struct policy_handle *) -+ndr_policy_handle_equal: bool (const struct policy_handle *, const struct policy_handle *) -+ndr_print_DATA_BLOB: void (struct ndr_print *, const char *, DATA_BLOB) -+ndr_print_GUID: void (struct ndr_print *, const char *, const struct GUID *) -+ndr_print_HRESULT: void (struct ndr_print *, const char *, HRESULT) -+ndr_print_KRB5_EDATA_NTSTATUS: void (struct ndr_print *, const char *, const struct KRB5_EDATA_NTSTATUS *) -+ndr_print_NTSTATUS: void (struct ndr_print *, const char *, NTSTATUS) -+ndr_print_NTTIME: void (struct ndr_print *, const char *, NTTIME) -+ndr_print_NTTIME_1sec: void (struct ndr_print *, const char *, NTTIME) -+ndr_print_NTTIME_hyper: void (struct ndr_print *, const char *, NTTIME) -+ndr_print_WERROR: void (struct ndr_print *, const char *, WERROR) -+ndr_print_array_uint8: void (struct ndr_print *, const char *, const uint8_t *, uint32_t) -+ndr_print_bad_level: void (struct ndr_print *, const char *, uint16_t) -+ndr_print_bitmap_flag: void (struct ndr_print *, size_t, const char *, uint32_t, uint32_t) -+ndr_print_bool: void (struct ndr_print *, const char *, const bool) -+ndr_print_debug: void (ndr_print_fn_t, const char *, void *) -+ndr_print_debug_helper: void (struct ndr_print *, const char *, ...) -+ndr_print_debugc: void (int, ndr_print_fn_t, const char *, void *) -+ndr_print_debugc_helper: void (struct ndr_print *, const char *, ...) -+ndr_print_dlong: void (struct ndr_print *, const char *, int64_t) -+ndr_print_double: void (struct ndr_print *, const char *, double) -+ndr_print_enum: void (struct ndr_print *, const char *, const char *, const char *, uint32_t) -+ndr_print_function_debug: void (ndr_print_function_t, const char *, int, void *) -+ndr_print_function_string: char *(TALLOC_CTX *, ndr_print_function_t, const char *, int, void *) -+ndr_print_get_switch_value: uint32_t (struct ndr_print *, const void *) -+ndr_print_gid_t: void (struct ndr_print *, const char *, gid_t) -+ndr_print_hyper: void (struct ndr_print *, const char *, uint64_t) -+ndr_print_int16: void (struct ndr_print *, const char *, int16_t) -+ndr_print_int32: void (struct ndr_print *, const char *, int32_t) -+ndr_print_int3264: void (struct ndr_print *, const char *, int32_t) -+ndr_print_int8: void (struct ndr_print *, const char *, int8_t) -+ndr_print_ipv4address: void (struct ndr_print *, const char *, const char *) -+ndr_print_ipv6address: void (struct ndr_print *, const char *, const char *) -+ndr_print_ndr_syntax_id: void (struct ndr_print *, const char *, const struct ndr_syntax_id *) -+ndr_print_netr_SamDatabaseID: void (struct ndr_print *, const char *, enum netr_SamDatabaseID) -+ndr_print_netr_SchannelType: void (struct ndr_print *, const char *, enum netr_SchannelType) -+ndr_print_null: void (struct ndr_print *) -+ndr_print_pointer: void (struct ndr_print *, const char *, void *) -+ndr_print_policy_handle: void (struct ndr_print *, const char *, const struct policy_handle *) -+ndr_print_printf_helper: void (struct ndr_print *, const char *, ...) -+ndr_print_ptr: void (struct ndr_print *, const char *, const void *) -+ndr_print_set_switch_value: enum ndr_err_code (struct ndr_print *, const void *, uint32_t) -+ndr_print_sockaddr_storage: void (struct ndr_print *, const char *, const struct sockaddr_storage *) -+ndr_print_string: void (struct ndr_print *, const char *, const char *) -+ndr_print_string_array: void (struct ndr_print *, const char *, const char **) -+ndr_print_string_helper: void (struct ndr_print *, const char *, ...) -+ndr_print_struct: void (struct ndr_print *, const char *, const char *) -+ndr_print_struct_string: char *(TALLOC_CTX *, ndr_print_fn_t, const char *, void *) -+ndr_print_svcctl_ServerType: void (struct ndr_print *, const char *, uint32_t) -+ndr_print_time_t: void (struct ndr_print *, const char *, time_t) -+ndr_print_timespec: void (struct ndr_print *, const char *, const struct timespec *) -+ndr_print_timeval: void (struct ndr_print *, const char *, const struct timeval *) -+ndr_print_udlong: void (struct ndr_print *, const char *, uint64_t) -+ndr_print_udlongr: void (struct ndr_print *, const char *, uint64_t) -+ndr_print_uid_t: void (struct ndr_print *, const char *, uid_t) -+ndr_print_uint16: void (struct ndr_print *, const char *, uint16_t) -+ndr_print_uint32: void (struct ndr_print *, const char *, uint32_t) -+ndr_print_uint3264: void (struct ndr_print *, const char *, uint32_t) -+ndr_print_uint8: void (struct ndr_print *, const char *, uint8_t) -+ndr_print_union: void (struct ndr_print *, const char *, int, const char *) -+ndr_print_union_debug: void (ndr_print_fn_t, const char *, uint32_t, void *) -+ndr_print_union_string: char *(TALLOC_CTX *, ndr_print_fn_t, const char *, uint32_t, void *) -+ndr_print_winreg_Data: void (struct ndr_print *, const char *, const union winreg_Data *) -+ndr_print_winreg_Data_GPO: void (struct ndr_print *, const char *, const union winreg_Data_GPO *) -+ndr_print_winreg_Type: void (struct ndr_print *, const char *, enum winreg_Type) -+ndr_pull_DATA_BLOB: enum ndr_err_code (struct ndr_pull *, int, DATA_BLOB *) -+ndr_pull_GUID: enum ndr_err_code (struct ndr_pull *, int, struct GUID *) -+ndr_pull_HRESULT: enum ndr_err_code (struct ndr_pull *, int, HRESULT *) -+ndr_pull_KRB5_EDATA_NTSTATUS: enum ndr_err_code (struct ndr_pull *, int, struct KRB5_EDATA_NTSTATUS *) -+ndr_pull_NTSTATUS: enum ndr_err_code (struct ndr_pull *, int, NTSTATUS *) -+ndr_pull_NTTIME: enum ndr_err_code (struct ndr_pull *, int, NTTIME *) -+ndr_pull_NTTIME_1sec: enum ndr_err_code (struct ndr_pull *, int, NTTIME *) -+ndr_pull_NTTIME_hyper: enum ndr_err_code (struct ndr_pull *, int, NTTIME *) -+ndr_pull_WERROR: enum ndr_err_code (struct ndr_pull *, int, WERROR *) -+ndr_pull_advance: enum ndr_err_code (struct ndr_pull *, uint32_t) -+ndr_pull_align: enum ndr_err_code (struct ndr_pull *, size_t) -+ndr_pull_append: enum ndr_err_code (struct ndr_pull *, DATA_BLOB *) -+ndr_pull_array_length: enum ndr_err_code (struct ndr_pull *, const void *) -+ndr_pull_array_size: enum ndr_err_code (struct ndr_pull *, const void *) -+ndr_pull_array_uint8: enum ndr_err_code (struct ndr_pull *, int, uint8_t *, uint32_t) -+ndr_pull_bytes: enum ndr_err_code (struct ndr_pull *, uint8_t *, uint32_t) -+ndr_pull_charset: enum ndr_err_code (struct ndr_pull *, int, const char **, uint32_t, uint8_t, charset_t) -+ndr_pull_charset_to_null: enum ndr_err_code (struct ndr_pull *, int, const char **, uint32_t, uint8_t, charset_t) -+ndr_pull_dlong: enum ndr_err_code (struct ndr_pull *, int, int64_t *) -+ndr_pull_double: enum ndr_err_code (struct ndr_pull *, int, double *) -+ndr_pull_enum_uint16: enum ndr_err_code (struct ndr_pull *, int, uint16_t *) -+ndr_pull_enum_uint1632: enum ndr_err_code (struct ndr_pull *, int, uint16_t *) -+ndr_pull_enum_uint32: enum ndr_err_code (struct ndr_pull *, int, uint32_t *) -+ndr_pull_enum_uint8: enum ndr_err_code (struct ndr_pull *, int, uint8_t *) -+ndr_pull_error: enum ndr_err_code (struct ndr_pull *, enum ndr_err_code, const char *, ...) -+ndr_pull_generic_ptr: enum ndr_err_code (struct ndr_pull *, uint32_t *) -+ndr_pull_get_relative_base_offset: uint32_t (struct ndr_pull *) -+ndr_pull_get_switch_value: uint32_t (struct ndr_pull *, const void *) -+ndr_pull_gid_t: enum ndr_err_code (struct ndr_pull *, int, gid_t *) -+ndr_pull_hyper: enum ndr_err_code (struct ndr_pull *, int, uint64_t *) -+ndr_pull_init_blob: struct ndr_pull *(const DATA_BLOB *, TALLOC_CTX *) -+ndr_pull_int16: enum ndr_err_code (struct ndr_pull *, int, int16_t *) -+ndr_pull_int32: enum ndr_err_code (struct ndr_pull *, int, int32_t *) -+ndr_pull_int8: enum ndr_err_code (struct ndr_pull *, int, int8_t *) -+ndr_pull_ipv4address: enum ndr_err_code (struct ndr_pull *, int, const char **) -+ndr_pull_ipv6address: enum ndr_err_code (struct ndr_pull *, int, const char **) -+ndr_pull_ndr_syntax_id: enum ndr_err_code (struct ndr_pull *, int, struct ndr_syntax_id *) -+ndr_pull_netr_SamDatabaseID: enum ndr_err_code (struct ndr_pull *, int, enum netr_SamDatabaseID *) -+ndr_pull_netr_SchannelType: enum ndr_err_code (struct ndr_pull *, int, enum netr_SchannelType *) -+ndr_pull_pointer: enum ndr_err_code (struct ndr_pull *, int, void **) -+ndr_pull_policy_handle: enum ndr_err_code (struct ndr_pull *, int, struct policy_handle *) -+ndr_pull_pop: enum ndr_err_code (struct ndr_pull *) -+ndr_pull_ref_ptr: enum ndr_err_code (struct ndr_pull *, uint32_t *) -+ndr_pull_relative_ptr1: enum ndr_err_code (struct ndr_pull *, const void *, uint32_t) -+ndr_pull_relative_ptr2: enum ndr_err_code (struct ndr_pull *, const void *) -+ndr_pull_relative_ptr_short: enum ndr_err_code (struct ndr_pull *, uint16_t *) -+ndr_pull_restore_relative_base_offset: void (struct ndr_pull *, uint32_t) -+ndr_pull_set_switch_value: enum ndr_err_code (struct ndr_pull *, const void *, uint32_t) -+ndr_pull_setup_relative_base_offset1: enum ndr_err_code (struct ndr_pull *, const void *, uint32_t) -+ndr_pull_setup_relative_base_offset2: enum ndr_err_code (struct ndr_pull *, const void *) -+ndr_pull_steal_switch_value: uint32_t (struct ndr_pull *, const void *) -+ndr_pull_string: enum ndr_err_code (struct ndr_pull *, int, const char **) -+ndr_pull_string_array: enum ndr_err_code (struct ndr_pull *, int, const char ***) -+ndr_pull_struct_blob: enum ndr_err_code (const DATA_BLOB *, TALLOC_CTX *, void *, ndr_pull_flags_fn_t) -+ndr_pull_struct_blob_all: enum ndr_err_code (const DATA_BLOB *, TALLOC_CTX *, void *, ndr_pull_flags_fn_t) -+ndr_pull_struct_blob_all_noalloc: enum ndr_err_code (const DATA_BLOB *, void *, ndr_pull_flags_fn_t) -+ndr_pull_subcontext_end: enum ndr_err_code (struct ndr_pull *, struct ndr_pull *, size_t, ssize_t) -+ndr_pull_subcontext_start: enum ndr_err_code (struct ndr_pull *, struct ndr_pull **, size_t, ssize_t) -+ndr_pull_svcctl_ServerType: enum ndr_err_code (struct ndr_pull *, int, uint32_t *) -+ndr_pull_time_t: enum ndr_err_code (struct ndr_pull *, int, time_t *) -+ndr_pull_timespec: enum ndr_err_code (struct ndr_pull *, int, struct timespec *) -+ndr_pull_timeval: enum ndr_err_code (struct ndr_pull *, int, struct timeval *) -+ndr_pull_trailer_align: enum ndr_err_code (struct ndr_pull *, size_t) -+ndr_pull_udlong: enum ndr_err_code (struct ndr_pull *, int, uint64_t *) -+ndr_pull_udlongr: enum ndr_err_code (struct ndr_pull *, int, uint64_t *) -+ndr_pull_uid_t: enum ndr_err_code (struct ndr_pull *, int, uid_t *) -+ndr_pull_uint16: enum ndr_err_code (struct ndr_pull *, int, uint16_t *) -+ndr_pull_uint1632: enum ndr_err_code (struct ndr_pull *, int, uint16_t *) -+ndr_pull_uint32: enum ndr_err_code (struct ndr_pull *, int, uint32_t *) -+ndr_pull_uint3264: enum ndr_err_code (struct ndr_pull *, int, uint32_t *) -+ndr_pull_uint8: enum ndr_err_code (struct ndr_pull *, int, uint8_t *) -+ndr_pull_union_align: enum ndr_err_code (struct ndr_pull *, size_t) -+ndr_pull_union_blob: enum ndr_err_code (const DATA_BLOB *, TALLOC_CTX *, void *, uint32_t, ndr_pull_flags_fn_t) -+ndr_pull_union_blob_all: enum ndr_err_code (const DATA_BLOB *, TALLOC_CTX *, void *, uint32_t, ndr_pull_flags_fn_t) -+ndr_pull_winreg_Data: enum ndr_err_code (struct ndr_pull *, int, union winreg_Data *) -+ndr_pull_winreg_Data_GPO: enum ndr_err_code (struct ndr_pull *, int, union winreg_Data_GPO *) -+ndr_pull_winreg_Type: enum ndr_err_code (struct ndr_pull *, int, enum winreg_Type *) -+ndr_push_DATA_BLOB: enum ndr_err_code (struct ndr_push *, int, DATA_BLOB) -+ndr_push_GUID: enum ndr_err_code (struct ndr_push *, int, const struct GUID *) -+ndr_push_HRESULT: enum ndr_err_code (struct ndr_push *, int, HRESULT) -+ndr_push_KRB5_EDATA_NTSTATUS: enum ndr_err_code (struct ndr_push *, int, const struct KRB5_EDATA_NTSTATUS *) -+ndr_push_NTSTATUS: enum ndr_err_code (struct ndr_push *, int, NTSTATUS) -+ndr_push_NTTIME: enum ndr_err_code (struct ndr_push *, int, NTTIME) -+ndr_push_NTTIME_1sec: enum ndr_err_code (struct ndr_push *, int, NTTIME) -+ndr_push_NTTIME_hyper: enum ndr_err_code (struct ndr_push *, int, NTTIME) -+ndr_push_WERROR: enum ndr_err_code (struct ndr_push *, int, WERROR) -+ndr_push_align: enum ndr_err_code (struct ndr_push *, size_t) -+ndr_push_array_uint8: enum ndr_err_code (struct ndr_push *, int, const uint8_t *, uint32_t) -+ndr_push_blob: DATA_BLOB (struct ndr_push *) -+ndr_push_bytes: enum ndr_err_code (struct ndr_push *, const uint8_t *, uint32_t) -+ndr_push_charset: enum ndr_err_code (struct ndr_push *, int, const char *, uint32_t, uint8_t, charset_t) -+ndr_push_charset_to_null: enum ndr_err_code (struct ndr_push *, int, const char *, uint32_t, uint8_t, charset_t) -+ndr_push_dlong: enum ndr_err_code (struct ndr_push *, int, int64_t) -+ndr_push_double: enum ndr_err_code (struct ndr_push *, int, double) -+ndr_push_enum_uint16: enum ndr_err_code (struct ndr_push *, int, uint16_t) -+ndr_push_enum_uint1632: enum ndr_err_code (struct ndr_push *, int, uint16_t) -+ndr_push_enum_uint32: enum ndr_err_code (struct ndr_push *, int, uint32_t) -+ndr_push_enum_uint8: enum ndr_err_code (struct ndr_push *, int, uint8_t) -+ndr_push_error: enum ndr_err_code (struct ndr_push *, enum ndr_err_code, const char *, ...) -+ndr_push_expand: enum ndr_err_code (struct ndr_push *, uint32_t) -+ndr_push_full_ptr: enum ndr_err_code (struct ndr_push *, const void *) -+ndr_push_get_relative_base_offset: uint32_t (struct ndr_push *) -+ndr_push_get_switch_value: uint32_t (struct ndr_push *, const void *) -+ndr_push_gid_t: enum ndr_err_code (struct ndr_push *, int, gid_t) -+ndr_push_hyper: enum ndr_err_code (struct ndr_push *, int, uint64_t) -+ndr_push_init_ctx: struct ndr_push *(TALLOC_CTX *) -+ndr_push_int16: enum ndr_err_code (struct ndr_push *, int, int16_t) -+ndr_push_int32: enum ndr_err_code (struct ndr_push *, int, int32_t) -+ndr_push_int8: enum ndr_err_code (struct ndr_push *, int, int8_t) -+ndr_push_ipv4address: enum ndr_err_code (struct ndr_push *, int, const char *) -+ndr_push_ipv6address: enum ndr_err_code (struct ndr_push *, int, const char *) -+ndr_push_ndr_syntax_id: enum ndr_err_code (struct ndr_push *, int, const struct ndr_syntax_id *) -+ndr_push_netr_SamDatabaseID: enum ndr_err_code (struct ndr_push *, int, enum netr_SamDatabaseID) -+ndr_push_netr_SchannelType: enum ndr_err_code (struct ndr_push *, int, enum netr_SchannelType) -+ndr_push_pipe_chunk_trailer: enum ndr_err_code (struct ndr_push *, int, uint32_t) -+ndr_push_pointer: enum ndr_err_code (struct ndr_push *, int, void *) -+ndr_push_policy_handle: enum ndr_err_code (struct ndr_push *, int, const struct policy_handle *) -+ndr_push_ref_ptr: enum ndr_err_code (struct ndr_push *) -+ndr_push_relative_ptr1: enum ndr_err_code (struct ndr_push *, const void *) -+ndr_push_relative_ptr2_end: enum ndr_err_code (struct ndr_push *, const void *) -+ndr_push_relative_ptr2_start: enum ndr_err_code (struct ndr_push *, const void *) -+ndr_push_restore_relative_base_offset: void (struct ndr_push *, uint32_t) -+ndr_push_set_switch_value: enum ndr_err_code (struct ndr_push *, const void *, uint32_t) -+ndr_push_setup_relative_base_offset1: enum ndr_err_code (struct ndr_push *, const void *, uint32_t) -+ndr_push_setup_relative_base_offset2: enum ndr_err_code (struct ndr_push *, const void *) -+ndr_push_short_relative_ptr1: enum ndr_err_code (struct ndr_push *, const void *) -+ndr_push_short_relative_ptr2: enum ndr_err_code (struct ndr_push *, const void *) -+ndr_push_string: enum ndr_err_code (struct ndr_push *, int, const char *) -+ndr_push_string_array: enum ndr_err_code (struct ndr_push *, int, const char **) -+ndr_push_struct_blob: enum ndr_err_code (DATA_BLOB *, TALLOC_CTX *, const void *, ndr_push_flags_fn_t) -+ndr_push_struct_into_fixed_blob: enum ndr_err_code (DATA_BLOB *, const void *, ndr_push_flags_fn_t) -+ndr_push_subcontext_end: enum ndr_err_code (struct ndr_push *, struct ndr_push *, size_t, ssize_t) -+ndr_push_subcontext_start: enum ndr_err_code (struct ndr_push *, struct ndr_push **, size_t, ssize_t) -+ndr_push_svcctl_ServerType: enum ndr_err_code (struct ndr_push *, int, uint32_t) -+ndr_push_time_t: enum ndr_err_code (struct ndr_push *, int, time_t) -+ndr_push_timespec: enum ndr_err_code (struct ndr_push *, int, const struct timespec *) -+ndr_push_timeval: enum ndr_err_code (struct ndr_push *, int, const struct timeval *) -+ndr_push_trailer_align: enum ndr_err_code (struct ndr_push *, size_t) -+ndr_push_udlong: enum ndr_err_code (struct ndr_push *, int, uint64_t) -+ndr_push_udlongr: enum ndr_err_code (struct ndr_push *, int, uint64_t) -+ndr_push_uid_t: enum ndr_err_code (struct ndr_push *, int, uid_t) -+ndr_push_uint16: enum ndr_err_code (struct ndr_push *, int, uint16_t) -+ndr_push_uint1632: enum ndr_err_code (struct ndr_push *, int, uint16_t) -+ndr_push_uint32: enum ndr_err_code (struct ndr_push *, int, uint32_t) -+ndr_push_uint3264: enum ndr_err_code (struct ndr_push *, int, uint32_t) -+ndr_push_uint8: enum ndr_err_code (struct ndr_push *, int, uint8_t) -+ndr_push_union_align: enum ndr_err_code (struct ndr_push *, size_t) -+ndr_push_union_blob: enum ndr_err_code (DATA_BLOB *, TALLOC_CTX *, void *, uint32_t, ndr_push_flags_fn_t) -+ndr_push_unique_ptr: enum ndr_err_code (struct ndr_push *, const void *) -+ndr_push_winreg_Data: enum ndr_err_code (struct ndr_push *, int, const union winreg_Data *) -+ndr_push_winreg_Data_GPO: enum ndr_err_code (struct ndr_push *, int, const union winreg_Data_GPO *) -+ndr_push_winreg_Type: enum ndr_err_code (struct ndr_push *, int, enum winreg_Type) -+ndr_push_zero: enum ndr_err_code (struct ndr_push *, uint32_t) -+ndr_set_flags: void (uint32_t *, uint32_t) -+ndr_size_DATA_BLOB: uint32_t (int, const DATA_BLOB *, int) -+ndr_size_GUID: size_t (const struct GUID *, int) -+ndr_size_string: uint32_t (int, const char * const *, int) -+ndr_size_string_array: size_t (const char **, uint32_t, int) -+ndr_size_struct: size_t (const void *, int, ndr_push_flags_fn_t) -+ndr_size_union: size_t (const void *, int, uint32_t, ndr_push_flags_fn_t) -+ndr_size_winreg_Data_GPO: size_t (const union winreg_Data_GPO *, uint32_t, int) -+ndr_string_array_size: size_t (struct ndr_push *, const char *) -+ndr_string_length: uint32_t (const void *, uint32_t) -+ndr_syntax_id_equal: bool (const struct ndr_syntax_id *, const struct ndr_syntax_id *) -+ndr_syntax_id_from_string: bool (const char *, struct ndr_syntax_id *) -+ndr_syntax_id_null: uuid = {time_low = 0, time_mid = 0, time_hi_and_version = 0, clock_seq = "\000", node = "\000\000\000\000\000"}, if_version = 0 -+ndr_syntax_id_to_string: char *(TALLOC_CTX *, const struct ndr_syntax_id *) -+ndr_token_peek: uint32_t (struct ndr_token_list *, const void *) -+ndr_token_retrieve: enum ndr_err_code (struct ndr_token_list *, const void *, uint32_t *) -+ndr_token_retrieve_cmp_fn: enum ndr_err_code (struct ndr_token_list *, const void *, uint32_t *, comparison_fn_t, bool) -+ndr_token_store: enum ndr_err_code (TALLOC_CTX *, struct ndr_token_list *, const void *, uint32_t) -+ndr_transfer_syntax_ndr: uuid = {time_low = 2324192516, time_mid = 7403, time_hi_and_version = 4553, clock_seq = "\237\350", node = "\b\000+\020H`"}, if_version = 2 -+ndr_transfer_syntax_ndr64: uuid = {time_low = 1903232307, time_mid = 48826, time_hi_and_version = 18743, clock_seq = "\203\031", node = "\265\333\357\234\314\066"}, if_version = 1 -+ndr_zero_memory: void (void *, size_t) -diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h -index c31496fe1dc..1f0f3c227cf 100644 ---- a/librpc/ndr/libndr.h -+++ b/librpc/ndr/libndr.h -@@ -493,6 +493,7 @@ void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct do - size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags); - void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid); - void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss); -+void ndr_zero_memory(void *ptr, size_t len); - bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1, const struct ndr_syntax_id *i2); - char *ndr_syntax_id_to_string(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *id); - bool ndr_syntax_id_from_string(const char *s, struct ndr_syntax_id *id); -diff --git a/librpc/ndr/util.c b/librpc/ndr/util.c -index b2df28dde09..0eb7eba9e5e 100644 ---- a/librpc/ndr/util.c -+++ b/librpc/ndr/util.c -@@ -29,3 +29,8 @@ _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name - char addr[INET6_ADDRSTRLEN]; - ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss)); - } -+ -+_PUBLIC_ void ndr_zero_memory(void *ptr, size_t len) -+{ -+ memset_s(ptr, len, 0, len); -+} -diff --git a/librpc/wscript_build b/librpc/wscript_build -index 9669dfce2bf..8e113c422b2 100644 ---- a/librpc/wscript_build -+++ b/librpc/wscript_build -@@ -725,7 +725,7 @@ bld.SAMBA_LIBRARY('ndr', - public_deps='samba-errors talloc samba-util util_str_hex', - public_headers='gen_ndr/misc.h gen_ndr/ndr_misc.h ndr/libndr.h:ndr.h', - header_path= [('*gen_ndr*', 'gen_ndr')], -- vnum='0.1.2', -+ vnum='0.2.0', - abi_directory='ABI', - abi_match='ndr_* GUID_*', - ) --- -2.20.1 - - -From 0923cd3b6d50355a292bf0bc1012e49f71d15683 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Wed, 13 Feb 2019 10:38:02 +0100 -Subject: [PATCH 2/5] librpc:ndr: Add NDR_ZERO_STRUCT(P) macros - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 - -Signed-off-by: Andreas Schneider -(cherry picked from commit e3c49978057e3b81c69d1dfbe65182fd91ad79d4) ---- - librpc/ndr/libndr.h | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h -index 1f0f3c227cf..9c403319b6e 100644 ---- a/librpc/ndr/libndr.h -+++ b/librpc/ndr/libndr.h -@@ -411,6 +411,13 @@ enum ndr_compression_alg { - if (unlikely(!(s))) return ndr_push_error(ndr, NDR_ERR_ALLOC, "push alloc %s failed: %s\n", # s, __location__); \ - } while (0) - -+#define NDR_ZERO_STRUCT(x) ndr_zero_memory(&(x), sizeof(x)) -+#define NDR_ZERO_STRUCTP(x) do { \ -+ if ((x) != NULL) { \ -+ ndr_zero_memory((x), sizeof(*(x))); \ -+ } \ -+} while(0) -+ - /* these are used when generic fn pointers are needed for ndr push/pull fns */ - typedef enum ndr_err_code (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, const void *); - typedef enum ndr_err_code (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void *); --- -2.20.1 - - -From 2580d726f35f1d8e323d3d9cb82dd70b22d18ba0 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Wed, 13 Feb 2019 10:41:19 +0100 -Subject: [PATCH 3/5] pidl: Use NDR_ZERO_STRUCT(P) macros - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 - -Signed-off-by: Andreas Schneider -(cherry picked from commit b5a3f338d9840a1569da65f5ed784a62ed2094a7) ---- - pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm | 2 +- - pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm | 2 +- - pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 6 +++--- - pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 6 +++--- - 4 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm -index c87d17a5a78..fa7303b8543 100644 ---- a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm -+++ b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm -@@ -103,7 +103,7 @@ sub CallWithStruct($$$$$$) - if (grep(/out/, @{$_->{DIRECTION}})) { $hasout = 1; } - } - -- pidl "ZERO_STRUCT(r->out);" if ($hasout); -+ pidl "NDR_ZERO_STRUCT(r->out);" if ($hasout); - - foreach (@{$fn->{ELEMENTS}}) { - my @dir = @{$_->{DIRECTION}}; -diff --git a/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm b/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm -index 35e6e3f0d19..de050e8f8c6 100644 ---- a/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm -+++ b/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm -@@ -101,7 +101,7 @@ static $tn dcom_proxy_$interface->{NAME}_$name(struct $interface->{NAME} *d, TAL - return status; - } - -- ZERO_STRUCT(r.in.ORPCthis); -+ NDR_ZERO_STRUCT(r.in.ORPCthis); - r.in.ORPCthis.version.MajorVersion = COM_MAJOR_VERSION; - r.in.ORPCthis.version.MinorVersion = COM_MINOR_VERSION; - "; -diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm -index 040cd5a4bd3..734e86dd183 100644 ---- a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm -+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm -@@ -496,7 +496,7 @@ sub ParseFunction_Send($$$$) - - if (defined($fn->{RETURN_TYPE})) { - $self->pidl("/* Result */"); -- $self->pidl("ZERO_STRUCT(state->orig.out.result);"); -+ $self->pidl("NDR_ZERO_STRUCT(state->orig.out.result);"); - $self->pidl(""); - } - -@@ -585,7 +585,7 @@ sub ParseFunction_Done($$$$) - } - - $self->pidl("/* Reset temporary structure */"); -- $self->pidl("ZERO_STRUCT(state->tmp);"); -+ $self->pidl("NDR_ZERO_STRUCT(state->tmp);"); - $self->pidl(""); - - $self->pidl("tevent_req_done(req);"); -@@ -698,7 +698,7 @@ sub ParseFunction_Sync($$$$) - - if (defined($fn->{RETURN_TYPE})) { - $self->pidl("/* Result */"); -- $self->pidl("ZERO_STRUCT(r.out.result);"); -+ $self->pidl("NDR_ZERO_STRUCT(r.out.result);"); - $self->pidl(""); - } - -diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm -index eae58a9a432..432e52f89c4 100644 ---- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm -+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm -@@ -1134,7 +1134,7 @@ sub ParseElementPullLevel - if (has_property($e, "skip") or has_property($e, "skip_noinit")) { - $self->pidl("/* [skip] '$var_name' */"); - if (not has_property($e, "skip_noinit")) { -- $self->pidl("ZERO_STRUCT($var_name);"); -+ $self->pidl("NDR_ZERO_STRUCT($var_name);"); - } - return; - } -@@ -2551,7 +2551,7 @@ sub ParseFunctionPull($$) - # out to be too tricky (tridge) - foreach my $e (@{$fn->{ELEMENTS}}) { - next unless grep(/out/, @{$e->{DIRECTION}}); -- $self->pidl("ZERO_STRUCT(r->out);"); -+ $self->pidl("NDR_ZERO_STRUCT(r->out);"); - $self->pidl(""); - last; - } -@@ -2600,7 +2600,7 @@ sub ParseFunctionPull($$) - if (grep(/in/, @{$e->{DIRECTION}})) { - $self->pidl("*r->out.$e->{NAME} = *r->in.$e->{NAME};"); - } else { -- $self->pidl("ZERO_STRUCTP(r->out.$e->{NAME});"); -+ $self->pidl("NDR_ZERO_STRUCTP(r->out.$e->{NAME});"); - } - } - } --- -2.20.1 - - -From aaaa4cbd6194cc2cb4d16d08545ef6c15e84e9c3 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Wed, 6 Feb 2019 16:05:48 +0100 -Subject: [PATCH 4/5] lib:util: Move discard_const(_p) to own header for - libndr.h - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 - -Signed-off-by: Andreas Schneider -Reviewed-by: Guenther Deschner -(cherry picked from commit 69fd926b8a8c601c77006bc3cd156ce189464d45) ---- - lib/util/discard.h | 51 +++++++++++++++++++++++++++++++++ - lib/util/memory.h | 27 ----------------- - lib/util/samba_util.h | 1 + - lib/util/wscript_build | 2 +- - librpc/ndr/libndr.h | 2 +- - source3/libsmb/samlogon_cache.c | 1 + - 6 files changed, 55 insertions(+), 29 deletions(-) - create mode 100644 lib/util/discard.h - -diff --git a/lib/util/discard.h b/lib/util/discard.h -new file mode 100644 -index 00000000000..d2b74ac989c ---- /dev/null -+++ b/lib/util/discard.h -@@ -0,0 +1,51 @@ -+/* -+ Unix SMB/CIFS implementation. -+ Samba utility functions -+ Copyright (C) Andrew Tridgell 1992-1999 -+ Copyright (C) Jelmer Vernooij 2008 -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+*/ -+ -+#ifndef _SAMBA_DISCARD_H_ -+#define _SAMBA_DISCARD_H_ -+ -+/** -+ this is a warning hack. The idea is to use this everywhere that we -+ get the "discarding const" warning from gcc. That doesn't actually -+ fix the problem of course, but it means that when we do get to -+ cleaning them up we can do it by searching the code for -+ discard_const. -+ -+ It also means that other error types aren't as swamped by the noise -+ of hundreds of const warnings, so we are more likely to notice when -+ we get new errors. -+ -+ Please only add more uses of this macro when you find it -+ _really_ hard to fix const warnings. Our aim is to eventually use -+ this function in only a very few places. -+ -+ Also, please call this via the discard_const_p() macro interface, as that -+ makes the return type safe. -+*/ -+#ifndef discard_const -+#define discard_const(ptr) ((void *)((uintptr_t)(ptr))) -+#endif -+ -+/** Type-safe version of discard_const */ -+#ifndef discard_const_p -+#define discard_const_p(type, ptr) ((type *)discard_const(ptr)) -+#endif -+ -+#endif /* _SAMBA_DISCARD_H_ */ -diff --git a/lib/util/memory.h b/lib/util/memory.h -index 3278f6b3c21..0e151cc5f66 100644 ---- a/lib/util/memory.h -+++ b/lib/util/memory.h -@@ -94,31 +94,4 @@ - #define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2))) - #endif - --/** -- this is a warning hack. The idea is to use this everywhere that we -- get the "discarding const" warning from gcc. That doesn't actually -- fix the problem of course, but it means that when we do get to -- cleaning them up we can do it by searching the code for -- discard_const. -- -- It also means that other error types aren't as swamped by the noise -- of hundreds of const warnings, so we are more likely to notice when -- we get new errors. -- -- Please only add more uses of this macro when you find it -- _really_ hard to fix const warnings. Our aim is to eventually use -- this function in only a very few places. -- -- Also, please call this via the discard_const_p() macro interface, as that -- makes the return type safe. --*/ --#ifndef discard_const --#define discard_const(ptr) ((void *)((uintptr_t)(ptr))) --#endif -- --/** Type-safe version of discard_const */ --#ifndef discard_const_p --#define discard_const_p(type, ptr) ((type *)discard_const(ptr)) --#endif -- - #endif /* _SAMBA_MEMORY_H_ */ -diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h -index 7b96a595d43..11c95b5bfe3 100644 ---- a/lib/util/samba_util.h -+++ b/lib/util/samba_util.h -@@ -54,6 +54,7 @@ extern const char *panic_action; - #endif - - #include "lib/util/memory.h" -+#include "lib/util/discard.h" - - #include "fault.h" - -diff --git a/lib/util/wscript_build b/lib/util/wscript_build -index 8fc402062fb..9c9652b26cd 100644 ---- a/lib/util/wscript_build -+++ b/lib/util/wscript_build -@@ -126,7 +126,7 @@ else: - tevent_debug.c memcache.c unix_match.c tfork.c''', - deps='samba-util-core DYNCONFIG close-low-fd tiniparser genrand util_str_hex', - public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid', -- public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h string_wrappers.h idtree.h idtree_random.h blocking.h signal.h substitute.h fault.h genrand.h tfork.h', -+ public_headers='debug.h attr.h byteorder.h data_blob.h discard.h memory.h safe_string.h time.h talloc_stack.h string_wrappers.h idtree.h idtree_random.h blocking.h signal.h substitute.h fault.h genrand.h tfork.h', - header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ], - local_include=False, - vnum='0.0.1', -diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h -index 9c403319b6e..8a15fccfe09 100644 ---- a/librpc/ndr/libndr.h -+++ b/librpc/ndr/libndr.h -@@ -26,7 +26,7 @@ - #define __LIBNDR_H__ - - #include --#include "../lib/util/memory.h" /* for discard_const */ -+#include "../lib/util/discard.h" /* for discard_const */ - #include "../lib/util/byteorder.h" - #include "../lib/util/data_blob.h" - #include "../lib/util/time.h" -diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c -index 494eb10a6a8..a9ddaab1a41 100644 ---- a/source3/libsmb/samlogon_cache.c -+++ b/source3/libsmb/samlogon_cache.c -@@ -27,6 +27,7 @@ - #include "system/time.h" - #include "lib/util/debug.h" - #include "lib/util/talloc_stack.h" -+#include "lib/util/memory.h" /* for SAFE_FREE() */ - #include "source3/lib/util_path.h" - #include "librpc/gen_ndr/ndr_krb5pac.h" - #include "../libcli/security/security.h" --- -2.20.1 - - -From 7f05bfa0d0f4e970e655d94ec73582ce28a4b436 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Wed, 13 Feb 2019 10:44:45 +0100 -Subject: [PATCH 5/5] waf: Do not install internal header - -We should not install header files without an public API: - -- memory.h -- safe_strings.h -- talloc_stack.h - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 - -Signed-off-by: Andreas Schneider -(cherry picked from commit a68287f7f978b94b4a63081a71c56f92be5b1efe) ---- - lib/util/wscript_build | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - -diff --git a/lib/util/wscript_build b/lib/util/wscript_build -index 9c9652b26cd..e3a004fa3c6 100644 ---- a/lib/util/wscript_build -+++ b/lib/util/wscript_build -@@ -126,7 +126,23 @@ else: - tevent_debug.c memcache.c unix_match.c tfork.c''', - deps='samba-util-core DYNCONFIG close-low-fd tiniparser genrand util_str_hex', - public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid', -- public_headers='debug.h attr.h byteorder.h data_blob.h discard.h memory.h safe_string.h time.h talloc_stack.h string_wrappers.h idtree.h idtree_random.h blocking.h signal.h substitute.h fault.h genrand.h tfork.h', -+ public_headers=''' -+ attr.h -+ byteorder.h -+ data_blob.h -+ debug.h -+ discard.h -+ time.h -+ string_wrappers.h -+ idtree.h -+ idtree_random.h -+ blocking.h -+ signal.h -+ substitute.h -+ fault.h -+ genrand.h -+ tfork.h -+ ''', - header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ], - local_include=False, - vnum='0.0.1', --- -2.20.1 - diff --git a/samba.spec b/samba.spec index 58b6ee1..0b9103a 100644 --- a/samba.spec +++ b/samba.spec @@ -12,9 +12,9 @@ %define talloc_version 2.1.15 %define tdb_version 1.3.17 %define tevent_version 0.9.38 -%define ldb_version 1.5.2 +%define ldb_version 1.5.3 # This should be rc1 or nil -%define pre_release rc2 +%define pre_release rc3 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -86,7 +86,7 @@ Name: samba Version: %{samba_version} -Release: %{samba_release}.1 +Release: %{samba_release} %if 0%{?rhel} Epoch: 0 @@ -118,8 +118,6 @@ Source14: samba.pamd Source201: README.downgrade -Patch0: samba-4.10-fix_ndr_public_api.patch - Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -3396,6 +3394,9 @@ fi %endif # with_clustering_support %changelog +* Fri Feb 22 2019 Guenther Deschner - 4.10.0rc3-2 +- Update to Samba 4.10.0rc3 + * Sun Feb 17 2019 Igor Gnatenko - 2:4.10.0-0.2.rc2.1 - Rebuild for readline 8.0 diff --git a/sources b/sources index 6705aca..6f75be4 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.0rc2.tar.xz) = d97cefd6284f05deb78484a348c36fa36d5cdd6da67935701626216b0f5fecd24328b63569ac0821bf69551edc1cbb4e6399c404935e8776966954e669fd4411 -SHA512 (samba-4.10.0rc2.tar.asc) = df94e93aa361eee40ef3243457acc6340ee87048724143960a49d64dd7f3ebe32d978a776a3c8e754ebafc7e5b382bb779b30ea35e67768e5ab0e6422d2204a8 +SHA512 (samba-4.10.0rc3.tar.xz) = 753b6b91776784918ed8bb73157296b71cae5ecb3ded1baa5b58db7352c21bcbb97c610fcfa936d94da6267b50d1812250f2c58bd6a57ab26be51a0e72b0b092 +SHA512 (samba-4.10.0rc3.tar.asc) = 5c9962f3b05812dd6b07a87f374d99448ef44cb7f2162d3e9422fbd622a20a8be911e01fc8d53659ccd3a9eeb55771b037db61d4e74af8039db3b4f3bfc67e07 From 7eff93fa0b9de60a6f428c375ed0b40d5632999e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 6 Mar 2019 11:19:14 +0100 Subject: [PATCH 36/76] Update to Samba 4.10.0rc4 Guenther --- .gitignore | 2 ++ samba.spec | 16 +++++++++++----- sources | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index f1d3393..497b9e4 100644 --- a/.gitignore +++ b/.gitignore @@ -153,3 +153,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.0rc2.tar.asc /samba-4.10.0rc3.tar.xz /samba-4.10.0rc3.tar.asc +/samba-4.10.0rc4.tar.xz +/samba-4.10.0rc4.tar.asc diff --git a/samba.spec b/samba.spec index 0b9103a..dea8138 100644 --- a/samba.spec +++ b/samba.spec @@ -9,12 +9,12 @@ %define main_release 2 %define samba_version 4.10.0 -%define talloc_version 2.1.15 -%define tdb_version 1.3.17 -%define tevent_version 0.9.38 -%define ldb_version 1.5.3 +%define talloc_version 2.1.16 +%define tdb_version 1.3.18 +%define tevent_version 0.9.39 +%define ldb_version 1.5.4 # This should be rc1 or nil -%define pre_release rc3 +%define pre_release rc4 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -2630,6 +2630,7 @@ fi %{_libexecdir}/ctdb/tests/comm_server_test %{_libexecdir}/ctdb/tests/comm_test %{_libexecdir}/ctdb/tests/conf_test +%{_libexecdir}/ctdb/tests/ctdb_io_test %{_libexecdir}/ctdb/tests/ctdb_packet_parse %{_libexecdir}/ctdb/tests/ctdb_takeover_tests %{_libexecdir}/ctdb/tests/db_hash_test @@ -2710,6 +2711,7 @@ fi %{_datadir}/ctdb/tests/cunit/config_test_005.sh %{_datadir}/ctdb/tests/cunit/config_test_006.sh %{_datadir}/ctdb/tests/cunit/config_test_007.sh +%{_datadir}/ctdb/tests/cunit/ctdb_io_test_001.sh %{_datadir}/ctdb/tests/cunit/db_hash_test_001.sh %{_datadir}/ctdb/tests/cunit/event_protocol_test_001.sh %{_datadir}/ctdb/tests/cunit/event_script_test_001.sh @@ -3118,6 +3120,7 @@ fi %dir %{_datadir}/ctdb/tests/simple %{_datadir}/ctdb/tests/simple/README %{_datadir}/ctdb/tests/simple/00_ctdb_onnode.sh +%{_datadir}/ctdb/tests/simple/01_ctdb_reclock_command.sh %{_datadir}/ctdb/tests/simple/02_ctdb_tunables.sh %{_datadir}/ctdb/tests/simple/05_ctdb_listnodes.sh %{_datadir}/ctdb/tests/simple/06_ctdb_getpid.sh @@ -3394,6 +3397,9 @@ fi %endif # with_clustering_support %changelog +* Wed Mar 06 2019 Guenther Deschner - 4.10.0rc4-2 +- Update to Samba 4.10.0rc4 + * Fri Feb 22 2019 Guenther Deschner - 4.10.0rc3-2 - Update to Samba 4.10.0rc3 diff --git a/sources b/sources index 6f75be4..22c9a1a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.0rc3.tar.xz) = 753b6b91776784918ed8bb73157296b71cae5ecb3ded1baa5b58db7352c21bcbb97c610fcfa936d94da6267b50d1812250f2c58bd6a57ab26be51a0e72b0b092 -SHA512 (samba-4.10.0rc3.tar.asc) = 5c9962f3b05812dd6b07a87f374d99448ef44cb7f2162d3e9422fbd622a20a8be911e01fc8d53659ccd3a9eeb55771b037db61d4e74af8039db3b4f3bfc67e07 +SHA512 (samba-4.10.0rc4.tar.xz) = 4712b8bb8c1cccdd66b090bc09db5a42e3adb6db6e556297376107de4a7331f5a26cf58b4e402c97fa7b22c233ffd18c535a2a9773648fbbe2698ee14caffa25 +SHA512 (samba-4.10.0rc4.tar.asc) = cdd45ed8741dd132ffba8371457b2b0319702234020a62fd8906b7b9ad3a970e2a2569fde4b3ace376e8fa36076474050a183c49c3a155334f71fa524ccffa63 From 9dc720da4d84a82d9c3f812f91a5a03f2a08ce6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 19 Mar 2019 12:17:32 +0100 Subject: [PATCH 37/76] Update to Samba 4.10.0 Guenther --- .gitignore | 2 ++ samba.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 497b9e4..df2a3cf 100644 --- a/.gitignore +++ b/.gitignore @@ -155,3 +155,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.0rc3.tar.asc /samba-4.10.0rc4.tar.xz /samba-4.10.0rc4.tar.asc +/samba-4.10.0.tar.xz +/samba-4.10.0.tar.asc diff --git a/samba.spec b/samba.spec index dea8138..8296a0a 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 2 +%define main_release 3 %define samba_version 4.10.0 %define talloc_version 2.1.16 @@ -14,7 +14,7 @@ %define tevent_version 0.9.39 %define ldb_version 1.5.4 # This should be rc1 or nil -%define pre_release rc4 +%define pre_release %nil %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -3397,6 +3397,9 @@ fi %endif # with_clustering_support %changelog +* Tue Mar 19 2019 Guenther Deschner - 4.10.0-3 +- Update to Samba 4.10.0 + * Wed Mar 06 2019 Guenther Deschner - 4.10.0rc4-2 - Update to Samba 4.10.0rc4 diff --git a/sources b/sources index 22c9a1a..1c8fef9 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.0rc4.tar.xz) = 4712b8bb8c1cccdd66b090bc09db5a42e3adb6db6e556297376107de4a7331f5a26cf58b4e402c97fa7b22c233ffd18c535a2a9773648fbbe2698ee14caffa25 -SHA512 (samba-4.10.0rc4.tar.asc) = cdd45ed8741dd132ffba8371457b2b0319702234020a62fd8906b7b9ad3a970e2a2569fde4b3ace376e8fa36076474050a183c49c3a155334f71fa524ccffa63 +SHA512 (samba-4.10.0.tar.xz) = 000b273fd071ce1d7853a9b09e690d28783d66e5519efbc2235705cee962d35e67d677dea2e8b0dda5d5c20253e309228498bbc72d1e37dc3e4ca074214c7815 +SHA512 (samba-4.10.0.tar.asc) = 6d1194afa71539f1e2dd7bb11c3c7f87933a57c17a2df26ae9604dfcd1b1a5f51912efc5d3a48c94ca6fe996baff8b65f15ce78ae42ef2c7b36cc7e34ce5cae2 From f7481df50df458fa08529ed3b1fb4b4a1c1961c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 19 Mar 2019 17:45:56 +0100 Subject: [PATCH 38/76] Fix non-DC build. Guenther --- samba.spec | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/samba.spec b/samba.spec index 8296a0a..f58f071 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 3 +%define main_release 4 %define samba_version 4.10.0 %define talloc_version 2.1.16 @@ -972,9 +972,17 @@ for i in \ %{python3_sitearch}/samba/__pycache__/ms_schema_markdown.*.pyc \ %{python3_sitearch}/samba/__pycache__/remove_dc.*.pyc \ %{python3_sitearch}/samba/__pycache__/schema.*.pyc \ + %{python3_sitearch}/samba/__pycache__/uptodateness.*.pyc \ %{python3_sitearch}/samba/remove_dc.py \ %{python3_sitearch}/samba/samdb.py \ %{python3_sitearch}/samba/schema.py \ + %{python3_sitearch}/samba/third_party/iso8601/__init__.py \ + %{python3_sitearch}/samba/third_party/iso8601/__pycache__/__init__.*.pyc \ + %{python3_sitearch}/samba/third_party/iso8601/__pycache__/iso8601.*.pyc \ + %{python3_sitearch}/samba/third_party/iso8601/__pycache__/test_iso8601.*.pyc \ + %{python3_sitearch}/samba/third_party/iso8601/iso8601.py \ + %{python3_sitearch}/samba/third_party/iso8601/test_iso8601.py \ + %{python3_sitearch}/samba/uptodateness.py \ %{_sbindir}/samba-gpupdate \ ; do rm -f %{buildroot}$i @@ -1860,7 +1868,6 @@ fi %{python3_sitearch}/samba/__pycache__/tdb_util.*.pyc %{python3_sitearch}/samba/__pycache__/upgrade.*.pyc %{python3_sitearch}/samba/__pycache__/upgradehelpers.*.pyc -%{python3_sitearch}/samba/__pycache__/uptodateness.*.pyc %{python3_sitearch}/samba/__pycache__/xattr.*.pyc %{python3_sitearch}/samba/_glue.*.so %{python3_sitearch}/samba/_ldb.*.so @@ -2080,6 +2087,7 @@ fi %{python3_sitearch}/samba/__pycache__/remove_dc.*.pyc %{python3_sitearch}/samba/__pycache__/samdb.*.pyc %{python3_sitearch}/samba/__pycache__/schema.*.pyc +%{python3_sitearch}/samba/__pycache__/uptodateness.*.pyc %{python3_sitearch}/samba/dcerpc/dnsserver.*.so %{python3_sitearch}/samba/dckeytab.*.so @@ -3397,7 +3405,7 @@ fi %endif # with_clustering_support %changelog -* Tue Mar 19 2019 Guenther Deschner - 4.10.0-3 +* Tue Mar 19 2019 Guenther Deschner - 4.10.0-4 - Update to Samba 4.10.0 * Wed Mar 06 2019 Guenther Deschner - 4.10.0rc4-2 From e1cadd0ea68b852334cf38bda8d9e45149b23930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 20 Mar 2019 18:51:16 +0100 Subject: [PATCH 39/76] Fix build failure (duplication during install) Guenther --- samba.spec | 7 ++++++- v4.10_build_fix.patch | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 v4.10_build_fix.patch diff --git a/samba.spec b/samba.spec index f58f071..4d8ffe8 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 4 +%define main_release 5 %define samba_version 4.10.0 %define talloc_version 2.1.16 @@ -118,6 +118,8 @@ Source14: samba.pamd Source201: README.downgrade +Patch0: v4.10_build_fix.patch + Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -3405,6 +3407,9 @@ fi %endif # with_clustering_support %changelog +* Wed Mar 20 2019 Guenther Deschner - 4.10.0-5 +- Fix build failure (duplication during install) + * Tue Mar 19 2019 Guenther Deschner - 4.10.0-4 - Update to Samba 4.10.0 diff --git a/v4.10_build_fix.patch b/v4.10_build_fix.patch new file mode 100644 index 0000000..cafd0c1 --- /dev/null +++ b/v4.10_build_fix.patch @@ -0,0 +1,39 @@ +From 739ac46f26e72a601405a0a59747b27584238b3e Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Wed, 20 Mar 2019 11:09:21 +0100 +Subject: [PATCH] s4:librpc: Fix installation of Samba + +This breaks installation of Samba 4.10 on Fedora. + +https://bugzilla.samba.org/show_bug.cgi?id=13847 + +Signed-off-by: Andreas Schneider +Reviewed-by: Alexander Bokovoy + +(cherry picked from commit bf469343f577e2d78df0e38d80e7976b351eaf0d) +--- + source4/librpc/wscript_build | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build +index f00571e4bc3..d9b7743c9d1 100644 +--- a/source4/librpc/wscript_build ++++ b/source4/librpc/wscript_build +@@ -412,14 +412,6 @@ for env in bld.gen_python_environments(): + cflags_end=gen_cflags + ) + +- bld.SAMBA_PYTHON('python_idmap', +- source='../../librpc/gen_ndr/py_idmap.c', +- deps='NDR_IDMAP %s %s' % (pytalloc_util, pyrpc_util), +- realname='samba/dcerpc/idmap.so', +- cflags_end=gen_cflags +- ) +- +- + bld.SAMBA_PYTHON('python_drsuapi', + source='../../librpc/gen_ndr/py_drsuapi.c', + deps='RPC_NDR_DRSUAPI %s %s' % (pytalloc_util, pyrpc_util), +-- +2.21.0 + From 68f311fcaa935b079d53aa92bb0210679f7488cf Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 25 Mar 2019 16:16:56 +0100 Subject: [PATCH 40/76] Add BuildRequires for the python3 subunit tests to run selftest --- samba.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/samba.spec b/samba.spec index 4d8ffe8..3417b98 100644 --- a/samba.spec +++ b/samba.spec @@ -192,6 +192,7 @@ BuildRequires: python3-devel # Add python3-iso8601 to avoid that the # version in Samba is being packaged BuildRequires: python3-iso8601 +BuildRequires: python3-subunit-tests %endif # with_dc BuildRequires: quota-devel BuildRequires: readline-devel From fa7412b328c63c2d6f3d4ba59a1ba95d6eafaaf2 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 25 Mar 2019 16:20:13 +0100 Subject: [PATCH 41/76] Rename patch to fix make install --- v4.10_build_fix.patch => samba-4.10-fix_make_install.patch | 0 samba.spec | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename v4.10_build_fix.patch => samba-4.10-fix_make_install.patch (100%) diff --git a/v4.10_build_fix.patch b/samba-4.10-fix_make_install.patch similarity index 100% rename from v4.10_build_fix.patch rename to samba-4.10-fix_make_install.patch diff --git a/samba.spec b/samba.spec index 3417b98..511a689 100644 --- a/samba.spec +++ b/samba.spec @@ -118,7 +118,7 @@ Source14: samba.pamd Source201: README.downgrade -Patch0: v4.10_build_fix.patch +Patch0: samba-4.10-fix_make_install.patch Requires(pre): /usr/sbin/groupadd Requires(post): systemd From 5a16bed392a1e9dbc26a110bd2ea56dccea9afd8 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 25 Mar 2019 16:15:15 +0100 Subject: [PATCH 42/76] Add missing DC requirement for its python3 tools resolves: #1692347 --- samba.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/samba.spec b/samba.spec index 511a689..d25b19f 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 5 +%define main_release 6 %define samba_version 4.10.0 %define talloc_version 2.1.16 @@ -356,11 +356,9 @@ Requires: ldb-tools # See bug 1507420 %requires_eq libldb -%if 0 Requires: python3-crypto Requires: python3-%{name} = %{samba_depver} Requires: python3-%{name}-dc = %{samba_depver} -%endif Requires: krb5-server >= %{required_mit_krb5} Provides: samba4-dc = %{samba_depver} @@ -3408,6 +3406,9 @@ fi %endif # with_clustering_support %changelog +* Mon Mar 25 2019 Andreas Schneider - 4.10.0-6 +- resolves: #1692347 - Add missing DC requirement for its python3 tools + * Wed Mar 20 2019 Guenther Deschner - 4.10.0-5 - Fix build failure (duplication during install) From 7d9e9baef5ac13326429f9b3d4dedbb27530bf42 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 25 Mar 2019 16:58:02 +0100 Subject: [PATCH 43/76] Fix typo in BR for python3-subunit-test --- samba.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index d25b19f..d829a3a 100644 --- a/samba.spec +++ b/samba.spec @@ -192,7 +192,7 @@ BuildRequires: python3-devel # Add python3-iso8601 to avoid that the # version in Samba is being packaged BuildRequires: python3-iso8601 -BuildRequires: python3-subunit-tests +BuildRequires: python3-subunit-test %endif # with_dc BuildRequires: quota-devel BuildRequires: readline-devel From 837c9f1b1c14339ab538b00cb4e5af3b43eb8d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 3 Apr 2019 11:08:29 +0200 Subject: [PATCH 44/76] Update to Samba 4.10.1 Guenther --- .gitignore | 2 ++ samba-4.10-fix_make_install.patch | 39 ------------------------------- samba.spec | 9 +++---- sources | 4 ++-- 4 files changed, 9 insertions(+), 45 deletions(-) delete mode 100644 samba-4.10-fix_make_install.patch diff --git a/.gitignore b/.gitignore index df2a3cf..3c3ce17 100644 --- a/.gitignore +++ b/.gitignore @@ -157,3 +157,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.0rc4.tar.asc /samba-4.10.0.tar.xz /samba-4.10.0.tar.asc +/samba-4.10.1.tar.xz +/samba-4.10.1.tar.asc diff --git a/samba-4.10-fix_make_install.patch b/samba-4.10-fix_make_install.patch deleted file mode 100644 index cafd0c1..0000000 --- a/samba-4.10-fix_make_install.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 739ac46f26e72a601405a0a59747b27584238b3e Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Wed, 20 Mar 2019 11:09:21 +0100 -Subject: [PATCH] s4:librpc: Fix installation of Samba - -This breaks installation of Samba 4.10 on Fedora. - -https://bugzilla.samba.org/show_bug.cgi?id=13847 - -Signed-off-by: Andreas Schneider -Reviewed-by: Alexander Bokovoy - -(cherry picked from commit bf469343f577e2d78df0e38d80e7976b351eaf0d) ---- - source4/librpc/wscript_build | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build -index f00571e4bc3..d9b7743c9d1 100644 ---- a/source4/librpc/wscript_build -+++ b/source4/librpc/wscript_build -@@ -412,14 +412,6 @@ for env in bld.gen_python_environments(): - cflags_end=gen_cflags - ) - -- bld.SAMBA_PYTHON('python_idmap', -- source='../../librpc/gen_ndr/py_idmap.c', -- deps='NDR_IDMAP %s %s' % (pytalloc_util, pyrpc_util), -- realname='samba/dcerpc/idmap.so', -- cflags_end=gen_cflags -- ) -- -- - bld.SAMBA_PYTHON('python_drsuapi', - source='../../librpc/gen_ndr/py_drsuapi.c', - deps='RPC_NDR_DRSUAPI %s %s' % (pytalloc_util, pyrpc_util), --- -2.21.0 - diff --git a/samba.spec b/samba.spec index d829a3a..f2598f2 100644 --- a/samba.spec +++ b/samba.spec @@ -6,9 +6,9 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 6 +%define main_release 0 -%define samba_version 4.10.0 +%define samba_version 4.10.1 %define talloc_version 2.1.16 %define tdb_version 1.3.18 %define tevent_version 0.9.39 @@ -118,8 +118,6 @@ Source14: samba.pamd Source201: README.downgrade -Patch0: samba-4.10-fix_make_install.patch - Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -3406,6 +3404,9 @@ fi %endif # with_clustering_support %changelog +* Wed Apr 03 2019 Guenther Deschner - 4.10.1-0 +- Update to Samba 4.10.1 + * Mon Mar 25 2019 Andreas Schneider - 4.10.0-6 - resolves: #1692347 - Add missing DC requirement for its python3 tools diff --git a/sources b/sources index 1c8fef9..2afb242 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.0.tar.xz) = 000b273fd071ce1d7853a9b09e690d28783d66e5519efbc2235705cee962d35e67d677dea2e8b0dda5d5c20253e309228498bbc72d1e37dc3e4ca074214c7815 -SHA512 (samba-4.10.0.tar.asc) = 6d1194afa71539f1e2dd7bb11c3c7f87933a57c17a2df26ae9604dfcd1b1a5f51912efc5d3a48c94ca6fe996baff8b65f15ce78ae42ef2c7b36cc7e34ce5cae2 +SHA512 (samba-4.10.1.tar.xz) = cee84e7c749b7beeb3b8e3804112873098b740d83d1bd11c040c1d817c94ce26745b5e78b209d7db5b8e346ed9ca6103c50c9dd86347bc92ee31d6224c2073ec +SHA512 (samba-4.10.1.tar.asc) = 0570cf5852d016f220dad523fab59f80a2a420872d7c97f40f75d7630877ed4daf2bf1e6540667d1f0592f0100b07622c74a1a74163b2d79ee1e4735d2c086d4 From 6c625d219359813304119aeaec967ac8bbe7e45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Mon, 8 Apr 2019 12:33:01 +0200 Subject: [PATCH 45/76] Update to Samba 4.10.2 resolves: #1689010, #1697718 - Security fixes for CVE-2019-3870 resolves: #1691518, #1697717 - Security fixes for CVE-2019-3880 Guenther --- .gitignore | 2 ++ samba.spec | 7 ++++++- sources | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3c3ce17..c48500b 100644 --- a/.gitignore +++ b/.gitignore @@ -159,3 +159,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.0.tar.asc /samba-4.10.1.tar.xz /samba-4.10.1.tar.asc +/samba-4.10.2.tar.xz +/samba-4.10.2.tar.asc diff --git a/samba.spec b/samba.spec index f2598f2..d42d19d 100644 --- a/samba.spec +++ b/samba.spec @@ -8,7 +8,7 @@ %define main_release 0 -%define samba_version 4.10.1 +%define samba_version 4.10.2 %define talloc_version 2.1.16 %define tdb_version 1.3.18 %define tevent_version 0.9.39 @@ -3404,6 +3404,11 @@ fi %endif # with_clustering_support %changelog +* Mon Apr 08 2019 Guenther Deschner - 4.10.2-0 +- Update to Samba 4.10.2 +- resolves: #1689010, #1697718 - Security fixes for CVE-2019-3870 +- resolves: #1691518, #1697717 - Security fixes for CVE-2019-3880 + * Wed Apr 03 2019 Guenther Deschner - 4.10.1-0 - Update to Samba 4.10.1 diff --git a/sources b/sources index 2afb242..986bf09 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.1.tar.xz) = cee84e7c749b7beeb3b8e3804112873098b740d83d1bd11c040c1d817c94ce26745b5e78b209d7db5b8e346ed9ca6103c50c9dd86347bc92ee31d6224c2073ec -SHA512 (samba-4.10.1.tar.asc) = 0570cf5852d016f220dad523fab59f80a2a420872d7c97f40f75d7630877ed4daf2bf1e6540667d1f0592f0100b07622c74a1a74163b2d79ee1e4735d2c086d4 +SHA512 (samba-4.10.2.tar.xz) = 6178f99ab7ce89679a2041c8af3a9b2c4b0b564986088ddab5a4cc7fa7d5b0f3c7997e55c1536451266a19c6af7d06c304f1c80f98ffead375250c0ed572e524 +SHA512 (samba-4.10.2.tar.asc) = f5f2a22da5dca2353bdf35e866ea5727b0bb0c031b838f133806a83e3c32536c85b7b4d1edd5455c4a58768dd7e6b32e1e3689700bc72317bcb531f0787036d6 From fe35505836bd648fc470bf692226fd79b4fa3812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 9 Apr 2019 11:22:35 +0200 Subject: [PATCH 46/76] Add missing test files Guenther --- samba.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samba.spec b/samba.spec index d42d19d..7296b03 100644 --- a/samba.spec +++ b/samba.spec @@ -2222,6 +2222,7 @@ fi %{python3_sitearch}/samba/tests/__pycache__/samdb_api.*.pyc %{python3_sitearch}/samba/tests/__pycache__/security.*.pyc %{python3_sitearch}/samba/tests/__pycache__/smb.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/smbd_base.*.pyc %{python3_sitearch}/samba/tests/__pycache__/source.*.pyc %{python3_sitearch}/samba/tests/__pycache__/strings.*.pyc %{python3_sitearch}/samba/tests/__pycache__/subunitrun.*.pyc @@ -2450,6 +2451,7 @@ fi %{python3_sitearch}/samba/tests/samdb_api.py %{python3_sitearch}/samba/tests/security.py %{python3_sitearch}/samba/tests/smb.py +%{python3_sitearch}/samba/tests/smbd_base.py %{python3_sitearch}/samba/tests/source.py %{python3_sitearch}/samba/tests/strings.py %{python3_sitearch}/samba/tests/subunitrun.py From a5b527fe9365ceaa5c178abbb8f987e5b6a79a93 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 15 Apr 2019 13:18:10 +0200 Subject: [PATCH 47/76] Rebuild for MIT Kerberos soname bump of libkadm5srv resolves: #1699230 --- samba.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index 7296b03..631d588 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 0 +%define main_release 1 %define samba_version 4.10.2 %define talloc_version 2.1.16 @@ -3406,6 +3406,9 @@ fi %endif # with_clustering_support %changelog +* Mon Apr 15 2019 Andreas Schneider - 4.10.2-1 +- resolves: #1699230 - Rebuild for MIT Kerberos soname bump of libkadm5srv + * Mon Apr 08 2019 Guenther Deschner - 4.10.2-0 - Update to Samba 4.10.2 - resolves: #1689010, #1697718 - Security fixes for CVE-2019-3870 From 507f87a34ce65d6ed894b1c1b17196a564b73dbb Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 9 May 2019 17:48:03 +0200 Subject: [PATCH 48/76] Remove python2 code for building on RHEL Samba has python3 support now. --- samba.spec | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/samba.spec b/samba.spec index 631d588..4ab263a 100644 --- a/samba.spec +++ b/samba.spec @@ -775,12 +775,6 @@ export python_LDFLAGS="$(echo %{__global_ldflags} | sed -e 's/-Wl,-z,defs//g')" # Use the gold linker export LDFLAGS="%{__global_ldflags} -fuse-ld=gold" -%if 0%{?rhel} -# Use Python 2 for the waf buildscript -pathfix.py -n -p -i %{__python2} buildtools/bin/waf -export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 -%endif # rhel - %configure \ --enable-fhs \ --with-piddir=/run \ @@ -833,10 +827,6 @@ make %{?_smp_mflags} %install rm -rf %{buildroot} -%if 0%{?rhel} -export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 -%endif # rhel - make %{?_smp_mflags} install DESTDIR=%{buildroot} install -d -m 0755 %{buildroot}/usr/{sbin,bin} @@ -1003,10 +993,6 @@ done %if %{with testsuite} %check -%if 0%{?rhel} -export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 -%endif # rhel - TDB_NO_FSYNC=1 make %{?_smp_mflags} test %endif # with testsuite From 009991df0a7854f3484e4a873919a429ae82add4 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 9 May 2019 18:05:04 +0200 Subject: [PATCH 49/76] Add missing BR for libtasn1-devel and gnutls-devel in non-AD case --- samba.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samba.spec b/samba.spec index 4ab263a..aa8148e 100644 --- a/samba.spec +++ b/samba.spec @@ -200,6 +200,7 @@ BuildRequires: sed BuildRequires: xfsprogs-devel BuildRequires: xz BuildRequires: zlib-devel >= 1.2.3 +BuildRequires: libtasn1-devel BuildRequires: pkgconfig(libsystemd) @@ -219,6 +220,8 @@ BuildRequires: krb5-server >= %{required_mit_krb5} # Required by samba-tool to run tests BuildRequires: python3-crypto +%else +BuildRequires: gnutls-devel >= 3.2.0 %endif # pidl requirements From 12a645ef2ca2589e28b68deb2274dcc4b6ecdee1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 9 May 2019 18:17:09 +0200 Subject: [PATCH 50/76] Add missing BR for libtasn1-tools to get asn1Parser --- samba.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index aa8148e..beed1c7 100644 --- a/samba.spec +++ b/samba.spec @@ -197,10 +197,12 @@ BuildRequires: readline-devel BuildRequires: rpcgen BuildRequires: rpcsvc-proto-devel BuildRequires: sed +BuildRequires: libtasn1-devel +# We need asn1Parser +BuildRequires: libtasn1-tools BuildRequires: xfsprogs-devel BuildRequires: xz BuildRequires: zlib-devel >= 1.2.3 -BuildRequires: libtasn1-devel BuildRequires: pkgconfig(libsystemd) From 6d8230cbfdb241d2ed9dbf94e060d8bddf07afba Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 10 May 2019 09:37:55 +0200 Subject: [PATCH 51/76] Always package glusterfs_fuse --- samba.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samba.spec b/samba.spec index beed1c7..6f0c92a 100644 --- a/samba.spec +++ b/samba.spec @@ -1195,6 +1195,7 @@ fi %{_libdir}/samba/vfs/fileid.so %{_libdir}/samba/vfs/fruit.so %{_libdir}/samba/vfs/full_audit.so +%{_libdir}/samba/vfs/glusterfs_fuse.so %{_libdir}/samba/vfs/linux_xfs_sgid.so %{_libdir}/samba/vfs/media_harmony.so %{_libdir}/samba/vfs/netatalk.so @@ -1243,6 +1244,7 @@ fi %{_mandir}/man8/vfs_fileid.8* %{_mandir}/man8/vfs_fruit.8* %{_mandir}/man8/vfs_full_audit.8* +%{_mandir}/man8/vfs_glusterfs_fuse.8* %{_mandir}/man8/vfs_linux_xfs_sgid.8* %{_mandir}/man8/vfs_media_harmony.8* %{_mandir}/man8/vfs_netatalk.8* @@ -1266,7 +1268,6 @@ fi %if ! %{with_vfs_glusterfs} %exclude %{_mandir}/man8/vfs_glusterfs.8* -%exclude %{_mandir}/man8/vfs_glusterfs_fuse.8* %endif %if ! %{with_vfs_cephfs} @@ -1737,9 +1738,7 @@ fi %if %{with_vfs_glusterfs} %files vfs-glusterfs %{_libdir}/samba/vfs/glusterfs.so -%{_libdir}/samba/vfs/glusterfs_fuse.so %{_mandir}/man8/vfs_glusterfs.8* -%{_mandir}/man8/vfs_glusterfs_fuse.8* %endif ### KRB5-PRINTING From 0886ab0c3b690995ec337b108b121dac99f5211f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 10 May 2019 11:30:21 +0200 Subject: [PATCH 52/76] If we build Samba without AD DC obsolete DC packages --- samba.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/samba.spec b/samba.spec index 6f0c92a..08fa166 100644 --- a/samba.spec +++ b/samba.spec @@ -309,6 +309,12 @@ Requires(post): systemd Provides: samba4-common = %{samba_depver} Obsoletes: samba4-common < %{samba_depver} +%if ! %{with_dc} +Obsoletes: samba-dc < %{samba_depver} +Obsoletes: samba-dc-libs < %{samba_depver} +Obsoletes: samba-dc-bind-dlz < %{samba_depver} +%endif + %description common samba-common provides files necessary for both the server and client packages of Samba. From 436e6ea1ab7cf2d7b0807cd19a6eadaf740223af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 14 May 2019 10:26:22 +0200 Subject: [PATCH 53/76] Update to Samba 4.10.3 resolves: #1705877, #1709679 - Security fixes for CVE-2018-16860 Guenther --- .gitignore | 2 ++ samba.spec | 8 ++++++-- sources | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c48500b..6439b05 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.1.tar.asc /samba-4.10.2.tar.xz /samba-4.10.2.tar.asc +/samba-4.10.3.tar.xz +/samba-4.10.3.tar.asc diff --git a/samba.spec b/samba.spec index 08fa166..2d9de47 100644 --- a/samba.spec +++ b/samba.spec @@ -6,9 +6,9 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 1 +%define main_release 0 -%define samba_version 4.10.2 +%define samba_version 4.10.3 %define talloc_version 2.1.16 %define tdb_version 1.3.18 %define tevent_version 0.9.39 @@ -3402,6 +3402,10 @@ fi %endif # with_clustering_support %changelog +* Tue May 14 2019 Guenther Deschner - 4.10.3-0 +- Update to Samba 4.10.3 +- resolves: #1705877, #1709679 - Security fixes for CVE-2018-16860 + * Mon Apr 15 2019 Andreas Schneider - 4.10.2-1 - resolves: #1699230 - Rebuild for MIT Kerberos soname bump of libkadm5srv diff --git a/sources b/sources index 986bf09..e23c77b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.2.tar.xz) = 6178f99ab7ce89679a2041c8af3a9b2c4b0b564986088ddab5a4cc7fa7d5b0f3c7997e55c1536451266a19c6af7d06c304f1c80f98ffead375250c0ed572e524 -SHA512 (samba-4.10.2.tar.asc) = f5f2a22da5dca2353bdf35e866ea5727b0bb0c031b838f133806a83e3c32536c85b7b4d1edd5455c4a58768dd7e6b32e1e3689700bc72317bcb531f0787036d6 +SHA512 (samba-4.10.3.tar.xz) = 34fd0536aa4a859bae8b313d7ec21b1636b1a3a8511663895e2ca02e5c7365024895c4a4e4c211d7973453a9ae0fd89db8eec8f8d7837033c9e61c513f423903 +SHA512 (samba-4.10.3.tar.asc) = 4626664d1c89e56577216d46f32163f4df932ab31155fcbe2bdf34b507abf911dd392745170a0af473ef33ed0511603c456757e0c3ea0d4140dc8da28ea18077 From 00f50422f73fd85757ac13d3a707461dbd5176e7 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 15 May 2019 17:41:04 +0200 Subject: [PATCH 54/76] Move libcluster-samba4.so to samba-client-libs This is used by client libs and we don't want to require samba-libs. --- samba.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index 2d9de47..32faac3 100644 --- a/samba.spec +++ b/samba.spec @@ -1368,6 +1368,7 @@ fi %{_libdir}/samba/libcli-spoolss-samba4.so %{_libdir}/samba/libcliauth-samba4.so %{_libdir}/samba/libclidns-samba4.so +%{_libdir}/samba/libcluster-samba4.so %{_libdir}/samba/libcmdline-contexts-samba4.so %{_libdir}/samba/libcmdline-credentials-samba4.so %{_libdir}/samba/libcommon-auth-samba4.so @@ -1760,7 +1761,6 @@ fi %{_libdir}/samba/libLIBWBCLIENT-OLD-samba4.so %{_libdir}/samba/libauth4-samba4.so %{_libdir}/samba/libauth-unix-token-samba4.so -%{_libdir}/samba/libcluster-samba4.so %{_libdir}/samba/libdcerpc-samba4.so %{_libdir}/samba/libnon-posix-acls-samba4.so %{_libdir}/samba/libshares-samba4.so From d67bdef6caaaa069baaad4b7aeba650528402025 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 15 May 2019 17:46:07 +0200 Subject: [PATCH 55/76] Add missing Requires --- samba.spec | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/samba.spec b/samba.spec index 32faac3..cfe8c0c 100644 --- a/samba.spec +++ b/samba.spec @@ -272,6 +272,9 @@ Requires: %{name}-client-libs = %{samba_depver} %if %with_libsmbclient Requires: libsmbclient = %{samba_depver} %endif +%if %with_libwbclient +Requires: libwbclient = %{samba_depver} +%endif Provides: samba4-client = %{samba_depver} Obsoletes: samba4-client < %{samba_depver} @@ -434,8 +437,12 @@ Summary: Samba VFS module for GlusterFS Requires: glusterfs-api >= 3.4.0.16 Requires: glusterfs >= 3.4.0.16 Requires: %{name} = %{samba_depver} +Requires: %{name}-common-libs = %{samba_depver} Requires: %{name}-client-libs = %{samba_depver} Requires: %{name}-libs = %{samba_depver} +%if %with_libwbclient +Requires: libwbclient = %{samba_depver} +%endif Obsoletes: samba-glusterfs < %{samba_depver} Provides: samba-glusterfs = %{samba_depver} @@ -448,7 +455,8 @@ Samba VFS module for GlusterFS integration. %package krb5-printing Summary: Samba CUPS backend for printing with Kerberos Requires(pre): %{name}-client -Requires: %{name}-client +Requires: %{name}-client = %{samba_depver} +Requires: %{name}-client-libs = %{samba_depver} Requires(post): %{_sbindir}/update-alternatives Requires(postun): %{_sbindir}/update-alternatives @@ -461,6 +469,7 @@ the Kerberos credentials cache of the user issuing the print job. ### LIBS %package libs Summary: Samba libraries +Requires: %{name}-common-libs = %{samba_depver} Requires: %{name}-client-libs = %{samba_depver} %if %with_libwbclient Requires: libwbclient = %{samba_depver} @@ -479,7 +488,11 @@ against the SMB, RPC and other protocols provided by the Samba suite. Summary: The SMB client library Requires(pre): %{name}-common = %{samba_depver} Requires: %{name}-common = %{samba_depver} +Requires: %{name}-common-libs = %{samba_depver} Requires: %{name}-client-libs = %{samba_depver} +%if %with_libwbclient +Requires: libwbclient = %{samba_depver} +%endif %description -n libsmbclient The libsmbclient contains the SMB client library from the Samba suite. @@ -528,6 +541,12 @@ Requires: python3-tevent Requires: python3-tdb Requires: python3-ldb Requires: python3-dns +%if %with_libsmbclient +Requires: libsmbclient = %{samba_depver} +%endif +%if %with_libwbclient +Requires: libwbclient = %{samba_depver} +%endif %description -n python3-%{name} The python3-%{name} package contains the Python 3 libraries needed by programs @@ -575,6 +594,7 @@ Requires: %{name} = %{samba_depver} Requires: %{name}-common = %{samba_depver} Requires: %{name}-winbind = %{samba_depver} +Requires: %{name}-common-libs = %{samba_depver} Requires: %{name}-client-libs = %{samba_depver} Requires: %{name}-libs = %{samba_depver} Requires: %{name}-test-libs = %{samba_depver} @@ -588,6 +608,7 @@ Requires: libsmbclient = %{samba_depver} %if %with_libwbclient Requires: libwbclient = %{samba_depver} %endif +Requires: python3-%{name} = %{version}-%{release} Requires: perl(Archive::Tar) Provides: samba4-test = %{samba_depver} @@ -600,8 +621,12 @@ packages of Samba. ### TEST-LIBS %package test-libs Summary: Libraries need by the testing tools for Samba servers and clients +Requires: %{name}-common-libs = %{samba_depver} Requires: %{name}-client-libs = %{samba_depver} Requires: %{name}-libs = %{samba_depver} +%if %with_libwbclient +Requires: libwbclient = %{samba_depver} +%endif Provides: %{name}-test-devel = %{samba_depver} Obsoletes: %{name}-test-devel < %{samba_depver} @@ -619,6 +644,7 @@ Requires: %{name}-common-tools = %{samba_depver} Requires: %{name}-client-libs = %{samba_depver} Requires: %{name}-libs = %{samba_depver} Requires: %{name}-winbind-modules = %{samba_depver} +Requires: libwbclient = %{samba_depver} Provides: samba4-winbind = %{samba_depver} Obsoletes: samba4-winbind < %{samba_depver} @@ -656,6 +682,7 @@ Requires: %{name}-winbind = %{samba_depver} %else Requires: %{name}-libs = %{samba_depver} %endif +Requires: samba-client-libs = %{samba_depver} Provides: samba4-winbind-krb5-locator = %{samba_depver} Obsoletes: samba4-winbind-krb5-locator < %{samba_depver} @@ -692,6 +719,7 @@ necessary to communicate to the Winbind Daemon %package -n ctdb Summary: A Clustered Database based on Samba's Trivial Database (TDB) +Requires: %{name}-common-libs = %{samba_depver} Requires: %{name}-client-libs = %{samba_depver} Requires: coreutils @@ -725,7 +753,8 @@ and use CTDB instead. %package -n ctdb-tests Summary: CTDB clustered database test suite -Requires: samba-client-libs = %{samba_depver} +Requires: %{name}-common-libs = %{samba_depver} +Requires: %{name}-client-libs = %{samba_depver} Requires: ctdb = %{samba_depver} Recommends: nc From 0cdb9d87a41f22f6dc792234bbf60dc02ef746fe Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 17 May 2019 16:44:00 +0200 Subject: [PATCH 56/76] Fix License tag --- samba.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index cfe8c0c..0495a5c 100644 --- a/samba.spec +++ b/samba.spec @@ -101,7 +101,7 @@ Epoch: 2 %endif Summary: Server and Client software to interoperate with Windows machines -License: GPLv3+ and LGPLv3+. +License: GPLv3+ and LGPLv3+ URL: http://www.samba.org/ # This is a xz recompressed file of https://ftp.samba.org/pub/samba/samba-%%{version}%%{pre_release}.tar.gz From eecd9d56d0a57c538c7e9b0415a5967b68976465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 22 May 2019 14:45:30 +0200 Subject: [PATCH 57/76] Update to Samba 4.10.4 Guenther --- .gitignore | 2 ++ samba.spec | 5 ++++- sources | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6439b05..8af172e 100644 --- a/.gitignore +++ b/.gitignore @@ -163,3 +163,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.2.tar.asc /samba-4.10.3.tar.xz /samba-4.10.3.tar.asc +/samba-4.10.4.tar.xz +/samba-4.10.4.tar.asc diff --git a/samba.spec b/samba.spec index 0495a5c..0a0d0dd 100644 --- a/samba.spec +++ b/samba.spec @@ -8,7 +8,7 @@ %define main_release 0 -%define samba_version 4.10.3 +%define samba_version 4.10.4 %define talloc_version 2.1.16 %define tdb_version 1.3.18 %define tevent_version 0.9.39 @@ -3431,6 +3431,9 @@ fi %endif # with_clustering_support %changelog +* Wed May 22 2019 Guenther Deschner - 4.10.4-0 +- Update to Samba 4.10.4 + * Tue May 14 2019 Guenther Deschner - 4.10.3-0 - Update to Samba 4.10.3 - resolves: #1705877, #1709679 - Security fixes for CVE-2018-16860 diff --git a/sources b/sources index e23c77b..cdd27f1 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.3.tar.xz) = 34fd0536aa4a859bae8b313d7ec21b1636b1a3a8511663895e2ca02e5c7365024895c4a4e4c211d7973453a9ae0fd89db8eec8f8d7837033c9e61c513f423903 -SHA512 (samba-4.10.3.tar.asc) = 4626664d1c89e56577216d46f32163f4df932ab31155fcbe2bdf34b507abf911dd392745170a0af473ef33ed0511603c456757e0c3ea0d4140dc8da28ea18077 +SHA512 (samba-4.10.4.tar.xz) = 4d4776f2c1b9abfc3fcb9ca196d15b801960a913884044825f16566ce192ab1c64efb692748f3fa8637775d7c28d3eebd6c3a33bcc975c68f5081a59c902eb4b +SHA512 (samba-4.10.4.tar.asc) = bbbce6c947539f06f50e13fc12cfc86c939c00389f602a2e2dc21d4c1bfadf6e246d5d6abee67438bfdff6eb959544adbb982076f3ac6f97d66655c1b44ec43b From d062acc7b3889b4e3af55f76664ba1613a1b1b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 28 May 2019 12:15:15 +0200 Subject: [PATCH 58/76] Add missing /etc/ctdb/events/legacy directory Guenther --- samba.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index 0a0d0dd..45959ec 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 0 +%define main_release 1 %define samba_version 4.10.4 %define talloc_version 2.1.16 @@ -2574,6 +2574,7 @@ fi # CTDB scripts, no config files # script with executable bit means activated %dir %{_sysconfdir}/ctdb/events +%dir %{_sysconfdir}/ctdb/events/legacy %dir %{_sysconfdir}/ctdb/events/notification %{_sysconfdir}/ctdb/events/notification/README @@ -3431,6 +3432,9 @@ fi %endif # with_clustering_support %changelog +* Tue May 28 2019 Guenther Deschner - 4.10.4-1 +- Add missing /etc/ctdb/events/legacy directory + * Wed May 22 2019 Guenther Deschner - 4.10.4-0 - Update to Samba 4.10.4 From 461627cebb4bc8ed28b48cf18c36fb52da8aa1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 28 May 2019 13:29:35 +0200 Subject: [PATCH 59/76] Add more missing ctdb directories resolves: #1656777 Guenther --- samba.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index 45959ec..c395088 100644 --- a/samba.spec +++ b/samba.spec @@ -2613,6 +2613,9 @@ fi %{_libexecdir}/ctdb/smnotify %dir %{_localstatedir}/lib/ctdb/ +%dir %{_localstatedir}/lib/ctdb/persistent +%dir %{_localstatedir}/lib/ctdb/state +%dir %{_localstatedir}/lib/ctdb/volatile %{_mandir}/man1/ctdb.1.gz %{_mandir}/man1/ctdb_diagnostics.1.gz @@ -3433,7 +3436,8 @@ fi %changelog * Tue May 28 2019 Guenther Deschner - 4.10.4-1 -- Add missing /etc/ctdb/events/legacy directory +- Add missing ctdb directories +- resolves: #1656777 * Wed May 22 2019 Guenther Deschner - 4.10.4-0 - Update to Samba 4.10.4 From 031398b6abaad5c969eabceed500b5947ca98970 Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Fri, 31 May 2019 06:55:34 +0200 Subject: [PATCH 60/76] Perl 5.30 rebuild --- samba.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index c395088..cd96498 100644 --- a/samba.spec +++ b/samba.spec @@ -86,7 +86,7 @@ Name: samba Version: %{samba_version} -Release: %{samba_release} +Release: %{samba_release}.1 %if 0%{?rhel} Epoch: 0 @@ -3435,6 +3435,9 @@ fi %endif # with_clustering_support %changelog +* Fri May 31 2019 Jitka Plesnikova - 2:4.10.4-1.1 +- Perl 5.30 rebuild + * Tue May 28 2019 Guenther Deschner - 4.10.4-1 - Add missing ctdb directories - resolves: #1656777 From bfd237a88eb8cd1492db6c72d72bd41bf02d1570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 19 Jun 2019 12:35:34 +0200 Subject: [PATCH 61/76] Update to Samba 4.10.5 resolves: #1711816, #1721872 - Security fixes for CVE-2019-12435 resolves: #1711837, #1721873 - Security fixes for CVE-2019-12436 Guenther --- .gitignore | 2 ++ samba.spec | 9 +++++++-- sources | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8af172e..2ae044a 100644 --- a/.gitignore +++ b/.gitignore @@ -165,3 +165,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.3.tar.asc /samba-4.10.4.tar.xz /samba-4.10.4.tar.asc +/samba-4.10.5.tar.xz +/samba-4.10.5.tar.asc diff --git a/samba.spec b/samba.spec index cd96498..e479ec4 100644 --- a/samba.spec +++ b/samba.spec @@ -6,9 +6,9 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 1 +%define main_release 0 -%define samba_version 4.10.4 +%define samba_version 4.10.5 %define talloc_version 2.1.16 %define tdb_version 1.3.18 %define tevent_version 0.9.39 @@ -3435,6 +3435,11 @@ fi %endif # with_clustering_support %changelog +* Wed Jun 19 2019 Guenther Deschner - 4.10.5-0 +- Update to Samba 4.10.5 +- resolves: #1711816, #1721872 - Security fixes for CVE-2019-12435 +- resolves: #1711837, #1721873 - Security fixes for CVE-2019-12436 + * Fri May 31 2019 Jitka Plesnikova - 2:4.10.4-1.1 - Perl 5.30 rebuild diff --git a/sources b/sources index cdd27f1..9957499 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.4.tar.xz) = 4d4776f2c1b9abfc3fcb9ca196d15b801960a913884044825f16566ce192ab1c64efb692748f3fa8637775d7c28d3eebd6c3a33bcc975c68f5081a59c902eb4b -SHA512 (samba-4.10.4.tar.asc) = bbbce6c947539f06f50e13fc12cfc86c939c00389f602a2e2dc21d4c1bfadf6e246d5d6abee67438bfdff6eb959544adbb982076f3ac6f97d66655c1b44ec43b +SHA512 (samba-4.10.5.tar.xz) = 87aceccb5ff1ca3ce62b05aaf3827671a639693832faf56aee200b11ca6b1124e67f5880e4f1e73185278c5369225aad0cf3d3ef889f12fa690e73d2accfb410 +SHA512 (samba-4.10.5.tar.asc) = 599b1a2e19cd4362aeb3dfecba3523e9f3e18645b6e169516ea6825c81fdc7c7480e11235f977e1282cc769d0434a85ba567791ae9b1ad9b515b26277c87bc67 From 06c62a692d9eda3eea1676cec54eb9135dca901a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 19 Jun 2019 18:18:19 +0200 Subject: [PATCH 62/76] Various bugfixes resolves: #1602824 - Make vfs_fruit operable with other remote VFS modules resolves: #1716455 - Avoid pathconf() in get_real_filename() VFS calls resolves: #1706090, #1700791 - Fix smbspool Guenther --- samba-4.10.6-smbspool.patch | 1127 +++++++++++ samba-4.10.6-vfs_fruit.patch | 3175 ++++++++++++++++++++++++++++++ samba-4.10.6-vfs_glusterfs.patch | 276 +++ samba.spec | 11 +- 4 files changed, 4588 insertions(+), 1 deletion(-) create mode 100644 samba-4.10.6-smbspool.patch create mode 100644 samba-4.10.6-vfs_fruit.patch create mode 100644 samba-4.10.6-vfs_glusterfs.patch diff --git a/samba-4.10.6-smbspool.patch b/samba-4.10.6-smbspool.patch new file mode 100644 index 0000000..fa12f06 --- /dev/null +++ b/samba-4.10.6-smbspool.patch @@ -0,0 +1,1127 @@ +From 16056895403f3c673dc5adc531b7e739d46292fb Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 13 May 2019 16:55:49 +0200 +Subject: [PATCH 1/9] s3:smbspool: Add the 'lp' group to the users groups + +This is required to access files in /var/spool/cups which have been +temporarily created in there by CUPS. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 + +Signed-off-by: Andreas Schneider +Reviewed-by: Guenther Deschner +(cherry picked from commit 6086efb6808089c431e7307fa239924bfda1185b) +--- + source3/client/smbspool_krb5_wrapper.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c +index 5c4da33238b..e6684fc0d0c 100644 +--- a/source3/client/smbspool_krb5_wrapper.c ++++ b/source3/client/smbspool_krb5_wrapper.c +@@ -82,6 +82,7 @@ int main(int argc, char *argv[]) + { + char smbspool_cmd[PATH_MAX] = {0}; + struct passwd *pwd; ++ struct group *g = NULL; + char gen_cc[PATH_MAX] = {0}; + struct stat sb; + char *env = NULL; +@@ -89,6 +90,7 @@ int main(int argc, char *argv[]) + char device_uri[4096] = {0}; + uid_t uid = (uid_t)-1; + gid_t gid = (gid_t)-1; ++ gid_t groups[1] = { (gid_t)-1 }; + unsigned long tmp; + int cmp; + int rc; +@@ -176,6 +178,26 @@ int main(int argc, char *argv[]) + return CUPS_BACKEND_FAILED; + } + ++ /* ++ * We need the primary group of the 'lp' user. This is needed to access ++ * temporary files in /var/spool/cups/. ++ */ ++ g = getgrnam("lp"); ++ if (g == NULL) { ++ CUPS_SMB_ERROR("Failed to find user 'lp' - %s", ++ strerror(errno)); ++ return CUPS_BACKEND_FAILED; ++ } ++ ++ CUPS_SMB_DEBUG("Adding group 'lp' (%u)", g->gr_gid); ++ groups[0] = g->gr_gid; ++ rc = setgroups(sizeof(groups), groups); ++ if (rc != 0) { ++ CUPS_SMB_ERROR("Failed to set groups for 'lp' - %s", ++ strerror(errno)); ++ return CUPS_BACKEND_FAILED; ++ } ++ + CUPS_SMB_DEBUG("Switching to gid=%d", gid); + rc = setgid(gid); + if (rc != 0) { +-- +2.21.0 + + +From a6b29458e833db85057ef1b7c0403e90f76adfa4 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Thu, 16 May 2019 13:41:02 +0200 +Subject: [PATCH 2/9] s3:smbspool: Print the principal we use to authenticate + with + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 + +Signed-off-by: Andreas Schneider +Reviewed-by: Guenther Deschner +(cherry picked from commit 42492d547661cb7a98c237b32d42ee93de35aba5) +--- + source3/client/smbspool.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c +index 22071613677..efbdd418fdb 100644 +--- a/source3/client/smbspool.c ++++ b/source3/client/smbspool.c +@@ -616,6 +616,7 @@ static bool kerberos_ccache_is_valid(void) { + return false; + } else { + krb5_principal default_princ = NULL; ++ char *princ_name = NULL; + + code = krb5_cc_get_principal(ctx, + ccache, +@@ -625,6 +626,16 @@ static bool kerberos_ccache_is_valid(void) { + krb5_free_context(ctx); + return false; + } ++ ++ code = krb5_unparse_name(ctx, ++ default_princ, ++ &princ_name); ++ if (code == 0) { ++ fprintf(stderr, ++ "DEBUG: Try to authenticate as %s\n", ++ princ_name); ++ krb5_free_unparsed_name(ctx, princ_name); ++ } + krb5_free_principal(ctx, default_princ); + } + krb5_cc_close(ctx, ccache); +-- +2.21.0 + + +From b64ed8bb51c7c78d757881fc3944f7bc812f5457 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Thu, 16 May 2019 14:25:00 +0200 +Subject: [PATCH 3/9] s3:smbspool: Add debug for finding KRB5CCNAME + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 + +Signed-off-by: Andreas Schneider +Reviewed-by: Guenther Deschner +(cherry picked from commit 3632bfef25e471075886eb7aecddd4cc260db8ba) +--- + source3/client/smbspool_krb5_wrapper.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c +index e6684fc0d0c..2cdcd372ec6 100644 +--- a/source3/client/smbspool_krb5_wrapper.c ++++ b/source3/client/smbspool_krb5_wrapper.c +@@ -219,10 +219,14 @@ int main(int argc, char *argv[]) + env = getenv("KRB5CCNAME"); + if (env != NULL && env[0] != 0) { + snprintf(gen_cc, sizeof(gen_cc), "%s", env); ++ CUPS_SMB_DEBUG("User already set KRB5CCNAME [%s] as ccache", ++ gen_cc); + + goto create_env; + } + ++ CUPS_SMB_DEBUG("Trying to guess KRB5CCNAME (FILE, DIR, KEYRING)"); ++ + snprintf(gen_cc, sizeof(gen_cc), "/tmp/krb5cc_%d", uid); + + rc = lstat(gen_cc, &sb); +-- +2.21.0 + + +From 3b7be905d256955e7e8c056f14626547e08fea2d Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Thu, 16 May 2019 17:10:57 +0200 +Subject: [PATCH 4/9] s3:smbspool: Use %u format specifier to print uid + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 + +Signed-off-by: Andreas Schneider +Reviewed-by: Guenther Deschner +(cherry picked from commit be596ce3d2455bd49a8ebd311d8c764c37852858) +--- + source3/client/smbspool_krb5_wrapper.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c +index 2cdcd372ec6..3266b90ec1a 100644 +--- a/source3/client/smbspool_krb5_wrapper.c ++++ b/source3/client/smbspool_krb5_wrapper.c +@@ -227,13 +227,13 @@ int main(int argc, char *argv[]) + + CUPS_SMB_DEBUG("Trying to guess KRB5CCNAME (FILE, DIR, KEYRING)"); + +- snprintf(gen_cc, sizeof(gen_cc), "/tmp/krb5cc_%d", uid); ++ snprintf(gen_cc, sizeof(gen_cc), "/tmp/krb5cc_%u", uid); + + rc = lstat(gen_cc, &sb); + if (rc == 0) { +- snprintf(gen_cc, sizeof(gen_cc), "FILE:/tmp/krb5cc_%d", uid); ++ snprintf(gen_cc, sizeof(gen_cc), "FILE:/tmp/krb5cc_%u", uid); + } else { +- snprintf(gen_cc, sizeof(gen_cc), "/run/user/%d/krb5cc", uid); ++ snprintf(gen_cc, sizeof(gen_cc), "/run/user/%u/krb5cc", uid); + + rc = lstat(gen_cc, &sb); + if (rc == 0 && S_ISDIR(sb.st_mode)) { +-- +2.21.0 + + +From 6e2069b014358b6f7e04121fa39c5f2750506d78 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Thu, 16 May 2019 17:40:43 +0200 +Subject: [PATCH 5/9] s3:smbspool: Fallback to default ccache if KRB5CCNAME is + not set + +This could also support the new KCM credential cache storage. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 + +Signed-off-by: Andreas Schneider +Reviewed-by: Guenther Deschner +(cherry picked from commit 6bbdf69e406916107400e2cabdbc831e2a2bbee3) +--- + source3/client/smbspool_krb5_wrapper.c | 79 ++++++++++++++++++-------- + source3/wscript_build | 1 + + 2 files changed, 55 insertions(+), 25 deletions(-) + +diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c +index 3266b90ec1a..bff1df417e8 100644 +--- a/source3/client/smbspool_krb5_wrapper.c ++++ b/source3/client/smbspool_krb5_wrapper.c +@@ -21,6 +21,7 @@ + + #include "includes.h" + #include "system/filesys.h" ++#include "system/kerberos.h" + #include "system/passwd.h" + + #include +@@ -68,6 +69,50 @@ static void cups_smb_debug(enum cups_smb_dbglvl_e lvl, const char *format, ...) + buffer); + } + ++static bool kerberos_get_default_ccache(char *ccache_buf, size_t len) ++{ ++ krb5_context ctx; ++ const char *ccache_name = NULL; ++ char *full_ccache_name = NULL; ++ krb5_ccache ccache = NULL; ++ krb5_error_code code; ++ ++ code = krb5_init_context(&ctx); ++ if (code != 0) { ++ return false; ++ } ++ ++ ccache_name = krb5_cc_default_name(ctx); ++ if (ccache_name == NULL) { ++ krb5_free_context(ctx); ++ return false; ++ } ++ ++ code = krb5_cc_resolve(ctx, ccache_name, &ccache); ++ if (code != 0) { ++ krb5_free_context(ctx); ++ return false; ++ } ++ ++ code = krb5_cc_get_full_name(ctx, ccache, &full_ccache_name); ++ krb5_cc_close(ctx, ccache); ++ if (code != 0) { ++ krb5_free_context(ctx); ++ return false; ++ } ++ ++ snprintf(ccache_buf, len, "%s", full_ccache_name); ++ ++#ifdef SAMBA4_USES_HEIMDAL ++ free(full_ccache_name); ++#else ++ krb5_free_string(ctx, full_ccache_name); ++#endif ++ krb5_free_context(ctx); ++ ++ return true; ++} ++ + /* + * This is a helper binary to execute smbspool. + * +@@ -84,7 +129,6 @@ int main(int argc, char *argv[]) + struct passwd *pwd; + struct group *g = NULL; + char gen_cc[PATH_MAX] = {0}; +- struct stat sb; + char *env = NULL; + char auth_info_required[256] = {0}; + char device_uri[4096] = {0}; +@@ -92,6 +136,7 @@ int main(int argc, char *argv[]) + gid_t gid = (gid_t)-1; + gid_t groups[1] = { (gid_t)-1 }; + unsigned long tmp; ++ bool ok; + int cmp; + int rc; + +@@ -225,32 +270,16 @@ int main(int argc, char *argv[]) + goto create_env; + } + +- CUPS_SMB_DEBUG("Trying to guess KRB5CCNAME (FILE, DIR, KEYRING)"); +- +- snprintf(gen_cc, sizeof(gen_cc), "/tmp/krb5cc_%u", uid); +- +- rc = lstat(gen_cc, &sb); +- if (rc == 0) { +- snprintf(gen_cc, sizeof(gen_cc), "FILE:/tmp/krb5cc_%u", uid); +- } else { +- snprintf(gen_cc, sizeof(gen_cc), "/run/user/%u/krb5cc", uid); +- +- rc = lstat(gen_cc, &sb); +- if (rc == 0 && S_ISDIR(sb.st_mode)) { +- snprintf(gen_cc, +- sizeof(gen_cc), +- "DIR:/run/user/%d/krb5cc", +- uid); +- } else { +-#if defined(__linux__) +- snprintf(gen_cc, +- sizeof(gen_cc), +- "KEYRING:persistent:%d", +- uid); +-#endif +- } ++ ok = kerberos_get_default_ccache(gen_cc, sizeof(gen_cc)); ++ if (ok) { ++ CUPS_SMB_DEBUG("Use default KRB5CCNAME [%s]", ++ gen_cc); ++ goto create_env; + } + ++ /* Fallback to a FILE ccache */ ++ snprintf(gen_cc, sizeof(gen_cc), "FILE:/tmp/krb5cc_%u", uid); ++ + create_env: + /* + * Make sure we do not have LD_PRELOAD or other security relevant +diff --git a/source3/wscript_build b/source3/wscript_build +index f67ce59fe52..8e34b7d0261 100644 +--- a/source3/wscript_build ++++ b/source3/wscript_build +@@ -1134,6 +1134,7 @@ bld.SAMBA3_BINARY('smbspool_krb5_wrapper', + deps=''' + DYNCONFIG + cups ++ krb5 + ''', + install_path='${LIBEXECDIR}/samba', + enabled=bld.CONFIG_SET('HAVE_CUPS')) +-- +2.21.0 + + +From d6673500b639ad1402014aa35113bd395e35d4f5 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 13 May 2019 16:48:31 +0200 +Subject: [PATCH 6/9] s3:smbspool: Print the filename we failed to open + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 + +Signed-off-by: Andreas Schneider +Reviewed-by: Guenther Deschner +(cherry picked from commit 281274572bcc3125fe6026a01ef7bf7ef584a0dd) +--- + source3/client/smbspool.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c +index efbdd418fdb..ef16c2bed42 100644 +--- a/source3/client/smbspool.c ++++ b/source3/client/smbspool.c +@@ -224,7 +224,9 @@ main(int argc, /* I - Number of command-line arguments */ + + fp = fopen(print_file, "rb"); + if (fp == NULL) { +- perror("ERROR: Unable to open print file"); ++ fprintf(stderr, ++ "ERROR: Unable to open print file: %s", ++ print_file); + goto done; + } + +-- +2.21.0 + + +From ea931f33d92506cdab17a7b746e43831d6bf2112 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 13 May 2019 18:54:02 +0200 +Subject: [PATCH 7/9] s3:smbspool: Always try to authenticate using Kerberos + +If username and password is given, then fallback to NTLM. However try +kinit first. Also we correctly handle NULL passwords in the meantime and +this makes it easier to deal with issues. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 + +Signed-off-by: Andreas Schneider +Reviewed-by: Guenther Deschner +(cherry picked from commit 3d719a1f85db8e423dc3a4116a2228961d5ac48d) +--- + source3/client/smbspool.c | 90 ++++++++++++++++++++++----------------- + 1 file changed, 51 insertions(+), 39 deletions(-) + +diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c +index ef16c2bed42..f21aac2ac58 100644 +--- a/source3/client/smbspool.c ++++ b/source3/client/smbspool.c +@@ -88,8 +88,8 @@ main(int argc, /* I - Number of command-line arguments */ + int port; /* Port number */ + char uri[1024], /* URI */ + *sep, /* Pointer to separator */ +- *tmp, *tmp2, /* Temp pointers to do escaping */ +- *password; /* Password */ ++ *tmp, *tmp2; /* Temp pointers to do escaping */ ++ const char *password = NULL; /* Password */ + char *username, /* Username */ + *server, /* Server name */ + *printer;/* Printer name */ +@@ -293,8 +293,6 @@ main(int argc, /* I - Number of command-line arguments */ + if ((tmp2 = strchr_m(tmp, ':')) != NULL) { + *tmp2++ = '\0'; + password = uri_unescape_alloc(tmp2); +- } else { +- password = empty_str; + } + username = uri_unescape_alloc(tmp); + } else { +@@ -302,14 +300,15 @@ main(int argc, /* I - Number of command-line arguments */ + username = empty_str; + } + +- if ((password = getenv("AUTH_PASSWORD")) == NULL) { +- password = empty_str; ++ env = getenv("AUTH_PASSWORD"); ++ if (env != NULL && strlen(env) > 0) { ++ password = env; + } + + server = uri + 6; + } + +- if (password != empty_str) { ++ if (password != NULL) { + auth_info_required = "username,password"; + } + +@@ -514,6 +513,7 @@ smb_complete_connection(const char *myname, + NTSTATUS nt_status; + struct cli_credentials *creds = NULL; + bool use_kerberos = false; ++ bool fallback_after_kerberos = false; + + /* Start the SMB connection */ + *need_auth = false; +@@ -524,27 +524,21 @@ smb_complete_connection(const char *myname, + return NULL; + } + +- /* +- * We pretty much guarantee password must be valid or a pointer to a +- * 0 char. +- */ +- if (!password) { +- *need_auth = true; +- return NULL; +- } +- + if (flags & CLI_FULL_CONNECTION_USE_KERBEROS) { +- auth_info_required = "negotiate"; + use_kerberos = true; + } + ++ if (flags & CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS) { ++ fallback_after_kerberos = true; ++ } ++ + creds = cli_session_creds_init(cli, + username, + workgroup, + NULL, /* realm */ + password, + use_kerberos, +- false, /* fallback_after_kerberos */ ++ fallback_after_kerberos, + false, /* use_ccache */ + false); /* password_is_nt_hash */ + if (creds == NULL) { +@@ -663,6 +657,10 @@ smb_connect(const char *workgroup, /* I - Workgroup */ + struct cli_state *cli; /* New connection */ + char *myname = NULL; /* Client name */ + struct passwd *pwd; ++ int flags = CLI_FULL_CONNECTION_USE_KERBEROS; ++ bool use_kerberos = false; ++ const char *user = username; ++ int cmp; + + /* + * Get the names and addresses of the client and server... +@@ -672,42 +670,56 @@ smb_connect(const char *workgroup, /* I - Workgroup */ + return NULL; + } + +- /* +- * See if we have a username first. This is for backwards compatible +- * behavior with 3.0.14a +- */ + +- if (username == NULL || username[0] == '\0') { +- if (kerberos_ccache_is_valid()) { +- goto kerberos_auth; ++ cmp = strcmp(auth_info_required, "negotiate"); ++ if (cmp == 0) { ++ if (!kerberos_ccache_is_valid()) { ++ return NULL; + } ++ user = jobusername; ++ ++ use_kerberos = true; ++ fprintf(stderr, ++ "DEBUG: Try to connect using Kerberos ...\n"); ++ } ++ ++ cmp = strcmp(auth_info_required, "username,password"); ++ if (cmp == 0) { ++ if (username == NULL || username[0] == '\0') { ++ return NULL; ++ } ++ ++ /* Fallback to NTLM */ ++ flags |= CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS; ++ ++ fprintf(stderr, ++ "DEBUG: Try to connect using username/password ...\n"); ++ } ++ ++ cmp = strcmp(auth_info_required, "none"); ++ if (cmp == 0) { ++ fprintf(stderr, ++ "DEBUG: This backend doesn't support none auth ...\n"); ++ return NULL; + } + + cli = smb_complete_connection(myname, + server, + port, +- username, ++ user, + password, + workgroup, + share, +- 0, ++ flags, + need_auth); + if (cli != NULL) { +- fputs("DEBUG: Connected with username/password...\n", stderr); ++ fprintf(stderr, "DEBUG: SMB connection established.\n"); + return (cli); + } + +-kerberos_auth: +- /* +- * Try to use the user kerberos credentials (if any) to authenticate +- */ +- cli = smb_complete_connection(myname, server, port, jobusername, "", +- workgroup, share, +- CLI_FULL_CONNECTION_USE_KERBEROS, need_auth); +- +- if (cli) { +- fputs("DEBUG: Connected using Kerberos...\n", stderr); +- return (cli); ++ if (!use_kerberos) { ++ fprintf(stderr, "ERROR: SMB connection failed!\n"); ++ return NULL; + } + + /* give a chance for a passwordless NTLMSSP session setup */ +-- +2.21.0 + + +From 8689e83030160fbdbe9b72ff0c86826b49f707a1 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Thu, 16 May 2019 18:24:32 +0200 +Subject: [PATCH 8/9] s3:smbspool: Add debug messages to + kerberos_ccache_is_valid() + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 + +Signed-off-by: Andreas Schneider +Reviewed-by: Guenther Deschner +(cherry picked from commit 93acd880801524c5e621df7b5bf5ad650f93cec3) +--- + source3/client/smbspool.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c +index f21aac2ac58..79e210dd12e 100644 +--- a/source3/client/smbspool.c ++++ b/source3/client/smbspool.c +@@ -602,12 +602,15 @@ static bool kerberos_ccache_is_valid(void) { + + ccache_name = krb5_cc_default_name(ctx); + if (ccache_name == NULL) { ++ DBG_ERR("Failed to get default ccache name\n"); + krb5_free_context(ctx); + return false; + } + + code = krb5_cc_resolve(ctx, ccache_name, &ccache); + if (code != 0) { ++ DBG_ERR("Failed to resolve ccache name: %s\n", ++ ccache_name); + krb5_free_context(ctx); + return false; + } else { +@@ -618,6 +621,9 @@ static bool kerberos_ccache_is_valid(void) { + ccache, + &default_princ); + if (code != 0) { ++ DBG_ERR("Failed to get default principal from " ++ "ccache: %s\n", ++ ccache_name); + krb5_cc_close(ctx, ccache); + krb5_free_context(ctx); + return false; +-- +2.21.0 + + +From d1cee66a5e66d83b2aee3a803351c51d4f5a8118 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Tue, 14 May 2019 11:35:46 +0200 +Subject: [PATCH 9/9] s3:smbspool: Use NTSTATUS return codes + +This allows us to simplify some code and return better errors. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 + +Signed-off-by: Andreas Schneider +Reviewed-by: Guenther Deschner +(cherry picked from commit d9af3dc02e98a3eb22441dfbdeddbaca0af078ea) +--- + source3/client/smbspool.c | 250 ++++++++++++++++++++++---------------- + 1 file changed, 145 insertions(+), 105 deletions(-) + +diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c +index 79e210dd12e..ad988eb0df9 100644 +--- a/source3/client/smbspool.c ++++ b/source3/client/smbspool.c +@@ -61,12 +61,27 @@ + * Local functions... + */ + +-static int get_exit_code(struct cli_state * cli, NTSTATUS nt_status); ++static int get_exit_code(NTSTATUS nt_status); + static void list_devices(void); +-static struct cli_state *smb_complete_connection(const char *, const char *, +- int, const char *, const char *, const char *, const char *, int, bool *need_auth); +-static struct cli_state *smb_connect(const char *, const char *, int, const +- char *, const char *, const char *, const char *, bool *need_auth); ++static NTSTATUS ++smb_complete_connection(struct cli_state **output_cli, ++ const char *myname, ++ const char *server, ++ int port, ++ const char *username, ++ const char *password, ++ const char *workgroup, ++ const char *share, ++ int flags); ++static NTSTATUS ++smb_connect(struct cli_state **output_cli, ++ const char *workgroup, ++ const char *server, ++ const int port, ++ const char *share, ++ const char *username, ++ const char *password, ++ const char *jobusername); + static int smb_print(struct cli_state *, const char *, FILE *); + static char *uri_unescape_alloc(const char *); + #if 0 +@@ -90,16 +105,15 @@ main(int argc, /* I - Number of command-line arguments */ + *sep, /* Pointer to separator */ + *tmp, *tmp2; /* Temp pointers to do escaping */ + const char *password = NULL; /* Password */ +- char *username, /* Username */ +- *server, /* Server name */ ++ const char *username = NULL; /* Username */ ++ char *server, /* Server name */ + *printer;/* Printer name */ + const char *workgroup; /* Workgroup */ + FILE *fp; /* File to print */ + int status = 1; /* Status of LPD job */ +- struct cli_state *cli; /* SMB interface */ +- char empty_str[] = ""; ++ NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; ++ struct cli_state *cli = NULL; /* SMB interface */ + int tries = 0; +- bool need_auth = true; + const char *dev_uri = NULL; + const char *env = NULL; + const char *config_file = NULL; +@@ -296,8 +310,9 @@ main(int argc, /* I - Number of command-line arguments */ + } + username = uri_unescape_alloc(tmp); + } else { +- if ((username = getenv("AUTH_USERNAME")) == NULL) { +- username = empty_str; ++ env = getenv("AUTH_USERNAME"); ++ if (env != NULL && strlen(env) > 0) { ++ username = env; + } + + env = getenv("AUTH_PASSWORD"); +@@ -369,27 +384,39 @@ main(int argc, /* I - Number of command-line arguments */ + load_interfaces(); + + do { +- cli = smb_connect(workgroup, +- server, +- port, +- printer, +- username, +- password, +- print_user, +- &need_auth); +- if (cli == NULL) { +- if (need_auth) { +- exit(2); ++ nt_status = smb_connect(&cli, ++ workgroup, ++ server, ++ port, ++ printer, ++ username, ++ password, ++ print_user); ++ if (!NT_STATUS_IS_OK(nt_status)) { ++ status = get_exit_code(nt_status); ++ if (status == 2) { ++ fprintf(stderr, ++ "DEBUG: Unable to connect to CIFS " ++ "host: %s", ++ nt_errstr(nt_status)); ++ goto done; + } else if (getenv("CLASS") == NULL) { +- fprintf(stderr, "ERROR: Unable to connect to CIFS host, will retry in 60 seconds...\n"); ++ fprintf(stderr, ++ "ERROR: Unable to connect to CIFS " ++ "host: %s. Will retry in 60 " ++ "seconds...\n", ++ nt_errstr(nt_status)); + sleep(60); + tries++; + } else { +- fprintf(stderr, "ERROR: Unable to connect to CIFS host, trying next printer...\n"); ++ fprintf(stderr, ++ "ERROR: Unable to connect to CIFS " ++ "host: %s. Trying next printer...\n", ++ nt_errstr(nt_status)); + goto done; + } + } +- } while ((cli == NULL) && (tries < MAX_RETRY_CONNECT)); ++ } while (!NT_STATUS_IS_OK(nt_status) && (tries < MAX_RETRY_CONNECT)); + + if (cli == NULL) { + fprintf(stderr, "ERROR: Unable to connect to CIFS host after (tried %d times)\n", tries); +@@ -436,10 +463,9 @@ done: + */ + + static int +-get_exit_code(struct cli_state * cli, +- NTSTATUS nt_status) ++get_exit_code(NTSTATUS nt_status) + { +- int i; ++ size_t i; + + /* List of NTSTATUS errors that are considered + * authentication errors +@@ -455,17 +481,16 @@ get_exit_code(struct cli_state * cli, + }; + + +- fprintf(stderr, "DEBUG: get_exit_code(cli=%p, nt_status=%s [%x])\n", +- cli, nt_errstr(nt_status), NT_STATUS_V(nt_status)); ++ fprintf(stderr, ++ "DEBUG: get_exit_code(nt_status=%s [%x])\n", ++ nt_errstr(nt_status), NT_STATUS_V(nt_status)); + + for (i = 0; i < ARRAY_SIZE(auth_errors); i++) { + if (!NT_STATUS_EQUAL(nt_status, auth_errors[i])) { + continue; + } + +- if (cli) { +- fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required); +- } ++ fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required); + + /* + * 2 = authentication required... +@@ -498,16 +523,16 @@ list_devices(void) + } + + +-static struct cli_state * +-smb_complete_connection(const char *myname, ++static NTSTATUS ++smb_complete_connection(struct cli_state **output_cli, ++ const char *myname, + const char *server, + int port, + const char *username, + const char *password, + const char *workgroup, + const char *share, +- int flags, +- bool *need_auth) ++ int flags) + { + struct cli_state *cli; /* New connection */ + NTSTATUS nt_status; +@@ -516,12 +541,11 @@ smb_complete_connection(const char *myname, + bool fallback_after_kerberos = false; + + /* Start the SMB connection */ +- *need_auth = false; + nt_status = cli_start_connection(&cli, myname, server, NULL, port, + SMB_SIGNING_DEFAULT, flags); + if (!NT_STATUS_IS_OK(nt_status)) { + fprintf(stderr, "ERROR: Connection failed: %s\n", nt_errstr(nt_status)); +- return NULL; ++ return nt_status; + } + + if (flags & CLI_FULL_CONNECTION_USE_KERBEROS) { +@@ -544,20 +568,16 @@ smb_complete_connection(const char *myname, + if (creds == NULL) { + fprintf(stderr, "ERROR: cli_session_creds_init failed\n"); + cli_shutdown(cli); +- return NULL; ++ return NT_STATUS_NO_MEMORY; + } + + nt_status = cli_session_setup_creds(cli, creds); + if (!NT_STATUS_IS_OK(nt_status)) { + fprintf(stderr, "ERROR: Session setup failed: %s\n", nt_errstr(nt_status)); + +- if (get_exit_code(cli, nt_status) == 2) { +- *need_auth = true; +- } +- + cli_shutdown(cli); + +- return NULL; ++ return nt_status; + } + + nt_status = cli_tree_connect_creds(cli, share, "?????", creds); +@@ -565,13 +585,9 @@ smb_complete_connection(const char *myname, + fprintf(stderr, "ERROR: Tree connect failed (%s)\n", + nt_errstr(nt_status)); + +- if (get_exit_code(cli, nt_status) == 2) { +- *need_auth = true; +- } +- + cli_shutdown(cli); + +- return NULL; ++ return nt_status; + } + #if 0 + /* Need to work out how to specify this on the URL. */ +@@ -584,7 +600,8 @@ smb_complete_connection(const char *myname, + } + #endif + +- return cli; ++ *output_cli = cli; ++ return NT_STATUS_OK; + } + + static bool kerberos_ccache_is_valid(void) { +@@ -650,49 +667,48 @@ static bool kerberos_ccache_is_valid(void) { + * 'smb_connect()' - Return a connection to a server. + */ + +-static struct cli_state * /* O - SMB connection */ +-smb_connect(const char *workgroup, /* I - Workgroup */ ++static NTSTATUS ++smb_connect(struct cli_state **output_cli, ++ const char *workgroup, /* I - Workgroup */ + const char *server, /* I - Server */ + const int port, /* I - Port */ + const char *share, /* I - Printer */ + const char *username, /* I - Username */ + const char *password, /* I - Password */ +- const char *jobusername, /* I - User who issued the print job */ +- bool *need_auth) +-{ /* O - Need authentication? */ +- struct cli_state *cli; /* New connection */ ++ const char *jobusername) /* I - User who issued the print job */ ++{ ++ struct cli_state *cli = NULL; /* New connection */ + char *myname = NULL; /* Client name */ + struct passwd *pwd; + int flags = CLI_FULL_CONNECTION_USE_KERBEROS; + bool use_kerberos = false; + const char *user = username; +- int cmp; ++ NTSTATUS nt_status; + + /* + * Get the names and addresses of the client and server... + */ + myname = get_myname(talloc_tos()); + if (!myname) { +- return NULL; ++ return NT_STATUS_NO_MEMORY; + } + + +- cmp = strcmp(auth_info_required, "negotiate"); +- if (cmp == 0) { ++ if (strcmp(auth_info_required, "negotiate") == 0) { + if (!kerberos_ccache_is_valid()) { +- return NULL; ++ fprintf(stderr, ++ "ERROR: No valid Kerberos credential cache " ++ "found!\n"); ++ return NT_STATUS_LOGON_FAILURE; + } + user = jobusername; + + use_kerberos = true; + fprintf(stderr, + "DEBUG: Try to connect using Kerberos ...\n"); +- } +- +- cmp = strcmp(auth_info_required, "username,password"); +- if (cmp == 0) { +- if (username == NULL || username[0] == '\0') { +- return NULL; ++ } else if (strcmp(auth_info_required, "username,password") == 0) { ++ if (username == NULL) { ++ return NT_STATUS_INVALID_ACCOUNT_NAME; + } + + /* Fallback to NTLM */ +@@ -700,59 +716,83 @@ smb_connect(const char *workgroup, /* I - Workgroup */ + + fprintf(stderr, + "DEBUG: Try to connect using username/password ...\n"); +- } ++ } else { ++ if (username != NULL) { ++ flags |= CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS; ++ } else if (kerberos_ccache_is_valid()) { ++ auth_info_required = "negotiate"; + +- cmp = strcmp(auth_info_required, "none"); +- if (cmp == 0) { +- fprintf(stderr, +- "DEBUG: This backend doesn't support none auth ...\n"); +- return NULL; ++ user = jobusername; ++ use_kerberos = true; ++ } else { ++ fprintf(stderr, ++ "DEBUG: This backend requires credentials!\n"); ++ return NT_STATUS_ACCESS_DENIED; ++ } + } + +- cli = smb_complete_connection(myname, +- server, +- port, +- user, +- password, +- workgroup, +- share, +- flags, +- need_auth); +- if (cli != NULL) { ++ nt_status = smb_complete_connection(&cli, ++ myname, ++ server, ++ port, ++ user, ++ password, ++ workgroup, ++ share, ++ flags); ++ if (NT_STATUS_IS_OK(nt_status)) { + fprintf(stderr, "DEBUG: SMB connection established.\n"); +- return (cli); ++ ++ *output_cli = cli; ++ return NT_STATUS_OK; + } + + if (!use_kerberos) { + fprintf(stderr, "ERROR: SMB connection failed!\n"); +- return NULL; ++ return nt_status; + } + + /* give a chance for a passwordless NTLMSSP session setup */ + pwd = getpwuid(geteuid()); + if (pwd == NULL) { +- return NULL; +- } +- +- cli = smb_complete_connection(myname, server, port, pwd->pw_name, "", +- workgroup, share, 0, need_auth); +- +- if (cli) { ++ return NT_STATUS_ACCESS_DENIED; ++ } ++ ++ nt_status = smb_complete_connection(&cli, ++ myname, ++ server, ++ port, ++ pwd->pw_name, ++ "", ++ workgroup, ++ share, ++ 0); ++ if (NT_STATUS_IS_OK(nt_status)) { + fputs("DEBUG: Connected with NTLMSSP...\n", stderr); +- return (cli); ++ ++ *output_cli = cli; ++ return NT_STATUS_OK; + } + + /* + * last try. Use anonymous authentication + */ + +- cli = smb_complete_connection(myname, server, port, "", "", +- workgroup, share, 0, need_auth); +- /* +- * Return the new connection... +- */ +- +- return (cli); ++ nt_status = smb_complete_connection(&cli, ++ myname, ++ server, ++ port, ++ "", ++ "", ++ workgroup, ++ share, ++ 0); ++ if (NT_STATUS_IS_OK(nt_status)) { ++ *output_cli = cli; ++ return NT_STATUS_OK; ++ } ++ ++ return nt_status; + } + + +@@ -798,7 +838,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */ + if (!NT_STATUS_IS_OK(nt_status)) { + fprintf(stderr, "ERROR: %s opening remote spool %s\n", + nt_errstr(nt_status), title); +- return get_exit_code(cli, nt_status); ++ return get_exit_code(nt_status); + } + + /* +@@ -816,7 +856,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */ + status = cli_writeall(cli, fnum, 0, (uint8_t *)buffer, + tbytes, nbytes, NULL); + if (!NT_STATUS_IS_OK(status)) { +- int ret = get_exit_code(cli, status); ++ int ret = get_exit_code(status); + fprintf(stderr, "ERROR: Error writing spool: %s\n", + nt_errstr(status)); + fprintf(stderr, "DEBUG: Returning status %d...\n", +@@ -832,7 +872,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */ + if (!NT_STATUS_IS_OK(nt_status)) { + fprintf(stderr, "ERROR: %s closing remote spool %s\n", + nt_errstr(nt_status), title); +- return get_exit_code(cli, nt_status); ++ return get_exit_code(nt_status); + } else { + return (0); + } +-- +2.21.0 + +From ffa5f8b65c662130c2d23e47df6d00fef3b73cc3 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Tue, 18 Jun 2019 14:43:50 +0200 +Subject: [PATCH] s3:client: Link smbspool_krb5_wrapper against krb5samba + +Heimdal doesn't provide krb5_free_unparsed_name(), so we need to use the +function we provide in krb5samba. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 + +Signed-off-by: Andreas Schneider +Reviewed-by: Ralph Boehme +(cherry picked from commit 9268919e046190c7b423133de3f9d0edada3f1b8) +--- + source3/wscript_build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source3/wscript_build b/source3/wscript_build +index 1ebb006781a..26e251f442a 100644 +--- a/source3/wscript_build ++++ b/source3/wscript_build +@@ -1133,7 +1133,7 @@ bld.SAMBA3_BINARY('smbspool_krb5_wrapper', + deps=''' + DYNCONFIG + cups +- krb5 ++ krb5samba + ''', + install_path='${LIBEXECDIR}/samba', + enabled=bld.CONFIG_SET('HAVE_CUPS')) +-- +2.21.0 + diff --git a/samba-4.10.6-vfs_fruit.patch b/samba-4.10.6-vfs_fruit.patch new file mode 100644 index 0000000..ddabd9e --- /dev/null +++ b/samba-4.10.6-vfs_fruit.patch @@ -0,0 +1,3175 @@ +From 919036329cf0005ac0d97a6f3eacac24617bbf26 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Tue, 21 May 2019 18:39:52 +0200 +Subject: [PATCH 1/5] s4:torture/vfs/fruit: ensure test_adouble_conversion() + uses a non-emtpy resourcefork + +This ensures the resource fork is not deleted as part of the AppleDouble file +conversion for the option fruit:wipe_intentionally_left_blank_rfork=yes. + +This is currently not a problem in selftest, as we don't enable the option, but +a subsequent commit will run all vfs.fruit tests against a share with this +option enabled. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit c3d28d49be3c7536d1ccfe8d00553ce72843f369) +--- + source4/torture/vfs/fruit.c | 671 +++++++++++++++++++++++++++++++++++- + 1 file changed, 668 insertions(+), 3 deletions(-) + +diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c +index e0ba935ff99..1c0754af456 100644 +--- a/source4/torture/vfs/fruit.c ++++ b/source4/torture/vfs/fruit.c +@@ -1027,6 +1027,666 @@ static char osx_adouble_without_xattr[] = { + 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1e, 0xff, 0xff + }; + ++/* ++The buf below contains the following AppleDouble encoded data: ++ ++------------------------------------------------------------------------------- ++MagicNumber: 00051607 : AppleDouble ++Version : 00020000 : Version 2 ++Filler : 4D 61 63 20 4F 53 20 58 20 20 20 20 20 20 20 20 : Mac OS X ++Num. of ent: 0002 : 2 ++ ++------------------------------------------------------------------------------- ++Entry ID : 00000009 : Finder Info ++Offset : 00000032 : 50 ++Length : 00000EB0 : 3760 ++ ++-FInfo-----: ++Type : 54455354 : TEST ++Creator : 534C4F57 : SLOW ++isAlias : 0 ++Invisible : 0 ++hasBundle : 0 ++nameLocked : 0 ++Stationery : 0 ++CustomIcon : 0 ++Reserved : 0 ++Inited : 0 ++NoINITS : 0 ++Shared : 0 ++SwitchLaunc: 0 ++Hidden Ext : 0 ++color : 100 : blue ++isOnDesk : 0 ++Location v : 0000 : 0 ++Location h : 0000 : 0 ++Fldr : 0000 : .. ++ ++-FXInfo----: ++Rsvd|IconID: 0000 : 0 ++Rsvd : 0000 : .. ++Rsvd : 0000 : .. ++Rsvd : 0000 : .. ++AreInvalid : 0 ++unknown bit: 0 ++unknown bit: 0 ++unknown bit: 0 ++unknown bit: 0 ++unknown bit: 0 ++unknown bit: 0 ++CustomBadge: 0 ++ObjctIsBusy: 0 ++unknown bit: 0 ++unknown bit: 0 ++unknown bit: 0 ++unknown bit: 0 ++RoutingInfo: 0 ++unknown bit: 0 ++unknown bit: 0 ++Rsvd|commnt: 0000 : 0 ++PutAway : 00000000 : 0 ++ ++-EA--------: ++pad : 0000 : .. ++magic : 41545452 : ATTR ++debug_tag : 53D4580C : 1406425100 ++total_size : 00000EE2 : 3810 ++data_start : 000000BC : 188 ++data_length: 0000005E : 94 ++reserved[0]: 00000000 : .... ++reserved[1]: 00000000 : .... ++reserved[2]: 00000000 : .... ++flags : 0000 : .. ++num_attrs : 0002 : 2 ++-EA ENTRY--: ++offset : 000000BC : 188 ++length : 0000005B : 91 ++flags : 0000 : .. ++namelen : 24 : 36 ++-EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) ++00000000 : 63 6F 6D 2E 61 70 70 6C 65 2E 6D 65 74 61 64 61 : com.apple.metada ++00000010 : 74 61 3A 5F 6B 4D 44 49 74 65 6D 55 73 65 72 54 : ta:_kMDItemUserT ++00000020 : 61 67 73 00 : ags. ++-EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) ++00000000 : 62 70 6C 69 73 74 30 30 A5 01 02 03 04 05 54 74 : bplist00......Tt ++00000010 : 65 73 74 66 00 47 00 72 00 FC 00 6E 00 0A 00 32 : estf.G.r...n...2 ++00000020 : 56 4C 69 6C 61 0A 33 56 47 65 6C 62 0A 35 56 42 : VLila.3VGelb.5VB ++00000030 : 6C 61 75 0A 34 08 0E 13 20 27 2E 00 00 00 00 00 : lau.4... '...... ++00000040 : 00 01 01 00 00 00 00 00 00 00 06 00 00 00 00 00 : ................ ++00000050 : 00 00 00 00 00 00 00 00 00 00 35 : ..........5 ++-EA ENTRY--: ++offset : 00000117 : 279 ++length : 00000003 : 3 ++flags : 0000 : .. ++namelen : 08 : 8 ++-EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) ++00000000 : 66 6F 6F 3A 62 61 72 00 : foo:bar. ++-EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) ++00000000 : 62 61 7A : baz ++ ++-RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) ++00000000 : 54 45 53 54 53 4C 4F 57 00 08 00 00 00 00 00 00 : TESTSLOW........ ++00000010 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++00000020 : 00 00 41 54 54 52 53 D4 58 0C 00 00 0E E2 00 00 : ..ATTRS.X....... ++00000030 : 00 BC 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 : .....^.......... ++00000040 : 00 00 00 00 00 02 00 00 00 BC 00 00 00 5B 00 00 : .............[.. ++00000050 : 24 63 6F 6D 2E 61 70 70 6C 65 2E 6D 65 74 61 64 : $com.apple.metad ++00000060 : 61 74 61 3A 5F 6B 4D 44 49 74 65 6D 55 73 65 72 : ata:_kMDItemUser ++00000070 : 54 61 67 73 00 00 00 00 01 17 00 00 00 03 00 00 : Tags............ ++00000080 : 08 66 6F 6F 3A 62 61 72 00 66 62 70 6C 69 73 74 : .foo:bar.fbplist ++00000090 : 30 30 A5 01 02 03 04 05 54 74 65 73 74 66 00 47 : 00......Ttestf.G ++000000A0 : 00 72 00 FC 00 6E 00 0A 00 32 56 4C 69 6C 61 0A : .r...n...2VLila. ++000000B0 : 33 56 47 65 6C 62 0A 35 56 42 6C 61 75 0A 34 08 : 3VGelb.5VBlau.4. ++000000C0 : 0E 13 20 27 2E 00 00 00 00 00 00 01 01 00 00 00 : .. '............ ++000000D0 : 00 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 : ................ ++000000E0 : 00 00 00 00 35 62 61 7A 00 00 00 00 00 00 00 00 : ....5baz........ ++000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++... all zeroes ... ++00000EA0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++ ++------------------------------------------------------------------------------- ++Entry ID : 00000002 : Resource Fork ++Offset : 00000EE2 : 3810 ++Length : 0000011E : 286 ++ ++-RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) ++00000000 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................ ++00000010 : F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF : This resource fo ++00000020 : 72 6B 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 6C 79 : rk intentionally ++00000030 : 20 6C 65 66 74 20 62 6C 61 6E 6B 20 20 20 00 00 : left blank .. ++00000040 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++00000050 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++00000060 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++00000070 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++00000080 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++00000090 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++000000A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++000000B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++000000C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++000000D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++000000E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ ++00000100 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................ ++00000110 : 00 00 00 00 00 00 00 00 00 1C 00 1E FF FF : .............. ++ ++It was created with: ++$ hexdump -ve '"\t" 7/1 "0x%02x, " 1/1 " 0x%02x," "\n"' ++*/ ++static char osx_adouble_non_empty_rfork_w_xattr[] = { ++ 0x00, 0x05, 0x16, 0x07, 0x00, 0x02, 0x00, 0x00, ++ 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58, ++ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, ++ 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, ++ 0x00, 0x32, 0x00, 0x00, 0x0e, 0xb0, 0x00, 0x00, ++ 0x00, 0x02, 0x00, 0x00, 0x0e, 0xe2, 0x00, 0x00, ++ 0x01, 0x1e, 0x54, 0x45, 0x53, 0x54, 0x53, 0x4c, ++ 0x4f, 0x57, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x41, 0x54, 0x54, 0x52, ++ 0x53, 0xd4, 0x58, 0x0c, 0x00, 0x00, 0x0e, 0xe2, ++ 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x5e, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, ++ 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x5b, ++ 0x00, 0x00, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x61, ++ 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x6d, 0x65, 0x74, ++ 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x5f, 0x6b, ++ 0x4d, 0x44, 0x49, 0x74, 0x65, 0x6d, 0x55, 0x73, ++ 0x65, 0x72, 0x54, 0x61, 0x67, 0x73, 0x00, 0x00, ++ 0x00, 0x00, 0x01, 0x17, 0x00, 0x00, 0x00, 0x03, ++ 0x00, 0x00, 0x08, 0x66, 0x6f, 0x6f, 0x3a, 0x62, ++ 0x61, 0x72, 0x00, 0x66, 0x62, 0x70, 0x6c, 0x69, ++ 0x73, 0x74, 0x30, 0x30, 0xa5, 0x01, 0x02, 0x03, ++ 0x04, 0x05, 0x54, 0x74, 0x65, 0x73, 0x74, 0x66, ++ 0x00, 0x47, 0x00, 0x72, 0x00, 0xfc, 0x00, 0x6e, ++ 0x00, 0x0a, 0x00, 0x32, 0x56, 0x4c, 0x69, 0x6c, ++ 0x61, 0x0a, 0x33, 0x56, 0x47, 0x65, 0x6c, 0x62, ++ 0x0a, 0x35, 0x56, 0x42, 0x6c, 0x61, 0x75, 0x0a, ++ 0x34, 0x08, 0x0e, 0x13, 0x20, 0x27, 0x2e, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0x62, ++ 0x61, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, ++ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x1e, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, ++ 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, ++ 0xfe, 0xff, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74, ++ 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, ++ 0x6c, 0x79, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20, ++ 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x20, 0x20, 0x20, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, ++ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1e, 0xff, 0xff ++}; ++ + /** + * talloc and intialize an AfpInfo + **/ +@@ -2082,8 +2742,11 @@ static bool test_adouble_conversion(struct torture_context *tctx, + NTSTATUS status; + struct smb2_handle testdirh; + bool ret = true; +- const char *data = "This resource fork intentionally left blank"; +- size_t datalen = strlen(data); ++ const char data[] = { ++ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, ++ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff ++ }; ++ size_t datalen = sizeof(data); + const char *streams[] = { + "::$DATA", + AFPINFO_STREAM, +@@ -2113,7 +2776,9 @@ static bool test_adouble_conversion(struct torture_context *tctx, + + ret = write_stream(tree, __location__, tctx, mem_ctx, + adname, NULL, +- 0, sizeof(osx_adouble_w_xattr), osx_adouble_w_xattr); ++ 0, ++ sizeof(osx_adouble_non_empty_rfork_w_xattr), ++ osx_adouble_non_empty_rfork_w_xattr); + torture_assert_goto(tctx, ret == true, ret, done, + "write_stream failed\n"); + +-- +2.21.0 + + +From 824a6bd86625611d79cec7c7aa7951c1537a843e Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Tue, 21 May 2019 18:39:52 +0200 +Subject: [PATCH 2/5] s4:torture/vfs/fruit: ensure + test_adouble_conversion_wo_xattr() uses a non-emtpy resourcefork + +This ensures the resource fork is not deleted as part of the AppleDouble file +conversion for the option fruit:wipe_intentionally_left_blank_rfork=yes. + +This is currently not a problem in selftest, as we don't enable the option, but +a subsequent commit will run all vfs.fruit tests against a share with this +option enabled. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit bb5a457f2872a383b58d62981dade322fca9b283) +--- + source4/torture/vfs/fruit.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c +index 1c0754af456..8e8731662fb 100644 +--- a/source4/torture/vfs/fruit.c ++++ b/source4/torture/vfs/fruit.c +@@ -902,7 +902,7 @@ static char osx_adouble_w_xattr[] = { + * + * -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) + * 00000000 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................ +- * 00000010 : 54 68 69 73 20 72 65 73 6F 75 72 63 65 20 66 6F : This resource fo ++ * 00000010 : F0 F1 F2 F3 F5 F5 F6 F7 F8 F9 FA FB FC FD FE FF : ................ + * 00000020 : 72 6B 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 6C 79 : rk intentionally + * 00000030 : 20 6C 65 66 74 20 62 6C 61 6E 6B 20 20 20 00 00 : left blank .. + * 00000040 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ +@@ -991,9 +991,9 @@ static char osx_adouble_without_xattr[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +- 0x00, 0x1e, 0x54, 0x68, 0x69, 0x73, 0x20, 0x72, +- 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, +- 0x66, 0x6f, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74, ++ 0x00, 0x1e, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, ++ 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, ++ 0xfe, 0xff, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x6c, 0x79, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20, + 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x20, 0x20, 0x20, +@@ -2833,8 +2833,11 @@ static bool test_adouble_conversion_wo_xattr(struct torture_context *tctx, + struct smb2_find find; + unsigned int count; + union smb_search_data *d; +- const char *data = "This resource fork intentionally left blank"; +- size_t datalen = strlen(data); ++ const char data[] = { ++ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, ++ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff ++ }; ++ size_t datalen = sizeof(data); + bool is_osx = torture_setting_bool(tctx, "osx", false); + + if (is_osx) { +-- +2.21.0 + + +From a648e79902108152f15998a0a5a236cecec80ad0 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Tue, 21 May 2019 14:05:04 +0200 +Subject: [PATCH 3/5] selftest: run vfs.fruit test against a share that deletes + empty resource forks + +This reveals a bug in the AppleDouble conversion code: the conversion code that +unlinks an empty resource fork AppleDouble sidecar file ("._file") gets +triggered as part of open_file_ntcreate(..., "file:AFP_AfpResource", ...): + +after SMB_VFS_OPEN() has been called with O_CREAT, what created the file, we +call SMB_VFS_FSTAT() on the just created filehandle. This ends up in +ad_convert(), finds the resource fork empty and thus deletes the file. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 8ed9b6b457923d2353d1d18838f4a278db48c6b9) +--- + selftest/knownfail.d/samba3.vfs.fruit | 13 +++++++++++++ + source3/selftest/tests.py | 1 + + 2 files changed, 14 insertions(+) + +diff --git a/selftest/knownfail.d/samba3.vfs.fruit b/selftest/knownfail.d/samba3.vfs.fruit +index 6307e2b3404..b1a28bedff6 100644 +--- a/selftest/knownfail.d/samba3.vfs.fruit ++++ b/selftest/knownfail.d/samba3.vfs.fruit +@@ -1,2 +1,15 @@ + ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\) + ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.copyfile\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.resource fork IO\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.SMB2/CREATE context AAPL\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.truncate resource fork to 0 bytes\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.opening and creating resource fork\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.create delete-on-close AFP_AfpResource\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.setinfo delete-on-close AFP_AfpResource\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.delete\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.read open rsrc after rename\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.readdir_attr with names with illegal ntfs characters\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.copy-chunk streams\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.empty_stream\(nt4_dc\) ++^samba3.vfs.fruit fruit_delete_empty_adfiles.setinfo eof AFP_AfpResource\(nt4_dc\) +diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py +index 7067abc5fb4..1db806ef887 100755 +--- a/source3/selftest/tests.py ++++ b/source3/selftest/tests.py +@@ -595,6 +595,7 @@ tests = base + raw + smb2 + rpc + unix + local + rap + nbt + libsmbclient + idma + plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit', 'metadata_netatalk') + plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_metadata_stream -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit', 'metadata_stream') + plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_stream_depot -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit_stream_depot', 'streams_depot') ++ plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_delete_empty_adfiles -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit', 'fruit_delete_empty_adfiles') + elif t == "vfs.fruit_netatalk": + plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_xattr -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share') + elif t == "vfs.fruit_timemachine": +-- +2.21.0 + + +From e5185fa8b4ae25a60557a014d3c30ee4bd6bbaff Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Tue, 21 May 2019 16:00:00 +0200 +Subject: [PATCH 4/5] vfs_fruit: add a forward declaration for ad_get() + +Will be needed in the next commit. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 4777d1163a7c18c89ce9be955903427a18134415) +--- + source3/modules/vfs_fruit.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index f54038f53d4..b74d26ca711 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -535,6 +535,10 @@ struct fio { + */ + static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle, + adouble_type_t type); ++static struct adouble *ad_get(TALLOC_CTX *ctx, ++ vfs_handle_struct *handle, ++ const struct smb_filename *smb_fname, ++ adouble_type_t type); + static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname); + static int ad_fset(struct adouble *ad, files_struct *fsp); + static int adouble_path(TALLOC_CTX *ctx, +-- +2.21.0 + + +From d95745e8603906d105ec6cd12bc91a62d62fef6c Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Tue, 21 May 2019 16:00:53 +0200 +Subject: [PATCH 5/5] vfs_fruit: change trigger points of AppleDouble + conversion + +This moves the trigger points where AppleDouble file conversion is run by +ad_convert() from deep down the callchain in ad_read_rsrc_adouble() to high +level VFS entry points. + +Currently ad_convert() will be triggered as part of open_file_ntcreate(..., +"file:AFP_AfpResource", ...): after SMB_VFS_OPEN() has been called with O_CREAT, +what created the file, we call SMB_VFS_FSTAT() on the just created +filehandle. This ends up in ad_convert(), finds the resource fork empty and thus +deletes the file. + +This commit moves calling of the conversion funtion to the high level VFS entry +points where the converted metadata is needed: + +o for directory enumerations SMB_VFS_READDIR_ATTR() is called to fill in the + repurposed fields in the directory entry metadata + +o obviously for SMB_VFS_CREATE_FILE() on an macOS stream + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 78a4639b2d06cc69788861618d2e91945e142d2b) +--- + selftest/knownfail.d/samba3.vfs.fruit | 13 ------ + source3/modules/vfs_fruit.c | 61 ++++++++++++++++++--------- + 2 files changed, 40 insertions(+), 34 deletions(-) + +diff --git a/selftest/knownfail.d/samba3.vfs.fruit b/selftest/knownfail.d/samba3.vfs.fruit +index b1a28bedff6..6307e2b3404 100644 +--- a/selftest/knownfail.d/samba3.vfs.fruit ++++ b/selftest/knownfail.d/samba3.vfs.fruit +@@ -1,15 +1,2 @@ + ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\) + ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.copyfile\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.resource fork IO\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.SMB2/CREATE context AAPL\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.truncate resource fork to 0 bytes\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.opening and creating resource fork\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.create delete-on-close AFP_AfpResource\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.setinfo delete-on-close AFP_AfpResource\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.delete\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.read open rsrc after rename\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.readdir_attr with names with illegal ntfs characters\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.copy-chunk streams\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.empty_stream\(nt4_dc\) +-^samba3.vfs.fruit fruit_delete_empty_adfiles.setinfo eof AFP_AfpResource\(nt4_dc\) +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index b74d26ca711..be85c9f5412 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1450,27 +1450,37 @@ static bool ad_convert_delete_adfile(struct adouble *ad, + * @return -1 in case an error occurred, 0 if no conversion was done, 1 + * otherwise + **/ +-static int ad_convert(struct adouble *ad, ++static int ad_convert(struct vfs_handle_struct *handle, + const struct smb_filename *smb_fname) + { ++ struct adouble *ad = NULL; + bool ok; + bool converted_xattr = false; + bool blank; ++ int ret; ++ ++ ad = ad_get(talloc_tos(), handle, smb_fname, ADOUBLE_RSRC); ++ if (ad == NULL) { ++ return 0; ++ } + + ok = ad_convert_xattr(ad, smb_fname, &converted_xattr); + if (!ok) { +- return -1; ++ ret = -1; ++ goto done; + } + + ok = ad_convert_blank_rfork(ad, &blank); + if (!ok) { +- return -1; ++ ret = -1; ++ goto done; + } + + if (converted_xattr || blank) { + ok = ad_convert_truncate(ad, smb_fname); + if (!ok) { +- return -1; ++ ret = -1; ++ goto done; + } + } + +@@ -1478,15 +1488,20 @@ static int ad_convert(struct adouble *ad, + if (!ok) { + DBG_ERR("Failed to convert [%s]\n", + smb_fname_str_dbg(smb_fname)); +- return -1; ++ ret = -1; ++ goto done; + } + + ok = ad_convert_delete_adfile(ad, smb_fname); + if (!ok) { +- return -1; ++ ret = -1; ++ goto done; + } + +- return 0; ++ ret = 0; ++done: ++ TALLOC_FREE(ad); ++ return ret; + } + + /** +@@ -1739,17 +1754,6 @@ static ssize_t ad_read_rsrc_adouble(struct adouble *ad, + return -1; + } + +- /* +- * Try to fixup AppleDouble files created by OS X with xattrs +- * appended to the ADEID_FINDERI entry. +- */ +- +- ret = ad_convert(ad, smb_fname); +- if (ret != 0) { +- DBG_WARNING("Failed to convert [%s]\n", smb_fname->base_name); +- return len; +- } +- + return len; + } + +@@ -2137,9 +2141,8 @@ static bool is_afpresource_stream(const struct smb_filename *smb_fname) + } + + /** +- * Test whether stream is an Apple stream, not used atm ++ * Test whether stream is an Apple stream. + **/ +-#if 0 + static bool is_apple_stream(const struct smb_filename *smb_fname) + { + if (is_afpinfo_stream(smb_fname)) { +@@ -2150,7 +2153,6 @@ static bool is_apple_stream(const struct smb_filename *smb_fname) + } + return false; + } +-#endif + + /** + * Initialize config struct from our smb.conf config parameters +@@ -6051,6 +6053,8 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle, + struct fruit_config_data *config = NULL; + files_struct *fsp = NULL; + struct fio *fio = NULL; ++ bool internal_open = (oplock_request & INTERNAL_OPEN_ONLY); ++ int ret; + + status = check_aapl(handle, req, in_context_blobs, out_context_blobs); + if (!NT_STATUS_IS_OK(status)) { +@@ -6060,6 +6064,14 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle, + SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data, + return NT_STATUS_UNSUCCESSFUL); + ++ if (is_apple_stream(smb_fname) && !internal_open) { ++ ret = ad_convert(handle, smb_fname); ++ if (ret != 0) { ++ DBG_ERR("ad_convert() failed\n"); ++ return NT_STATUS_UNSUCCESSFUL; ++ } ++ } ++ + status = SMB_VFS_NEXT_CREATE_FILE( + handle, req, root_dir_fid, smb_fname, + access_mask, share_access, +@@ -6142,6 +6154,7 @@ static NTSTATUS fruit_readdir_attr(struct vfs_handle_struct *handle, + struct fruit_config_data *config = NULL; + struct readdir_attr_data *attr_data; + NTSTATUS status; ++ int ret; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct fruit_config_data, +@@ -6153,6 +6166,12 @@ static NTSTATUS fruit_readdir_attr(struct vfs_handle_struct *handle, + + DEBUG(10, ("fruit_readdir_attr %s\n", fname->base_name)); + ++ ret = ad_convert(handle, fname); ++ if (ret != 0) { ++ DBG_ERR("ad_convert() failed\n"); ++ return NT_STATUS_UNSUCCESSFUL; ++ } ++ + *pattr_data = talloc_zero(mem_ctx, struct readdir_attr_data); + if (*pattr_data == NULL) { + return NT_STATUS_UNSUCCESSFUL; +-- +2.21.0 + +From 99b63b4e720122ef9cbb8155c8cc73a1f2613650 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 10:41:29 +0200 +Subject: [PATCH 01/31] vfs_fruit: pass handle to ad_fset() + +On the course of removing ad_handle from struct adouble, step 1. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 585d4d49770b4ddc3f7d9dcbb3e322f072767781) +--- + source3/modules/vfs_fruit.c | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index be85c9f5412..bef9bac2036 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -540,7 +540,9 @@ static struct adouble *ad_get(TALLOC_CTX *ctx, + const struct smb_filename *smb_fname, + adouble_type_t type); + static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname); +-static int ad_fset(struct adouble *ad, files_struct *fsp); ++static int ad_fset(struct vfs_handle_struct *handle, ++ struct adouble *ad, ++ files_struct *fsp); + static int adouble_path(TALLOC_CTX *ctx, + const struct smb_filename *smb_fname__in, + struct smb_filename **ppsmb_fname_out); +@@ -2065,7 +2067,9 @@ static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname) + * + * @return status code, 0 means success + **/ +-static int ad_fset(struct adouble *ad, files_struct *fsp) ++static int ad_fset(struct vfs_handle_struct *handle, ++ struct adouble *ad, ++ files_struct *fsp) + { + int rc = -1; + ssize_t len; +@@ -2087,7 +2091,7 @@ static int ad_fset(struct adouble *ad, files_struct *fsp) + + switch (ad->ad_type) { + case ADOUBLE_META: +- rc = SMB_VFS_NEXT_SETXATTR(ad->ad_handle, ++ rc = SMB_VFS_NEXT_SETXATTR(handle, + fsp->fsp_name, + AFPINFO_EA_NETATALK, + ad->ad_data, +@@ -2095,7 +2099,7 @@ static int ad_fset(struct adouble *ad, files_struct *fsp) + break; + + case ADOUBLE_RSRC: +- len = SMB_VFS_NEXT_PWRITE(ad->ad_handle, ++ len = SMB_VFS_NEXT_PWRITE(handle, + fsp, + ad->ad_data, + AD_DATASZ_DOT_UND, +@@ -3588,7 +3592,7 @@ static int fruit_open_rsrc_adouble(vfs_handle_struct *handle, + + fsp->fh->fd = hostfd; + +- rc = ad_fset(ad, fsp); ++ rc = ad_fset(handle, ad, fsp); + fsp->fh->fd = -1; + if (rc != 0) { + rc = -1; +@@ -4676,7 +4680,7 @@ static ssize_t fruit_pwrite_meta_netatalk(vfs_handle_struct *handle, + + memcpy(p, &ai->afpi_FinderInfo[0], ADEDLEN_FINDERI); + +- ret = ad_fset(ad, fsp); ++ ret = ad_fset(handle, ad, fsp); + if (ret != 0) { + DBG_ERR("ad_pwrite [%s] failed\n", fsp_str_dbg(fsp)); + TALLOC_FREE(ad); +@@ -4832,7 +4836,7 @@ static ssize_t fruit_pwrite_rsrc_adouble(vfs_handle_struct *handle, + + if ((n + offset) > ad_getentrylen(ad, ADEID_RFORK)) { + ad_setentrylen(ad, ADEID_RFORK, n + offset); +- ret = ad_fset(ad, fsp); ++ ret = ad_fset(handle, ad, fsp); + if (ret != 0) { + DBG_ERR("ad_pwrite [%s] failed\n", fsp_str_dbg(fsp)); + TALLOC_FREE(ad); +@@ -5934,7 +5938,7 @@ static int fruit_ftruncate_rsrc_adouble(struct vfs_handle_struct *handle, + + ad_setentrylen(ad, ADEID_RFORK, offset); + +- rc = ad_fset(ad, fsp); ++ rc = ad_fset(handle, ad, fsp); + if (rc != 0) { + DBG_ERR("ad_fset [%s] failed [%s]\n", + fsp_str_dbg(fsp), strerror(errno)); +-- +2.21.0 + + +From aa457fc63f493208ef85d833e5764f84578f5858 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 10:43:55 +0200 +Subject: [PATCH 02/31] vfs_fruit: pass handle to ad_set() + +On the course of removing ad_handle from struct adouble, step 2. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit c78ba30ac4534b7037b979ac96b77b834b2eb2fe) +--- + source3/modules/vfs_fruit.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index bef9bac2036..cb87396b9b2 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -539,7 +539,9 @@ static struct adouble *ad_get(TALLOC_CTX *ctx, + vfs_handle_struct *handle, + const struct smb_filename *smb_fname, + adouble_type_t type); +-static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname); ++static int ad_set(vfs_handle_struct *handle, ++ struct adouble *ad, ++ const struct smb_filename *smb_fname); + static int ad_fset(struct vfs_handle_struct *handle, + struct adouble *ad, + files_struct *fsp); +@@ -2030,7 +2032,9 @@ static struct adouble *ad_fget(TALLOC_CTX *ctx, vfs_handle_struct *handle, + * + * @return status code, 0 means success + **/ +-static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname) ++static int ad_set(vfs_handle_struct *handle, ++ struct adouble *ad, ++ const struct smb_filename *smb_fname) + { + bool ok; + int ret; +@@ -2048,7 +2052,7 @@ static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname) + return -1; + } + +- ret = SMB_VFS_SETXATTR(ad->ad_handle->conn, ++ ret = SMB_VFS_SETXATTR(handle->conn, + smb_fname, + AFPINFO_EA_NETATALK, + ad->ad_data, +@@ -5874,7 +5878,7 @@ static int fruit_ntimes(vfs_handle_struct *handle, + ad_setdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, + convert_time_t_to_uint32_t(ft->create_time.tv_sec)); + +- rc = ad_set(ad, smb_fname); ++ rc = ad_set(handle, ad, smb_fname); + + exit: + +-- +2.21.0 + + +From c045cf398f4b59112539000fe629d89ff7d3bbc3 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 11:19:53 +0200 +Subject: [PATCH 03/31] vfs_fruit: pass handle to ad_read() + +On the course of removing ad_handle from struct adouble, step 3. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit d0abf945e683766029d28915541a4baf9f3879ab) +--- + source3/modules/vfs_fruit.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index cb87396b9b2..7e1d27476aa 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1785,7 +1785,9 @@ static ssize_t ad_read_rsrc(struct adouble *ad, + /** + * Read and unpack an AppleDouble metadata xattr or resource + **/ +-static ssize_t ad_read(struct adouble *ad, const struct smb_filename *smb_fname) ++static ssize_t ad_read(vfs_handle_struct *handle, ++ struct adouble *ad, ++ const struct smb_filename *smb_fname) + { + switch (ad->ad_type) { + case ADOUBLE_META: +@@ -1970,7 +1972,7 @@ static struct adouble *ad_get_internal(TALLOC_CTX *ctx, + + } + +- len = ad_read(ad, smb_fname); ++ len = ad_read(handle, ad, smb_fname); + if (len == -1) { + DEBUG(10, ("error reading AppleDouble for %s\n", + smb_fname->base_name)); +-- +2.21.0 + + +From ac757c82574c0434e2a0afc94a30571437dd4ee2 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 11:22:24 +0200 +Subject: [PATCH 04/31] vfs_fruit: pass handle to ad_read_meta() + +On the course of removing ad_handle from struct adouble, step 4. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit f8df09157f31b53dbe73eaf4349fc071bfcc1b90) +--- + source3/modules/vfs_fruit.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 7e1d27476aa..fab361164ac 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1511,7 +1511,8 @@ static int ad_convert(struct vfs_handle_struct *handle, + /** + * Read and parse Netatalk AppleDouble metadata xattr + **/ +-static ssize_t ad_read_meta(struct adouble *ad, ++static ssize_t ad_read_meta(vfs_handle_struct *handle, ++ struct adouble *ad, + const struct smb_filename *smb_fname) + { + int rc = 0; +@@ -1520,7 +1521,7 @@ static ssize_t ad_read_meta(struct adouble *ad, + + DEBUG(10, ("reading meta xattr for %s\n", smb_fname->base_name)); + +- ealen = SMB_VFS_GETXATTR(ad->ad_handle->conn, smb_fname, ++ ealen = SMB_VFS_GETXATTR(handle->conn, smb_fname, + AFPINFO_EA_NETATALK, ad->ad_data, + AD_DATASZ_XATTR); + if (ealen == -1) { +@@ -1791,7 +1792,7 @@ static ssize_t ad_read(vfs_handle_struct *handle, + { + switch (ad->ad_type) { + case ADOUBLE_META: +- return ad_read_meta(ad, smb_fname); ++ return ad_read_meta(handle, ad, smb_fname); + case ADOUBLE_RSRC: + return ad_read_rsrc(ad, smb_fname); + default: +-- +2.21.0 + + +From b802829d7648fce8e6641633f02f62e494d67eb9 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 11:23:17 +0200 +Subject: [PATCH 05/31] vfs_fruit: indentation fix + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 47721d8d359ef78b8dd4f77f92c30c2caf2c4a80) +--- + source3/modules/vfs_fruit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index fab361164ac..1e9ab4f615f 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1513,7 +1513,7 @@ static int ad_convert(struct vfs_handle_struct *handle, + **/ + static ssize_t ad_read_meta(vfs_handle_struct *handle, + struct adouble *ad, +- const struct smb_filename *smb_fname) ++ const struct smb_filename *smb_fname) + { + int rc = 0; + ssize_t ealen; +-- +2.21.0 + + +From 297ee52a9c6e1b5808d68cacd0b3c972bf7b7313 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 11:42:06 +0200 +Subject: [PATCH 06/31] vfs_fruit: use proper VFS function in ad_read_meta() + +Continuing to ignore a possible error for now, this is in an error codepath +anyway. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 30ca328c698c2e035e240359bda7c9dcbeb646df) +--- + source3/modules/vfs_fruit.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 1e9ab4f615f..046fa2da2e2 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1578,7 +1578,9 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle, + ealen = -1; + if (errno == EINVAL) { + become_root(); +- removexattr(smb_fname->base_name, AFPINFO_EA_NETATALK); ++ (void)SMB_VFS_REMOVEXATTR(handle->conn, ++ smb_fname, ++ AFPINFO_EA_NETATALK); + unbecome_root(); + errno = ENOENT; + } +-- +2.21.0 + + +From d515ff9c7cc6f5b8a6863362d78af5911afec985 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 11:47:26 +0200 +Subject: [PATCH 07/31] vfs_fruit: pass handle to ad_read_rsrc() and all the + way down + +On the course of removing ad_handle from struct adouble, step 5. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 661dfa4a19673fdb30d5bf36279cdf867454b947) +--- + source3/modules/vfs_fruit.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 046fa2da2e2..0bcf67c5834 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1682,7 +1682,8 @@ static int ad_open(vfs_handle_struct *handle, + return 0; + } + +-static ssize_t ad_read_rsrc_xattr(struct adouble *ad) ++static ssize_t ad_read_rsrc_xattr(vfs_handle_struct *handle, ++ struct adouble *ad) + { + int ret; + SMB_STRUCT_STAT st; +@@ -1690,7 +1691,7 @@ static ssize_t ad_read_rsrc_xattr(struct adouble *ad) + /* FIXME: direct sys_fstat(), don't have an fsp */ + ret = sys_fstat(ad->ad_fd, &st, + lp_fake_directory_create_times( +- SNUM(ad->ad_handle->conn))); ++ SNUM(handle->conn))); + if (ret != 0) { + return -1; + } +@@ -1699,7 +1700,8 @@ static ssize_t ad_read_rsrc_xattr(struct adouble *ad) + return st.st_ex_size; + } + +-static ssize_t ad_read_rsrc_adouble(struct adouble *ad, ++static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, ++ struct adouble *ad, + const struct smb_filename *smb_fname) + { + SMB_STRUCT_STAT sbuf; +@@ -1710,7 +1712,7 @@ static ssize_t ad_read_rsrc_adouble(struct adouble *ad, + bool ok; + + ret = sys_fstat(ad->ad_fd, &sbuf, lp_fake_directory_create_times( +- SNUM(ad->ad_handle->conn))); ++ SNUM(handle->conn))); + if (ret != 0) { + return -1; + } +@@ -1767,19 +1769,20 @@ static ssize_t ad_read_rsrc_adouble(struct adouble *ad, + /** + * Read and parse resource fork, either ._ AppleDouble file or xattr + **/ +-static ssize_t ad_read_rsrc(struct adouble *ad, ++static ssize_t ad_read_rsrc(vfs_handle_struct *handle, ++ struct adouble *ad, + const struct smb_filename *smb_fname) + { + struct fruit_config_data *config = NULL; + ssize_t len; + +- SMB_VFS_HANDLE_GET_DATA(ad->ad_handle, config, ++ SMB_VFS_HANDLE_GET_DATA(handle, config, + struct fruit_config_data, return -1); + + if (config->rsrc == FRUIT_RSRC_XATTR) { +- len = ad_read_rsrc_xattr(ad); ++ len = ad_read_rsrc_xattr(handle, ad); + } else { +- len = ad_read_rsrc_adouble(ad, smb_fname); ++ len = ad_read_rsrc_adouble(handle, ad, smb_fname); + } + + return len; +@@ -1796,7 +1799,7 @@ static ssize_t ad_read(vfs_handle_struct *handle, + case ADOUBLE_META: + return ad_read_meta(handle, ad, smb_fname); + case ADOUBLE_RSRC: +- return ad_read_rsrc(ad, smb_fname); ++ return ad_read_rsrc(handle, ad, smb_fname); + default: + return -1; + } +-- +2.21.0 + + +From cda7ebf61991a8640b696916d0769f965af325b5 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 11:23:17 +0200 +Subject: [PATCH 08/31] vfs_fruit: indentation fix + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 400b3c2f8c82b1defe1e321e0cdae486b930344f) +--- + source3/modules/vfs_fruit.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 0bcf67c5834..c649710d754 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1702,7 +1702,7 @@ static ssize_t ad_read_rsrc_xattr(vfs_handle_struct *handle, + + static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, + struct adouble *ad, +- const struct smb_filename *smb_fname) ++ const struct smb_filename *smb_fname) + { + SMB_STRUCT_STAT sbuf; + char *p_ad = NULL; +@@ -1771,7 +1771,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, + **/ + static ssize_t ad_read_rsrc(vfs_handle_struct *handle, + struct adouble *ad, +- const struct smb_filename *smb_fname) ++ const struct smb_filename *smb_fname) + { + struct fruit_config_data *config = NULL; + ssize_t len; +-- +2.21.0 + + +From 796677632779f18cecb51209a4892de0ac6db84b Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 11:54:10 +0200 +Subject: [PATCH 09/31] vfs_fruit: pass handle to ad_convert_xattr() + +On the course of removing ad_handle from struct adouble, step 7. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit fd2f4cf828ee4c31e3b5a27a79d3a0ee12a5877a) +--- + source3/modules/vfs_fruit.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index c649710d754..0b58cf1a1e5 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1057,7 +1057,8 @@ static bool ad_convert_move_reso(struct adouble *ad, + return true; + } + +-static bool ad_convert_xattr(struct adouble *ad, ++static bool ad_convert_xattr(vfs_handle_struct *handle, ++ struct adouble *ad, + const struct smb_filename *smb_fname, + bool *converted_xattr) + { +@@ -1108,7 +1109,7 @@ static bool ad_convert_xattr(struct adouble *ad, + files_struct *fsp = NULL; + ssize_t nwritten; + +- status = string_replace_allocate(ad->ad_handle->conn, ++ status = string_replace_allocate(handle->conn, + e->adx_name, + string_replace_cmaps, + talloc_tos(), +@@ -1145,7 +1146,7 @@ static bool ad_convert_xattr(struct adouble *ad, + DBG_DEBUG("stream_name: %s\n", smb_fname_str_dbg(stream_name)); + + status = SMB_VFS_CREATE_FILE( +- ad->ad_handle->conn, /* conn */ ++ handle->conn, /* conn */ + NULL, /* req */ + 0, /* root_dir_fid */ + stream_name, /* fname */ +@@ -1468,7 +1469,7 @@ static int ad_convert(struct vfs_handle_struct *handle, + return 0; + } + +- ok = ad_convert_xattr(ad, smb_fname, &converted_xattr); ++ ok = ad_convert_xattr(handle, ad, smb_fname, &converted_xattr); + if (!ok) { + ret = -1; + goto done; +-- +2.21.0 + + +From ebae25734342988d6fcbe0489b4264455c27c97b Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 12:02:46 +0200 +Subject: [PATCH 10/31] vfs_fruit: pass handle to ad_convert_blank_rfork() + +On the course of removing ad_handle from struct adouble, step 8. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit adc7ac38b849b4dce4a85fd6442c8d4b9da57686) +--- + source3/modules/vfs_fruit.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 0b58cf1a1e5..80a647dc847 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1345,7 +1345,8 @@ static bool ad_convert_truncate(struct adouble *ad, + return true; + } + +-static bool ad_convert_blank_rfork(struct adouble *ad, ++static bool ad_convert_blank_rfork(vfs_handle_struct *handle, ++ struct adouble *ad, + bool *blank) + { + struct fruit_config_data *config = NULL; +@@ -1358,7 +1359,7 @@ static bool ad_convert_blank_rfork(struct adouble *ad, + + *blank = false; + +- SMB_VFS_HANDLE_GET_DATA(ad->ad_handle, config, ++ SMB_VFS_HANDLE_GET_DATA(handle, config, + struct fruit_config_data, return false); + + if (!config->wipe_intentionally_left_blank_rfork) { +@@ -1475,7 +1476,7 @@ static int ad_convert(struct vfs_handle_struct *handle, + goto done; + } + +- ok = ad_convert_blank_rfork(ad, &blank); ++ ok = ad_convert_blank_rfork(handle, ad, &blank); + if (!ok) { + ret = -1; + goto done; +-- +2.21.0 + + +From 203ef7c510f358c76aa7e582b6b7c519b4154e06 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 12:05:07 +0200 +Subject: [PATCH 11/31] vfs_fruit: pass handle to ad_convert_finderinfo() + +On the course of removing ad_handle from struct adouble, step 9. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 50874c1548d62ab0ddaaa6dd4124279ee5029fcf) +--- + source3/modules/vfs_fruit.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 80a647dc847..eb6137202a7 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1225,7 +1225,8 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, + return ok; + } + +-static bool ad_convert_finderinfo(struct adouble *ad, ++static bool ad_convert_finderinfo(vfs_handle_struct *handle, ++ struct adouble *ad, + const struct smb_filename *smb_fname) + { + char *p_ad = NULL; +@@ -1282,7 +1283,7 @@ static bool ad_convert_finderinfo(struct adouble *ad, + DBG_DEBUG("stream_name: %s\n", smb_fname_str_dbg(stream_name)); + + status = SMB_VFS_CREATE_FILE( +- ad->ad_handle->conn, /* conn */ ++ handle->conn, /* conn */ + NULL, /* req */ + 0, /* root_dir_fid */ + stream_name, /* fname */ +@@ -1490,7 +1491,7 @@ static int ad_convert(struct vfs_handle_struct *handle, + } + } + +- ok = ad_convert_finderinfo(ad, smb_fname); ++ ok = ad_convert_finderinfo(handle, ad, smb_fname); + if (!ok) { + DBG_ERR("Failed to convert [%s]\n", + smb_fname_str_dbg(smb_fname)); +-- +2.21.0 + + +From 6701abc1b2c68df2e134e5e7257c386fd35ea9fe Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 12:17:28 +0200 +Subject: [PATCH 12/31] vfs_fruit: pass handle to ad_convert_delete_adfile() + +On the course of removing ad_handle from struct adouble, step 10. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 5f4d16b40e07acf8d27fee62f1a56de175663a1d) +--- + source3/modules/vfs_fruit.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index eb6137202a7..38bfa5e2b6b 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1411,7 +1411,8 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle, + return true; + } + +-static bool ad_convert_delete_adfile(struct adouble *ad, ++static bool ad_convert_delete_adfile(vfs_handle_struct *handle, ++ struct adouble *ad, + const struct smb_filename *smb_fname) + { + struct fruit_config_data *config = NULL; +@@ -1422,7 +1423,7 @@ static bool ad_convert_delete_adfile(struct adouble *ad, + return true; + } + +- SMB_VFS_HANDLE_GET_DATA(ad->ad_handle, config, ++ SMB_VFS_HANDLE_GET_DATA(handle, config, + struct fruit_config_data, return false); + + if (!config->delete_empty_adfiles) { +@@ -1434,7 +1435,7 @@ static bool ad_convert_delete_adfile(struct adouble *ad, + return false; + } + +- rc = SMB_VFS_NEXT_UNLINK(ad->ad_handle, ad_name); ++ rc = SMB_VFS_NEXT_UNLINK(handle, ad_name); + if (rc != 0) { + DBG_ERR("Unlinking [%s] failed: %s\n", + smb_fname_str_dbg(ad_name), strerror(errno)); +@@ -1499,7 +1500,7 @@ static int ad_convert(struct vfs_handle_struct *handle, + goto done; + } + +- ok = ad_convert_delete_adfile(ad, smb_fname); ++ ok = ad_convert_delete_adfile(handle, ad, smb_fname); + if (!ok) { + ret = -1; + goto done; +-- +2.21.0 + + +From 6f953506ef2704ffc3c99cc492dfeb739128e5a8 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 12:19:06 +0200 +Subject: [PATCH 13/31] vfs_fruit: finally, remove ad_handle from struct + adouble + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit e266daaed149561b746dbb8d5e9523862f0057b5) +--- + source3/modules/vfs_fruit.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 38bfa5e2b6b..e79b548a511 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -411,7 +411,6 @@ struct ad_entry { + }; + + struct adouble { +- vfs_handle_struct *ad_handle; + int ad_fd; + bool ad_opened; + adouble_type_t ad_type; +@@ -1868,7 +1867,6 @@ static struct adouble *ad_alloc(TALLOC_CTX *ctx, vfs_handle_struct *handle, + } + } + +- ad->ad_handle = handle; + ad->ad_type = type; + ad->ad_magic = AD_MAGIC; + ad->ad_version = AD_VERSION; +-- +2.21.0 + + +From 42f996a6983d0a2895bf49778446e6238b5bac10 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Tue, 21 May 2019 11:39:18 +0200 +Subject: [PATCH 14/31] vfs_fruit: add and use is_adouble_file() + +This adds a helper function that checks whether the last component of a path is +an AppleDouble sidecar file with "._" name prefix. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit ad70c947c759aa0965ee57f973fb8dc1909e0e39) +--- + source3/modules/vfs_fruit.c | 27 ++++++++++++++++++++++----- + 1 file changed, 22 insertions(+), 5 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index e79b548a511..0dd24293c9b 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -2172,6 +2172,27 @@ static bool is_apple_stream(const struct smb_filename *smb_fname) + return false; + } + ++static bool is_adouble_file(const char *path) ++{ ++ const char *p = NULL; ++ int match; ++ ++ p = strrchr(path, '/'); ++ if (p == NULL) { ++ p = path; ++ } else { ++ p++; ++ } ++ ++ match = strncmp(p, ++ ADOUBLE_NAME_PREFIX, ++ strlen(ADOUBLE_NAME_PREFIX)); ++ if (match != 0) { ++ return false; ++ } ++ return true; ++} ++ + /** + * Initialize config struct from our smb.conf config parameters + **/ +@@ -4204,16 +4225,12 @@ static int fruit_rmdir(struct vfs_handle_struct *handle, + } + + while ((de = SMB_VFS_READDIR(handle->conn, dh, NULL)) != NULL) { +- int match; + struct adouble *ad = NULL; + char *p = NULL; + struct smb_filename *ad_smb_fname = NULL; + int ret; + +- match = strncmp(de->d_name, +- ADOUBLE_NAME_PREFIX, +- strlen(ADOUBLE_NAME_PREFIX)); +- if (match != 0) { ++ if (!is_adouble_file(de->d_name)) { + continue; + } + +-- +2.21.0 + + +From 12c65cc8aa37440c7e549da876564ff5cd47220b Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Tue, 21 May 2019 11:40:33 +0200 +Subject: [PATCH 15/31] vfs_fruit: add a missing else + +Luckily the missing else has the same control flow due to the previous if and +else blocks calling return. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 44d8568001c87d28962dfc4e3fde6d0f7f409997) +--- + source3/modules/vfs_fruit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 0dd24293c9b..c7cb4cdba7d 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -4079,7 +4079,7 @@ static int fruit_unlink(vfs_handle_struct *handle, + return fruit_unlink_meta(handle, smb_fname); + } else if (is_afpresource_stream(smb_fname)) { + return fruit_unlink_rsrc(handle, smb_fname, false); +- } if (is_ntfs_stream_smb_fname(smb_fname)) { ++ } else if (is_ntfs_stream_smb_fname(smb_fname)) { + return SMB_VFS_NEXT_UNLINK(handle, smb_fname); + } + +-- +2.21.0 + + +From 359fae9e2e0ef599d6778c65fcb3355d0bf5a8a0 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Tue, 21 May 2019 11:42:47 +0200 +Subject: [PATCH 16/31] vfs_fruit: ignore AppleDouble files in fruit_unlink() + +Otherwise, if SMB_VFS_UNLINK() is called for an AppleDouble path "._file", we +try to delete "._._file" which doesn't make sense. AppleDouble files don't have +AppleDouble themselves. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 797dc649456f39add4af8b54b60db0268ad4e90e) +--- + source3/modules/vfs_fruit.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index c7cb4cdba7d..e7e14673e10 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -4081,6 +4081,8 @@ static int fruit_unlink(vfs_handle_struct *handle, + return fruit_unlink_rsrc(handle, smb_fname, false); + } else if (is_ntfs_stream_smb_fname(smb_fname)) { + return SMB_VFS_NEXT_UNLINK(handle, smb_fname); ++ } else if (is_adouble_file(smb_fname->base_name)) { ++ return SMB_VFS_NEXT_UNLINK(handle, smb_fname); + } + + /* +-- +2.21.0 + + +From 39bccb6c88eb19b6abcf3d49f72ae73bec1d6af6 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Wed, 22 May 2019 17:02:20 +0200 +Subject: [PATCH 17/31] vfs_fruit: use correct case FRUIT_RSRC_STREAM in + readdir_attr_rfork_size() + +This is a genuine bug, but luckily this would only impact configs which nobody +uses: + + fruit:metadata = netatalk + fruit:resource = stream + +With the above configuration the switch in readdir_attr_rfork_size() would hit +the default case and so always report resource forks as 0 bytes in size. + +All deployment that I've seen that use fruit:resource=stream also use +fruit:metadata=stream, so the switch takes FRUIT_META_STREAM case which runs the +correct code readdir_attr_rfork_size_stream(). + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 83179a74119de84d20f796c241aae6bccb83a68b) +--- + source3/modules/vfs_fruit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index e7e14673e10..96a026acbf8 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -3223,7 +3223,7 @@ static uint64_t readdir_attr_rfork_size(struct vfs_handle_struct *handle, + smb_fname); + break; + +- case FRUIT_META_STREAM: ++ case FRUIT_RSRC_STREAM: + rfork_size = readdir_attr_rfork_size_stream(handle, + smb_fname); + break; +-- +2.21.0 + + +From 4f611e9da46c49a5be3a0b7c491b23c9c5084526 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Wed, 22 May 2019 18:08:14 +0200 +Subject: [PATCH 18/31] vfs_fruit: use stream code for resource fork size + calculation in readdir_attr_rfork_size() + +This works as well, using an fstat() on the filehandle to get the size. This is +tested by the torture test "vfs.fruit.SMB2/CREATE context AAPL". + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit a23bcc1916a49bf3e0edece190e5434e39862d2c) +--- + source3/modules/vfs_fruit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 96a026acbf8..82c20dbea13 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -3218,11 +3218,11 @@ static uint64_t readdir_attr_rfork_size(struct vfs_handle_struct *handle, + + switch (config->rsrc) { + case FRUIT_RSRC_ADFILE: +- case FRUIT_RSRC_XATTR: + rfork_size = readdir_attr_rfork_size_adouble(handle, + smb_fname); + break; + ++ case FRUIT_RSRC_XATTR: + case FRUIT_RSRC_STREAM: + rfork_size = readdir_attr_rfork_size_stream(handle, + smb_fname); +-- +2.21.0 + + +From 7e2a1d4771b73f2956005f70b588a6c37cc953a8 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 17 May 2019 14:31:15 +0200 +Subject: [PATCH 19/31] vfs_fruit: remove now unused AppleDouble code for + resource fork in xattr + +This was only needed to get the resourcefork size via the ad_* AppleDouble +function. This is now done with a fstat on the low level xattr fd (remember, +this is Solaris only code...), so we can remove the xattr special casing from +the AppleDouble functions. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit cb9dffa1c66294b6eed85e7576aa99c642d0b541) +--- + source3/modules/vfs_fruit.c | 70 ++----------------------------------- + 1 file changed, 3 insertions(+), 67 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 82c20dbea13..74b10a32449 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1591,20 +1591,6 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle, + return ealen; + } + +-static int ad_open_rsrc_xattr(const struct smb_filename *smb_fname, +- int flags, +- mode_t mode) +-{ +-#ifdef HAVE_ATTROPEN +- /* FIXME: direct Solaris xattr syscall */ +- return attropen(smb_fname->base_name, +- AFPRESOURCE_EA_NETATALK, flags, mode); +-#else +- errno = ENOSYS; +- return -1; +-#endif +-} +- + static int ad_open_rsrc_adouble(const struct smb_filename *smb_fname, + int flags, + mode_t mode) +@@ -1629,19 +1615,7 @@ static int ad_open_rsrc(vfs_handle_struct *handle, + int flags, + mode_t mode) + { +- struct fruit_config_data *config = NULL; +- int fd; +- +- SMB_VFS_HANDLE_GET_DATA(handle, config, +- struct fruit_config_data, return -1); +- +- if (config->rsrc == FRUIT_RSRC_XATTR) { +- fd = ad_open_rsrc_xattr(smb_fname, flags, mode); +- } else { +- fd = ad_open_rsrc_adouble(smb_fname, flags, mode); +- } +- +- return fd; ++ return ad_open_rsrc_adouble(smb_fname, flags, mode); + } + + /* +@@ -1685,24 +1659,6 @@ static int ad_open(vfs_handle_struct *handle, + return 0; + } + +-static ssize_t ad_read_rsrc_xattr(vfs_handle_struct *handle, +- struct adouble *ad) +-{ +- int ret; +- SMB_STRUCT_STAT st; +- +- /* FIXME: direct sys_fstat(), don't have an fsp */ +- ret = sys_fstat(ad->ad_fd, &st, +- lp_fake_directory_create_times( +- SNUM(handle->conn))); +- if (ret != 0) { +- return -1; +- } +- +- ad_setentrylen(ad, ADEID_RFORK, st.st_ex_size); +- return st.st_ex_size; +-} +- + static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, + struct adouble *ad, + const struct smb_filename *smb_fname) +@@ -1776,19 +1732,7 @@ static ssize_t ad_read_rsrc(vfs_handle_struct *handle, + struct adouble *ad, + const struct smb_filename *smb_fname) + { +- struct fruit_config_data *config = NULL; +- ssize_t len; +- +- SMB_VFS_HANDLE_GET_DATA(handle, config, +- struct fruit_config_data, return -1); +- +- if (config->rsrc == FRUIT_RSRC_XATTR) { +- len = ad_read_rsrc_xattr(handle, ad); +- } else { +- len = ad_read_rsrc_adouble(handle, ad, smb_fname); +- } +- +- return len; ++ return ad_read_rsrc_adouble(handle, ad, smb_fname); + } + + /** +@@ -1896,22 +1840,14 @@ static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle, + int rc = 0; + const struct ad_entry_order *eid; + struct adouble *ad = NULL; +- struct fruit_config_data *config; + time_t t = time(NULL); + +- SMB_VFS_HANDLE_GET_DATA(handle, config, +- struct fruit_config_data, return NULL); +- + switch (type) { + case ADOUBLE_META: + eid = entry_order_meta_xattr; + break; + case ADOUBLE_RSRC: +- if (config->rsrc == FRUIT_RSRC_ADFILE) { +- eid = entry_order_dot_und; +- } else { +- eid = entry_order_rsrc_xattr; +- } ++ eid = entry_order_dot_und; + break; + default: + return NULL; +-- +2.21.0 + + +From eb48ba0846b109a44b704241a6a57df3c9ad3216 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Wed, 22 May 2019 21:15:22 +0200 +Subject: [PATCH 20/31] vfs_fruit: remove xattr code from the AppleDouble + subsystem + +The subsystem consumers have been reworked in the previous commits, so this is +not used anymore. ad_init() doesn't need a handle argument anymore due to this, +remove it as well. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit e3cb1cb24f2a31d7fd03f3bdf417f4704fb4ac7c) +--- + source3/modules/vfs_fruit.c | 35 ++++++++--------------------------- + 1 file changed, 8 insertions(+), 27 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 74b10a32449..1e560bf07b5 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -449,18 +449,6 @@ struct ad_entry_order entry_order_dot_und[ADEID_NUM_DOT_UND + 1] = { + {0, 0, 0} + }; + +-/* +- * Fake AppleDouble entry oder for resource fork xattr. The xattr +- * isn't an AppleDouble file, it simply contains the resource data, +- * but in order to be able to use some API calls like ad_getentryoff() +- * we build a fake/helper struct adouble with this entry order struct. +- */ +-static const +-struct ad_entry_order entry_order_rsrc_xattr[ADEID_NUM_RSRC_XATTR + 1] = { +- {ADEID_RFORK, 0, 0}, +- {0, 0, 0} +-}; +- + /* Conversion from enumerated id to on-disk AppleDouble id */ + #define AD_EID_DISK(a) (set_eid[a]) + static const uint32_t set_eid[] = { +@@ -532,7 +520,7 @@ struct fio { + /* + * Forward declarations + */ +-static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle, ++static struct adouble *ad_init(TALLOC_CTX *ctx, + adouble_type_t type); + static struct adouble *ad_get(TALLOC_CTX *ctx, + vfs_handle_struct *handle, +@@ -1773,25 +1761,19 @@ static int adouble_destructor(struct adouble *ad) + * + * @return adouble handle + **/ +-static struct adouble *ad_alloc(TALLOC_CTX *ctx, vfs_handle_struct *handle, ++static struct adouble *ad_alloc(TALLOC_CTX *ctx, + adouble_type_t type) + { + int rc = 0; + size_t adsize = 0; + struct adouble *ad; +- struct fruit_config_data *config; +- +- SMB_VFS_HANDLE_GET_DATA(handle, config, +- struct fruit_config_data, return NULL); + + switch (type) { + case ADOUBLE_META: + adsize = AD_DATASZ_XATTR; + break; + case ADOUBLE_RSRC: +- if (config->rsrc == FRUIT_RSRC_ADFILE) { +- adsize = AD_DATASZ_DOT_UND; +- } ++ adsize = AD_DATASZ_DOT_UND; + break; + default: + return NULL; +@@ -1829,12 +1811,11 @@ static struct adouble *ad_alloc(TALLOC_CTX *ctx, vfs_handle_struct *handle, + * Allocate and initialize a new struct adouble + * + * @param[in] ctx talloc context +- * @param[in] handle vfs handle + * @param[in] type type of AppleDouble, ADOUBLE_META or ADOUBLE_RSRC + * + * @return adouble handle, initialized + **/ +-static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle, ++static struct adouble *ad_init(TALLOC_CTX *ctx, + adouble_type_t type) + { + int rc = 0; +@@ -1853,7 +1834,7 @@ static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle, + return NULL; + } + +- ad = ad_alloc(ctx, handle, type); ++ ad = ad_alloc(ctx, type); + if (ad == NULL) { + return NULL; + } +@@ -1895,7 +1876,7 @@ static struct adouble *ad_get_internal(TALLOC_CTX *ctx, + type == ADOUBLE_META ? "meta" : "rsrc", + smb_fname->base_name)); + +- ad = ad_alloc(ctx, handle, type); ++ ad = ad_alloc(ctx, type); + if (ad == NULL) { + rc = -1; + goto exit; +@@ -3555,7 +3536,7 @@ static int fruit_open_rsrc_adouble(vfs_handle_struct *handle, + } + + if (flags & (O_CREAT | O_TRUNC)) { +- ad = ad_init(fsp, handle, ADOUBLE_RSRC); ++ ad = ad_init(fsp, ADOUBLE_RSRC); + if (ad == NULL) { + rc = -1; + goto exit; +@@ -4635,7 +4616,7 @@ static ssize_t fruit_pwrite_meta_netatalk(vfs_handle_struct *handle, + + ad = ad_fget(talloc_tos(), handle, fsp, ADOUBLE_META); + if (ad == NULL) { +- ad = ad_init(talloc_tos(), handle, ADOUBLE_META); ++ ad = ad_init(talloc_tos(), ADOUBLE_META); + if (ad == NULL) { + return -1; + } +-- +2.21.0 + + +From 8598f79e210655549996a52bfc15888906208c4f Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Thu, 23 May 2019 08:14:18 +0200 +Subject: [PATCH 21/31] vfs_fruit: pass VFS handle to ad_convert_move_reso() + +Not used for now, that comes next. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 3919ea048fe3b763657e14cdfb5920184a900d27) +--- + source3/modules/vfs_fruit.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 1e560bf07b5..01f6fa821c0 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -992,7 +992,8 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries, + return true; + } + +-static bool ad_convert_move_reso(struct adouble *ad, ++static bool ad_convert_move_reso(vfs_handle_struct *handle, ++ struct adouble *ad, + const struct smb_filename *smb_fname) + { + char *map = MAP_FAILED; +@@ -1194,7 +1195,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, + goto fail; + } + +- ok = ad_convert_move_reso(ad, smb_fname); ++ ok = ad_convert_move_reso(handle, ad, smb_fname); + if (!ok) { + goto fail; + } +-- +2.21.0 + + +From 3c32a8da96b8d3233c47593be4b5de6de44d08f8 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Thu, 23 May 2019 08:27:37 +0200 +Subject: [PATCH 22/31] vfs_fruit: remove a layer of indirection + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 97d485ff2cda85edeba163ea01b6abfa705db20f) +--- + source3/modules/vfs_fruit.c | 15 ++++----------- + 1 file changed, 4 insertions(+), 11 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 01f6fa821c0..b927660db9c 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1580,9 +1580,10 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle, + return ealen; + } + +-static int ad_open_rsrc_adouble(const struct smb_filename *smb_fname, +- int flags, +- mode_t mode) ++static int ad_open_rsrc(vfs_handle_struct *handle, ++ const struct smb_filename *smb_fname, ++ int flags, ++ mode_t mode) + { + int ret; + int fd; +@@ -1599,14 +1600,6 @@ static int ad_open_rsrc_adouble(const struct smb_filename *smb_fname, + return fd; + } + +-static int ad_open_rsrc(vfs_handle_struct *handle, +- const struct smb_filename *smb_fname, +- int flags, +- mode_t mode) +-{ +- return ad_open_rsrc_adouble(smb_fname, flags, mode); +-} +- + /* + * Here's the deal: for ADOUBLE_META we can do without an fd as we can issue + * path based xattr calls. For ADOUBLE_RSRC however we need a full-fledged fd +-- +2.21.0 + + +From 79fc20532535da8ceaa5d0348da46a422f4e9369 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Thu, 23 May 2019 16:22:39 +0200 +Subject: [PATCH 23/31] vfs_fruit: only do cross protocol locking on + non-internal opens + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit f5f7d1e9bf7e39933ccf7c874e682f9df80a6fec) +--- + source3/modules/vfs_fruit.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index b927660db9c..fc9e0c90606 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -6071,7 +6071,9 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle, + return status; + } + +- if (config->locking == FRUIT_LOCKING_NETATALK) { ++ if ((config->locking == FRUIT_LOCKING_NETATALK) && ++ (fsp->op != NULL)) ++ { + status = fruit_check_access( + handle, *result, + access_mask, +-- +2.21.0 + + +From f381b0af9e9d3ca53ba742444cf4e58bb6cd8172 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Thu, 23 May 2019 16:42:52 +0200 +Subject: [PATCH 24/31] vfs_fruit: convert ad_open_rsrc() to open a proper fsp + with SMB_VFS_CREATE_FILE() + +A first step in converting all raw syscalls to use proper VFS functions. All +existing users of the raw system filedescriptor continue to use the fd from +fsp->fh for now. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 29418c726be74feb1d8c3ac9f7b8c983901a2aab) +--- + source3/modules/vfs_fruit.c | 103 +++++++++++++++++++++++++++--------- + 1 file changed, 77 insertions(+), 26 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index fc9e0c90606..d6d9fce7956 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -411,7 +411,7 @@ struct ad_entry { + }; + + struct adouble { +- int ad_fd; ++ files_struct *ad_fsp; + bool ad_opened; + adouble_type_t ad_type; + uint32_t ad_magic; +@@ -1011,7 +1011,7 @@ static bool ad_convert_move_reso(vfs_handle_struct *handle, + + /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ + map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, +- ad->ad_fd, 0); ++ ad->ad_fsp->fh->fd, 0); + if (map == MAP_FAILED) { + DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); + return false; +@@ -1036,7 +1036,7 @@ static bool ad_convert_move_reso(vfs_handle_struct *handle, + return false; + } + +- len = sys_pwrite(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); ++ len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); + if (len != AD_DATASZ_DOT_UND) { + DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len); + return false; +@@ -1083,7 +1083,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, + + /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ + map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, +- ad->ad_fd, 0); ++ ad->ad_fsp->fh->fd, 0); + if (map == MAP_FAILED) { + DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); + return false; +@@ -1188,7 +1188,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, + goto fail; + } + +- len = sys_pwrite(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); ++ len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); + if (len != AD_DATASZ_DOT_UND) { + DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len); + ok = false; +@@ -1325,7 +1325,7 @@ static bool ad_convert_truncate(struct adouble *ad, + * FIXME: direct ftruncate(), but we don't have a fsp for the + * VFS call + */ +- rc = ftruncate(ad->ad_fd, ADEDOFF_RFORK_DOT_UND + ++ rc = ftruncate(ad->ad_fsp->fh->fd, ADEDOFF_RFORK_DOT_UND + + ad_getentrylen(ad, ADEID_RFORK)); + if (rc != 0) { + return false; +@@ -1364,7 +1364,7 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle, + + /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ + map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, +- ad->ad_fd, 0); ++ ad->ad_fsp->fh->fd, 0); + if (map == MAP_FAILED) { + DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); + return false; +@@ -1390,7 +1390,7 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle, + return false; + } + +- len = sys_pwrite(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); ++ len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); + if (len != AD_DATASZ_DOT_UND) { + return false; + } +@@ -1583,21 +1583,64 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle, + static int ad_open_rsrc(vfs_handle_struct *handle, + const struct smb_filename *smb_fname, + int flags, +- mode_t mode) ++ mode_t mode, ++ files_struct **_fsp) + { + int ret; +- int fd; + struct smb_filename *adp_smb_fname = NULL; ++ files_struct *fsp = NULL; ++ uint32_t access_mask; ++ uint32_t share_access; ++ uint32_t create_disposition; ++ NTSTATUS status; + + ret = adouble_path(talloc_tos(), smb_fname, &adp_smb_fname); + if (ret != 0) { + return -1; + } + +- fd = open(adp_smb_fname->base_name, flags, mode); ++ ret = SMB_VFS_STAT(handle->conn, adp_smb_fname); ++ if (ret != 0) { ++ TALLOC_FREE(adp_smb_fname); ++ return -1; ++ } ++ ++ access_mask = FILE_GENERIC_READ; ++ share_access = FILE_SHARE_READ | FILE_SHARE_WRITE; ++ create_disposition = FILE_OPEN; ++ ++ if (flags & O_RDWR) { ++ access_mask |= FILE_GENERIC_WRITE; ++ share_access &= ~FILE_SHARE_WRITE; ++ } ++ ++ status = SMB_VFS_CREATE_FILE( ++ handle->conn, /* conn */ ++ NULL, /* req */ ++ 0, /* root_dir_fid */ ++ adp_smb_fname, ++ access_mask, ++ share_access, ++ create_disposition, ++ 0, /* create_options */ ++ 0, /* file_attributes */ ++ INTERNAL_OPEN_ONLY, /* oplock_request */ ++ NULL, /* lease */ ++ 0, /* allocation_size */ ++ 0, /* private_flags */ ++ NULL, /* sd */ ++ NULL, /* ea_list */ ++ &fsp, ++ NULL, /* psbuf */ ++ NULL, NULL); /* create context */ + TALLOC_FREE(adp_smb_fname); ++ if (!NT_STATUS_IS_OK(status)) { ++ DBG_ERR("SMB_VFS_CREATE_FILE failed\n"); ++ return -1; ++ } + +- return fd; ++ *_fsp = fsp; ++ return 0; + } + + /* +@@ -1612,7 +1655,7 @@ static int ad_open(vfs_handle_struct *handle, + int flags, + mode_t mode) + { +- int fd; ++ int ret; + + DBG_DEBUG("Path [%s] type [%s]\n", smb_fname->base_name, + ad->ad_type == ADOUBLE_META ? "meta" : "rsrc"); +@@ -1621,22 +1664,21 @@ static int ad_open(vfs_handle_struct *handle, + return 0; + } + +- if ((fsp != NULL) && (fsp->fh != NULL) && (fsp->fh->fd != -1)) { +- ad->ad_fd = fsp->fh->fd; ++ if (fsp != NULL) { ++ ad->ad_fsp = fsp; + ad->ad_opened = false; + return 0; + } + +- fd = ad_open_rsrc(handle, smb_fname, flags, mode); +- if (fd == -1) { ++ ret = ad_open_rsrc(handle, smb_fname, flags, mode, &ad->ad_fsp); ++ if (ret != 0) { + return -1; + } + ad->ad_opened = true; +- ad->ad_fd = fd; + +- DBG_DEBUG("Path [%s] type [%s] fd [%d]\n", ++ DBG_DEBUG("Path [%s] type [%s]\n", + smb_fname->base_name, +- ad->ad_type == ADOUBLE_META ? "meta" : "rsrc", fd); ++ ad->ad_type == ADOUBLE_META ? "meta" : "rsrc"); + + return 0; + } +@@ -1652,7 +1694,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, + int ret; + bool ok; + +- ret = sys_fstat(ad->ad_fd, &sbuf, lp_fake_directory_create_times( ++ ret = sys_fstat(ad->ad_fsp->fh->fd, &sbuf, lp_fake_directory_create_times( + SNUM(handle->conn))); + if (ret != 0) { + return -1; +@@ -1678,7 +1720,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, + ad->ad_data = p_ad; + } + +- len = sys_pread(ad->ad_fd, ad->ad_data, ++ len = sys_pread(ad->ad_fsp->fh->fd, ad->ad_data, + talloc_array_length(ad->ad_data), 0); + if (len != talloc_array_length(ad->ad_data)) { + DBG_NOTICE("%s %s: bad size: %zd\n", +@@ -1736,10 +1778,20 @@ static ssize_t ad_read(vfs_handle_struct *handle, + + static int adouble_destructor(struct adouble *ad) + { +- if ((ad->ad_fd != -1) && ad->ad_opened) { +- close(ad->ad_fd); +- ad->ad_fd = -1; ++ NTSTATUS status; ++ ++ if (!ad->ad_opened) { ++ return 0; + } ++ ++ SMB_ASSERT(ad->ad_fsp != NULL); ++ ++ status = close_file(NULL, ad->ad_fsp, NORMAL_CLOSE); ++ if (!NT_STATUS_IS_OK(status)) { ++ DBG_ERR("Closing [%s] failed: %s\n", ++ fsp_str_dbg(ad->ad_fsp), nt_errstr(status)); ++ } ++ + return 0; + } + +@@ -1790,7 +1842,6 @@ static struct adouble *ad_alloc(TALLOC_CTX *ctx, + ad->ad_type = type; + ad->ad_magic = AD_MAGIC; + ad->ad_version = AD_VERSION; +- ad->ad_fd = -1; + + talloc_set_destructor(ad, adouble_destructor); + +-- +2.21.0 + + +From 6a1beb430229e4d2dbace960b6a0a6a82af30f54 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Thu, 23 May 2019 22:44:21 +0200 +Subject: [PATCH 25/31] vfs_fruit: remove use of mmap() from + ad_convert_move_reso() + +We now have an fsp that we can use, so we can get rid of mmap() and +sys_pread()/sys_pwrite(). + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 0041855af0b05d6c47558880d6eebd1970179272) +--- + source3/modules/vfs_fruit.c | 56 ++++++++++++++++++++++--------------- + 1 file changed, 33 insertions(+), 23 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index d6d9fce7956..426da55816b 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -996,49 +996,59 @@ static bool ad_convert_move_reso(vfs_handle_struct *handle, + struct adouble *ad, + const struct smb_filename *smb_fname) + { +- char *map = MAP_FAILED; +- size_t maplen; +- ssize_t len; +- int rc; ++ char *buf = NULL; ++ size_t rforklen; ++ size_t rforkoff; ++ ssize_t n; ++ int ret; + bool ok; + +- if (ad_getentrylen(ad, ADEID_RFORK) == 0) { ++ rforklen = ad_getentrylen(ad, ADEID_RFORK); ++ if (rforklen == 0) { + return true; + } + +- maplen = ad_getentryoff(ad, ADEID_RFORK) + +- ad_getentrylen(ad, ADEID_RFORK); +- +- /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ +- map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, +- ad->ad_fsp->fh->fd, 0); +- if (map == MAP_FAILED) { +- DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); ++ buf = talloc_size(ad, rforklen); ++ if (buf == NULL) { ++ /* ++ * This allocates a buffer for reading the resource fork data in ++ * one big swoop. Resource forks won't be larger then, say, 64 ++ * MB, I swear, so just doing the allocation with the talloc ++ * limit as safeguard seems safe. ++ */ ++ DBG_ERR("Failed to allocate %zu bytes for rfork\n", ++ rforklen); + return false; + } + ++ rforkoff = ad_getentryoff(ad, ADEID_RFORK); + +- memmove(map + ADEDOFF_RFORK_DOT_UND, +- map + ad_getentryoff(ad, ADEID_RFORK), +- ad_getentrylen(ad, ADEID_RFORK)); ++ n = SMB_VFS_PREAD(ad->ad_fsp, buf, rforklen, rforkoff); ++ if (n != rforklen) { ++ DBG_ERR("Reading %zu bytes from rfork [%s] failed: %s\n", ++ rforklen, fsp_str_dbg(ad->ad_fsp), strerror(errno)); ++ return false; ++ } + +- rc = munmap(map, maplen); +- if (rc != 0) { +- DBG_ERR("munmap failed: %s\n", strerror(errno)); ++ rforkoff = ADEDOFF_RFORK_DOT_UND; ++ ++ n = SMB_VFS_PWRITE(ad->ad_fsp, buf, rforklen, rforkoff); ++ if (n != rforklen) { ++ DBG_ERR("Writing %zu bytes to rfork [%s] failed: %s\n", ++ rforklen, fsp_str_dbg(ad->ad_fsp), strerror(errno)); + return false; + } + + ad_setentryoff(ad, ADEID_RFORK, ADEDOFF_RFORK_DOT_UND); +- + ok = ad_pack(ad); + if (!ok) { + DBG_WARNING("ad_pack [%s] failed\n", smb_fname->base_name); + return false; + } + +- len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); +- if (len != AD_DATASZ_DOT_UND) { +- DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len); ++ ret = ad_fset(handle, ad, ad->ad_fsp); ++ if (ret != 0) { ++ DBG_ERR("ad_fset on [%s] failed\n", fsp_str_dbg(ad->ad_fsp)); + return false; + } + +-- +2.21.0 + + +From 2a680e4998febc492d33c275268d0a1b06d40386 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 24 May 2019 11:54:51 +0200 +Subject: [PATCH 26/31] vfs_fruit: use fsp and remove mmap in + ad_convert_xattr() + +No need to mmap() anyway, the xattr data is already available in ad->ad_data. + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 4ff7ea0e0312c737aefd350f7b8fbed4c8602325) +--- + source3/modules/vfs_fruit.c | 29 +++++------------------------ + 1 file changed, 5 insertions(+), 24 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 426da55816b..630d53afbe7 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1061,10 +1061,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, + bool *converted_xattr) + { + static struct char_mappings **string_replace_cmaps = NULL; +- char *map = MAP_FAILED; +- size_t maplen; + uint16_t i; +- ssize_t len; + int saved_errno = 0; + NTSTATUS status; + int rc; +@@ -1088,17 +1085,6 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, + TALLOC_FREE(mappings); + } + +- maplen = ad_getentryoff(ad, ADEID_RFORK) + +- ad_getentrylen(ad, ADEID_RFORK); +- +- /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ +- map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, +- ad->ad_fsp->fh->fd, 0); +- if (map == MAP_FAILED) { +- DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); +- return false; +- } +- + for (i = 0; i < ad->adx_header.adx_num_attrs; i++) { + struct ad_xattr_entry *e = &ad->adx_entries[i]; + char *mapped_name = NULL; +@@ -1170,7 +1156,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, + } + + nwritten = SMB_VFS_PWRITE(fsp, +- map + e->adx_offset, ++ ad->ad_data + e->adx_offset, + e->adx_length, + 0); + if (nwritten == -1) { +@@ -1198,9 +1184,10 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, + goto fail; + } + +- len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); +- if (len != AD_DATASZ_DOT_UND) { +- DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len); ++ rc = ad_fset(handle, ad, ad->ad_fsp); ++ if (rc != 0) { ++ DBG_ERR("ad_fset on [%s] failed: %s\n", ++ fsp_str_dbg(ad->ad_fsp), strerror(errno)); + ok = false; + goto fail; + } +@@ -1214,12 +1201,6 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, + ok = true; + + fail: +- rc = munmap(map, maplen); +- if (rc != 0) { +- DBG_ERR("munmap failed: %s\n", strerror(errno)); +- return false; +- } +- + return ok; + } + +-- +2.21.0 + + +From 945f0734c2f37c6327361dc638133f57e81910e5 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 24 May 2019 12:05:51 +0200 +Subject: [PATCH 27/31] vfs_fruit: add VFS handle to ad_convert_truncate() + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 4e44b1da9357120f0ad74e24c650bc6386085c47) +--- + source3/modules/vfs_fruit.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 630d53afbe7..46355d2146e 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1307,7 +1307,8 @@ static bool ad_convert_finderinfo(vfs_handle_struct *handle, + return true; + } + +-static bool ad_convert_truncate(struct adouble *ad, ++static bool ad_convert_truncate(vfs_handle_struct *handle, ++ struct adouble *ad, + const struct smb_filename *smb_fname) + { + int rc; +@@ -1464,7 +1465,7 @@ static int ad_convert(struct vfs_handle_struct *handle, + } + + if (converted_xattr || blank) { +- ok = ad_convert_truncate(ad, smb_fname); ++ ok = ad_convert_truncate(handle, ad, smb_fname); + if (!ok) { + ret = -1; + goto done; +-- +2.21.0 + + +From 1fca33d6436923925ceae855388f81bdd6ba9a53 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 24 May 2019 12:07:55 +0200 +Subject: [PATCH 28/31] vfs_fruit: use VFS function in ad_convert_truncate() + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 3739ad90cf2bbaa2094a34197c894363d2e24a5a) +--- + source3/modules/vfs_fruit.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 46355d2146e..a11f390326d 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1312,13 +1312,11 @@ static bool ad_convert_truncate(vfs_handle_struct *handle, + const struct smb_filename *smb_fname) + { + int rc; ++ off_t newlen; + +- /* +- * FIXME: direct ftruncate(), but we don't have a fsp for the +- * VFS call +- */ +- rc = ftruncate(ad->ad_fsp->fh->fd, ADEDOFF_RFORK_DOT_UND + +- ad_getentrylen(ad, ADEID_RFORK)); ++ newlen = ADEDOFF_RFORK_DOT_UND + ad_getentrylen(ad, ADEID_RFORK); ++ ++ rc = SMB_VFS_FTRUNCATE(ad->ad_fsp, newlen); + if (rc != 0) { + return false; + } +-- +2.21.0 + + +From 7dd37035e053775d7b392ebaaf0130f9af7acc3a Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 24 May 2019 12:51:15 +0200 +Subject: [PATCH 29/31] vfs_fruit: use fsp and remove syscalls from + ad_convert_blank_rfork() + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 70c4a8f0ac307009c26e857523192c95b42a92f5) +--- + source3/modules/vfs_fruit.c | 36 ++++++++++++------------------------ + 1 file changed, 12 insertions(+), 24 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index a11f390326d..2d34b70090e 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1329,10 +1329,10 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle, + bool *blank) + { + struct fruit_config_data *config = NULL; +- uint8_t *map = MAP_FAILED; +- size_t maplen; ++ size_t rforklen = sizeof(empty_resourcefork); ++ char buf[rforklen]; ++ ssize_t nread; + int cmp; +- ssize_t len; + int rc; + bool ok; + +@@ -1345,43 +1345,31 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle, + return true; + } + +- if (ad_getentrylen(ad, ADEID_RFORK) != sizeof(empty_resourcefork)) { ++ if (ad_getentrylen(ad, ADEID_RFORK) != rforklen) { + return true; + } + +- maplen = ad_getentryoff(ad, ADEID_RFORK) + +- ad_getentrylen(ad, ADEID_RFORK); +- +- /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ +- map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, +- ad->ad_fsp->fh->fd, 0); +- if (map == MAP_FAILED) { +- DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); +- return false; +- } +- +- cmp = memcmp(map + ADEDOFF_RFORK_DOT_UND, +- empty_resourcefork, +- sizeof(empty_resourcefork)); +- rc = munmap(map, maplen); +- if (rc != 0) { +- DBG_ERR("munmap failed: %s\n", strerror(errno)); ++ nread = SMB_VFS_PREAD(ad->ad_fsp, buf, rforklen, ADEDOFF_RFORK_DOT_UND); ++ if (nread != rforklen) { ++ DBG_ERR("Reading %zu bytes from rfork [%s] failed: %s\n", ++ rforklen, fsp_str_dbg(ad->ad_fsp), strerror(errno)); + return false; + } + ++ cmp = memcmp(buf, empty_resourcefork, rforklen); + if (cmp != 0) { + return true; + } + + ad_setentrylen(ad, ADEID_RFORK, 0); +- + ok = ad_pack(ad); + if (!ok) { + return false; + } + +- len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); +- if (len != AD_DATASZ_DOT_UND) { ++ rc = ad_fset(handle, ad, ad->ad_fsp); ++ if (rc != 0) { ++ DBG_ERR("ad_fset on [%s] failed\n", fsp_str_dbg(ad->ad_fsp)); + return false; + } + +-- +2.21.0 + + +From 602ba28322bd343a47c811f2d9e441a7886a2664 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 24 May 2019 14:51:17 +0200 +Subject: [PATCH 30/31] vfs_fruit: use VFS functions in ad_read_rsrc_adouble() + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison +(cherry picked from commit 9fe84a6345bf5d9fdb1df87a853db3380e6fb0f7) +--- + source3/modules/vfs_fruit.c | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 2d34b70090e..38c201b38e0 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -1665,16 +1665,16 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, + struct adouble *ad, + const struct smb_filename *smb_fname) + { +- SMB_STRUCT_STAT sbuf; + char *p_ad = NULL; + size_t size; + ssize_t len; + int ret; + bool ok; + +- ret = sys_fstat(ad->ad_fsp->fh->fd, &sbuf, lp_fake_directory_create_times( +- SNUM(handle->conn))); ++ ret = SMB_VFS_NEXT_FSTAT(handle, ad->ad_fsp, &ad->ad_fsp->fsp_name->st); + if (ret != 0) { ++ DBG_ERR("fstat [%s] failed: %s\n", ++ fsp_str_dbg(ad->ad_fsp), strerror(errno)); + return -1; + } + +@@ -1686,7 +1686,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, + * + * Read as much as we can up to AD_XATTR_MAX_HDR_SIZE. + */ +- size = sbuf.st_ex_size; ++ size = ad->ad_fsp->fsp_name->st.st_ex_size; + if (size > talloc_array_length(ad->ad_data)) { + if (size > AD_XATTR_MAX_HDR_SIZE) { + size = AD_XATTR_MAX_HDR_SIZE; +@@ -1698,8 +1698,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, + ad->ad_data = p_ad; + } + +- len = sys_pread(ad->ad_fsp->fh->fd, ad->ad_data, +- talloc_array_length(ad->ad_data), 0); ++ len = SMB_VFS_NEXT_PREAD(handle, ad->ad_fsp, ad->ad_data, talloc_array_length(ad->ad_data), 0); + if (len != talloc_array_length(ad->ad_data)) { + DBG_NOTICE("%s %s: bad size: %zd\n", + smb_fname->base_name, strerror(errno), len); +@@ -1707,7 +1706,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, + } + + /* Now parse entries */ +- ok = ad_unpack(ad, ADEID_NUM_DOT_UND, sbuf.st_ex_size); ++ ok = ad_unpack(ad, ADEID_NUM_DOT_UND, size); + if (!ok) { + DBG_ERR("invalid AppleDouble resource %s\n", + smb_fname->base_name); +-- +2.21.0 + + +From 3f5303416f9189c5e81444e65aac98f2444183b1 Mon Sep 17 00:00:00 2001 +From: Ralph Boehme +Date: Fri, 24 May 2019 15:15:59 +0200 +Subject: [PATCH 31/31] vfs_fruit: remove a now unnecessary include + +Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 + +Signed-off-by: Ralph Boehme +Reviewed-by: Jeremy Allison + +Autobuild-User(master): Jeremy Allison +Autobuild-Date(master): Thu May 30 22:12:50 UTC 2019 on sn-devel-184 + +(cherry picked from commit 9a2c9834cb1b77547b8b932c35870301afb9fc25) +--- + source3/modules/vfs_fruit.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c +index 38c201b38e0..20121818129 100644 +--- a/source3/modules/vfs_fruit.c ++++ b/source3/modules/vfs_fruit.c +@@ -29,7 +29,6 @@ + #include "messages.h" + #include "libcli/security/security.h" + #include "../libcli/smb/smb2_create_ctx.h" +-#include "lib/util/sys_rw.h" + #include "lib/util/tevent_ntstatus.h" + #include "lib/util/tevent_unix.h" + #include "offload_token.h" +-- +2.21.0 + diff --git a/samba-4.10.6-vfs_glusterfs.patch b/samba-4.10.6-vfs_glusterfs.patch new file mode 100644 index 0000000..3ac0b2f --- /dev/null +++ b/samba-4.10.6-vfs_glusterfs.patch @@ -0,0 +1,276 @@ +From 1ea533bd5f7f6febeeb1a4261f2afbb19081e8eb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?G=C3=BCnther=20Deschner?= +Date: Mon, 3 Jun 2019 14:27:18 +0200 +Subject: [PATCH 1/4] Revert "s3/vfs_glusterfs: Dynamically determine NAME_MAX" + +This reverts commit 8e3a042eb9e502821b147f1bbb2d98d59f17a095. + +Signed-off-by: Guenther Deschner +Reviewed-by: Volker Lendecke +--- + source3/modules/vfs_glusterfs.c | 37 +++++++-------------------------- + 1 file changed, 8 insertions(+), 29 deletions(-) + +diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c +index 2b5385e44b0..ba8973fa6d3 100644 +--- a/source3/modules/vfs_glusterfs.c ++++ b/source3/modules/vfs_glusterfs.c +@@ -1454,36 +1454,20 @@ static int vfs_gluster_chflags(struct vfs_handle_struct *handle, + + static int vfs_gluster_get_real_filename(struct vfs_handle_struct *handle, + const char *path, const char *name, +- TALLOC_CTX *mem_ctx, char **_found_name) ++ TALLOC_CTX *mem_ctx, char **found_name) + { + int ret; +- char *key_buf = NULL, *val_buf = NULL; +- long name_max; +- char *found_name = NULL; ++ char key_buf[NAME_MAX + 64]; ++ char val_buf[NAME_MAX + 1]; + +- name_max = pathconf(path, _PC_NAME_MAX); +- if ((name_max + 1) < 1) { +- errno = EINVAL; +- return -1; +- } +- +- if (strlen(name) >= name_max) { ++ if (strlen(name) >= NAME_MAX) { + errno = ENAMETOOLONG; + return -1; + } + +- key_buf = talloc_asprintf(mem_ctx, "glusterfs.get_real_filename:%s", +- name); +- if (key_buf == NULL) { +- errno = ENOMEM; +- return -1; +- } ++ snprintf(key_buf, NAME_MAX + 64, ++ "glusterfs.get_real_filename:%s", name); + +- val_buf = talloc_zero_array(mem_ctx, char, name_max + 1); +- if (val_buf == NULL) { +- errno = ENOMEM; +- return -1; +- } + ret = glfs_getxattr(handle->data, path, key_buf, val_buf, NAME_MAX + 1); + if (ret == -1) { + if (errno == ENOATTR) { +@@ -1492,16 +1476,11 @@ static int vfs_gluster_get_real_filename(struct vfs_handle_struct *handle, + return -1; + } + +- found_name = talloc_strdup(mem_ctx, val_buf); +- if (found_name == NULL) { ++ *found_name = talloc_strdup(mem_ctx, val_buf); ++ if (found_name[0] == NULL) { + errno = ENOMEM; + return -1; + } +- *_found_name = found_name; +- +- TALLOC_FREE(key_buf); +- TALLOC_FREE(val_buf); +- + return 0; + } + +-- +2.21.0 + + +From 01a569bec073ce45f412884d340ecfc50ce41fbe Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?G=C3=BCnther=20Deschner?= +Date: Mon, 3 Jun 2019 14:27:44 +0200 +Subject: [PATCH 2/4] Revert "s3/vfs_glusterfs_fuse: Dynamically determine + NAME_MAX" + +This reverts commit e28d172b00cadf492c22bd892e2dda3bf2fe2d70. + +Signed-off-by: Guenther Deschner +Reviewed-by: Volker Lendecke +--- + source3/modules/vfs_glusterfs_fuse.c | 32 ++++++---------------------- + 1 file changed, 6 insertions(+), 26 deletions(-) + +diff --git a/source3/modules/vfs_glusterfs_fuse.c b/source3/modules/vfs_glusterfs_fuse.c +index 0b1de9fcdb2..8855cd18d01 100644 +--- a/source3/modules/vfs_glusterfs_fuse.c ++++ b/source3/modules/vfs_glusterfs_fuse.c +@@ -28,35 +28,19 @@ static int vfs_gluster_fuse_get_real_filename(struct vfs_handle_struct *handle, + char **_found_name) + { + int ret; +- char *key_buf = NULL, *val_buf = NULL; +- long name_max; ++ char key_buf[NAME_MAX + 64]; ++ char val_buf[NAME_MAX + 1]; + char *found_name = NULL; + +- name_max = pathconf(path, _PC_NAME_MAX); +- if ((name_max + 1) < 1) { +- errno = EINVAL; +- return -1; +- } +- +- if (strlen(name) >= name_max) { ++ if (strlen(name) >= NAME_MAX) { + errno = ENAMETOOLONG; + return -1; + } + +- key_buf = talloc_asprintf(mem_ctx, "glusterfs.get_real_filename:%s", +- name); +- if (key_buf == NULL) { +- errno = ENOMEM; +- return -1; +- } +- +- val_buf = talloc_zero_array(mem_ctx, char, name_max + 1); +- if (val_buf == NULL) { +- errno = ENOMEM; +- return -1; +- } ++ snprintf(key_buf, NAME_MAX + 64, ++ "glusterfs.get_real_filename:%s", name); + +- ret = getxattr(path, key_buf, val_buf, name_max + 1); ++ ret = getxattr(path, key_buf, val_buf, NAME_MAX + 1); + if (ret == -1) { + if (errno == ENOATTR) { + errno = EOPNOTSUPP; +@@ -70,10 +54,6 @@ static int vfs_gluster_fuse_get_real_filename(struct vfs_handle_struct *handle, + return -1; + } + *_found_name = found_name; +- +- TALLOC_FREE(key_buf); +- TALLOC_FREE(val_buf); +- + return 0; + } + +-- +2.21.0 + + +From e85bb58532fe82daac6e50e88d08bbab66cb1019 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?G=C3=BCnther=20Deschner?= +Date: Mon, 3 Jun 2019 16:25:46 +0200 +Subject: [PATCH 3/4] s3/vfs_glusterfs: Avoid using NAME_MAX directly + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13872 + +Guenther + +Signed-off-by: Guenther Deschner +Reviewed-by: Volker Lendecke +--- + source3/modules/vfs_glusterfs.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c +index ba8973fa6d3..a9415952b4e 100644 +--- a/source3/modules/vfs_glusterfs.c ++++ b/source3/modules/vfs_glusterfs.c +@@ -47,6 +47,7 @@ + #include "modules/posixacl_xattr.h" + + #define DEFAULT_VOLFILE_SERVER "localhost" ++#define GLUSTER_NAME_MAX 255 + + static int read_fd = -1; + static int write_fd = -1; +@@ -1457,18 +1458,19 @@ static int vfs_gluster_get_real_filename(struct vfs_handle_struct *handle, + TALLOC_CTX *mem_ctx, char **found_name) + { + int ret; +- char key_buf[NAME_MAX + 64]; +- char val_buf[NAME_MAX + 1]; ++ char key_buf[GLUSTER_NAME_MAX + 64]; ++ char val_buf[GLUSTER_NAME_MAX + 1]; + +- if (strlen(name) >= NAME_MAX) { ++ if (strlen(name) >= GLUSTER_NAME_MAX) { + errno = ENAMETOOLONG; + return -1; + } + +- snprintf(key_buf, NAME_MAX + 64, ++ snprintf(key_buf, GLUSTER_NAME_MAX + 64, + "glusterfs.get_real_filename:%s", name); + +- ret = glfs_getxattr(handle->data, path, key_buf, val_buf, NAME_MAX + 1); ++ ret = glfs_getxattr(handle->data, path, key_buf, val_buf, ++ GLUSTER_NAME_MAX + 1); + if (ret == -1) { + if (errno == ENOATTR) { + errno = EOPNOTSUPP; +-- +2.21.0 + + +From 7cc9e3fe24dd476360837c04538345752048e6be Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?G=C3=BCnther=20Deschner?= +Date: Mon, 3 Jun 2019 16:28:36 +0200 +Subject: [PATCH 4/4] s3/vfs_glusterfs_fuse: Avoid using NAME_MAX directly +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13872 + +Guenther + +Signed-off-by: Guenther Deschner +Reviewed-by: Volker Lendecke + +Autobuild-User(master): Günther Deschner +Autobuild-Date(master): Tue Jun 11 00:29:19 UTC 2019 on sn-devel-184 +--- + source3/modules/vfs_glusterfs_fuse.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/source3/modules/vfs_glusterfs_fuse.c b/source3/modules/vfs_glusterfs_fuse.c +index 8855cd18d01..d92f5e2b08b 100644 +--- a/source3/modules/vfs_glusterfs_fuse.c ++++ b/source3/modules/vfs_glusterfs_fuse.c +@@ -21,6 +21,8 @@ + #include "smbd/smbd.h" + #include "system/filesys.h" + ++#define GLUSTER_NAME_MAX 255 ++ + static int vfs_gluster_fuse_get_real_filename(struct vfs_handle_struct *handle, + const char *path, + const char *name, +@@ -28,19 +30,19 @@ static int vfs_gluster_fuse_get_real_filename(struct vfs_handle_struct *handle, + char **_found_name) + { + int ret; +- char key_buf[NAME_MAX + 64]; +- char val_buf[NAME_MAX + 1]; ++ char key_buf[GLUSTER_NAME_MAX + 64]; ++ char val_buf[GLUSTER_NAME_MAX + 1]; + char *found_name = NULL; + +- if (strlen(name) >= NAME_MAX) { ++ if (strlen(name) >= GLUSTER_NAME_MAX) { + errno = ENAMETOOLONG; + return -1; + } + +- snprintf(key_buf, NAME_MAX + 64, ++ snprintf(key_buf, GLUSTER_NAME_MAX + 64, + "glusterfs.get_real_filename:%s", name); + +- ret = getxattr(path, key_buf, val_buf, NAME_MAX + 1); ++ ret = getxattr(path, key_buf, val_buf, GLUSTER_NAME_MAX + 1); + if (ret == -1) { + if (errno == ENOATTR) { + errno = EOPNOTSUPP; +-- +2.21.0 + diff --git a/samba.spec b/samba.spec index e479ec4..5414a05 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 0 +%define main_release 1 %define samba_version 4.10.5 %define talloc_version 2.1.16 @@ -118,6 +118,10 @@ Source14: samba.pamd Source201: README.downgrade +Patch0: samba-4.10.6-vfs_fruit.patch +Patch1: samba-4.10.6-vfs_glusterfs.patch +Patch2: samba-4.10.6-smbspool.patch + Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -3435,6 +3439,11 @@ fi %endif # with_clustering_support %changelog +* Thu Jun 20 2019 Guenther Deschner - 4.10.5-1 +- resolves: #1602824 - Make vfs_fruit operable with other remote VFS modules +- resolves: #1716455 - Avoid pathconf() in get_real_filename() VFS calls +- resolves: #1706090, #1700791 - Fix smbspool + * Wed Jun 19 2019 Guenther Deschner - 4.10.5-0 - Update to Samba 4.10.5 - resolves: #1711816, #1721872 - Security fixes for CVE-2019-12435 From b6c2e29b4aad8e46a38e859e858b9497a631daec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Mon, 1 Jul 2019 17:46:59 +0200 Subject: [PATCH 63/76] Avoid deprecated time.clock in wafsamba resolves: #1718113 Update to latest waf version 2.0.17 resolves: #1711638 Guenther --- samba-4.10.x-waf_timer.patch | 115 ++ samba-4.10.x-waf_update.patch | 3300 +++++++++++++++++++++++++++++++++ samba.spec | 8 +- 3 files changed, 3422 insertions(+), 1 deletion(-) create mode 100644 samba-4.10.x-waf_timer.patch create mode 100644 samba-4.10.x-waf_update.patch diff --git a/samba-4.10.x-waf_timer.patch b/samba-4.10.x-waf_timer.patch new file mode 100644 index 0000000..05cf52c --- /dev/null +++ b/samba-4.10.x-waf_timer.patch @@ -0,0 +1,115 @@ +From bb253743e7e757c3ee063b12f79689f4f8355a71 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Wed, 12 Jun 2019 12:27:04 +0200 +Subject: [PATCH] wafsamba: Use native waf timer + + __main__:1: DeprecationWarning: time.clock has been deprecated in Python 3.3 + and will be removed from Python 3.8: use time.perf_counter + or time.process_time instead + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13998 + +Signed-off-by: Lukas Slebodnik +Reviewed-by: Andreas Schneider +Reviewed-by: Alexander Bokovoy +(cherry picked from commit 8f082904ce580f1a6b8a06ebcc323c99e892bd1f) +--- + buildtools/wafsamba/samba_deps.py | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py +index f8c38809bd2..03c37079a8c 100644 +--- a/buildtools/wafsamba/samba_deps.py ++++ b/buildtools/wafsamba/samba_deps.py +@@ -1,6 +1,6 @@ + # Samba automatic dependency handling and project rules + +-import os, sys, re, time ++import os, sys, re + + from waflib import Build, Options, Logs, Utils, Errors + from waflib.Logs import debug +@@ -1102,8 +1102,7 @@ def check_project_rules(bld): + if not force_project_rules and load_samba_deps(bld, tgt_list): + return + +- global tstart +- tstart = time.clock() ++ timer = Utils.Timer() + + bld.new_rules = True + Logs.info("Checking project rules ...") +@@ -1112,26 +1111,26 @@ def check_project_rules(bld): + + expand_subsystem_deps(bld) + +- debug("deps: expand_subsystem_deps: %f" % (time.clock() - tstart)) ++ debug("deps: expand_subsystem_deps: %s" % str(timer)) + + replace_grouping_libraries(bld, tgt_list) + +- debug("deps: replace_grouping_libraries: %f" % (time.clock() - tstart)) ++ debug("deps: replace_grouping_libraries: %s" % str(timer)) + + build_direct_deps(bld, tgt_list) + +- debug("deps: build_direct_deps: %f" % (time.clock() - tstart)) ++ debug("deps: build_direct_deps: %s" % str(timer)) + + break_dependency_loops(bld, tgt_list) + +- debug("deps: break_dependency_loops: %f" % (time.clock() - tstart)) ++ debug("deps: break_dependency_loops: %s" % str(timer)) + + if Options.options.SHOWDEPS: + show_dependencies(bld, Options.options.SHOWDEPS, set()) + + calculate_final_deps(bld, tgt_list, loops) + +- debug("deps: calculate_final_deps: %f" % (time.clock() - tstart)) ++ debug("deps: calculate_final_deps: %s" % str(timer)) + + if Options.options.SHOW_DUPLICATES: + show_object_duplicates(bld, tgt_list) +@@ -1140,7 +1139,7 @@ def check_project_rules(bld): + for f in [ build_dependencies, build_includes, add_init_functions ]: + debug('deps: project rules checking %s', f) + for t in tgt_list: f(t) +- debug("deps: %s: %f" % (f, time.clock() - tstart)) ++ debug("deps: %s: %s" % (f, str(timer))) + + debug('deps: project rules stage1 completed') + +@@ -1148,17 +1147,17 @@ def check_project_rules(bld): + Logs.error("Duplicate sources present - aborting") + sys.exit(1) + +- debug("deps: check_duplicate_sources: %f" % (time.clock() - tstart)) ++ debug("deps: check_duplicate_sources: %s" % str(timer)) + + if not bld.check_group_ordering(tgt_list): + Logs.error("Bad group ordering - aborting") + sys.exit(1) + +- debug("deps: check_group_ordering: %f" % (time.clock() - tstart)) ++ debug("deps: check_group_ordering: %s" % str(timer)) + + show_final_deps(bld, tgt_list) + +- debug("deps: show_final_deps: %f" % (time.clock() - tstart)) ++ debug("deps: show_final_deps: %s" % str(timer)) + + debug('deps: project rules checking completed - %u targets checked', + len(tgt_list)) +@@ -1166,7 +1165,7 @@ def check_project_rules(bld): + if not bld.is_install: + save_samba_deps(bld, tgt_list) + +- debug("deps: save_samba_deps: %f" % (time.clock() - tstart)) ++ debug("deps: save_samba_deps: %s" % str(timer)) + + Logs.info("Project rules pass") + +-- +2.21.0 + diff --git a/samba-4.10.x-waf_update.patch b/samba-4.10.x-waf_update.patch new file mode 100644 index 0000000..b0ca5a3 --- /dev/null +++ b/samba-4.10.x-waf_update.patch @@ -0,0 +1,3300 @@ +From f78df958cb0a636906890ac6c823eb72ca365de3 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 3 Jun 2019 10:40:55 +0200 +Subject: [PATCH] third_party: Update waf to version 2.0.17 + +This fixes building Samba, libtalloc, libtevent, libtdb and libldb with +Python 3.8. + + wget https://waf.io/waf-2.0.17.tar.bz2 + tar -xf waf-2.0.17.tar.bz2 + git rm third_party/waf/waflib/ -r + mkdir third_party/waf -p + rsync -a waf-2.0.17/waflib/ third_party/waf/waflib/ + git add third_party/waf/waflib/ + +(Then update version number in buildtools/bin/waf and +buildtools/wafsamba/wafsamba.py) + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13960 + +Signed-off-by: Andreas Schneider +Reviewed-by: Andrew Bartlett +Signed-off-by: Andrew Bartlett +(cherry picked from commit aabdcc91513e242c4f191e1bbbb70c890416d213) +--- + buildtools/bin/waf | 2 +- + buildtools/wafsamba/wafsamba.py | 2 +- + third_party/waf/waflib/Build.py | 62 ++++- + third_party/waf/waflib/ConfigSet.py | 4 +- + third_party/waf/waflib/Configure.py | 5 +- + third_party/waf/waflib/Context.py | 16 +- + third_party/waf/waflib/Logs.py | 9 +- + third_party/waf/waflib/Node.py | 3 +- + third_party/waf/waflib/Runner.py | 60 ++++- + third_party/waf/waflib/Scripting.py | 15 +- + third_party/waf/waflib/Task.py | 215 ++++++++++++++---- + third_party/waf/waflib/TaskGen.py | 6 +- + third_party/waf/waflib/Tools/c_config.py | 11 +- + third_party/waf/waflib/Tools/c_preproc.py | 8 +- + third_party/waf/waflib/Tools/ccroot.py | 22 +- + third_party/waf/waflib/Tools/d_scan.py | 8 +- + third_party/waf/waflib/Tools/fc.py | 24 +- + third_party/waf/waflib/Tools/fc_config.py | 6 +- + third_party/waf/waflib/Tools/fc_scan.py | 12 +- + third_party/waf/waflib/Tools/ifort.py | 2 +- + third_party/waf/waflib/Tools/javaw.py | 157 +++++++++++-- + third_party/waf/waflib/Tools/md5_tstamp.py | 6 +- + third_party/waf/waflib/Tools/msvc.py | 18 +- + third_party/waf/waflib/Tools/python.py | 18 +- + third_party/waf/waflib/Tools/qt5.py | 14 +- + third_party/waf/waflib/Tools/waf_unit_test.py | 4 +- + third_party/waf/waflib/Tools/winres.py | 4 +- + third_party/waf/waflib/Utils.py | 26 ++- + third_party/waf/waflib/ansiterm.py | 2 +- + third_party/waf/waflib/extras/buildcopy.py | 7 +- + third_party/waf/waflib/extras/clang_cross.py | 92 ++++++++ + .../waf/waflib/extras/clang_cross_common.py | 113 +++++++++ + .../waf/waflib/extras/clangxx_cross.py | 106 +++++++++ + third_party/waf/waflib/extras/color_msvc.py | 59 +++++ + third_party/waf/waflib/extras/cppcheck.py | 12 +- + third_party/waf/waflib/extras/cpplint.py | 77 +++---- + third_party/waf/waflib/extras/cython.py | 15 +- + third_party/waf/waflib/extras/distnet.py | 2 +- + third_party/waf/waflib/extras/doxygen.py | 13 +- + third_party/waf/waflib/extras/erlang.py | 2 +- + third_party/waf/waflib/extras/fast_partial.py | 3 +- + third_party/waf/waflib/extras/fc_cray.py | 2 +- + third_party/waf/waflib/extras/fc_nec.py | 2 +- + third_party/waf/waflib/extras/fc_nfort.py | 52 +++++ + third_party/waf/waflib/extras/gccdeps.py | 6 +- + third_party/waf/waflib/extras/kde4.py | 2 +- + third_party/waf/waflib/extras/msvcdeps.py | 73 +++--- + third_party/waf/waflib/extras/ocaml.py | 2 +- + .../waf/waflib/extras/parallel_debug.py | 9 +- + third_party/waf/waflib/extras/pgicc.py | 2 +- + third_party/waf/waflib/extras/protoc.py | 93 +++----- + third_party/waf/waflib/extras/pyqt5.py | 21 +- + third_party/waf/waflib/extras/qt4.py | 6 +- + third_party/waf/waflib/extras/remote.py | 2 +- + .../waf/waflib/extras/run_do_script.py | 2 +- + third_party/waf/waflib/extras/sphinx.py | 81 +++++++ + third_party/waf/waflib/extras/swig.py | 4 +- + third_party/waf/waflib/extras/syms.py | 2 +- + third_party/waf/waflib/extras/use_config.py | 2 +- + third_party/waf/waflib/extras/xcode6.py | 8 +- + third_party/waf/waflib/processor.py | 4 + + 61 files changed, 1259 insertions(+), 358 deletions(-) + create mode 100644 third_party/waf/waflib/extras/clang_cross.py + create mode 100644 third_party/waf/waflib/extras/clang_cross_common.py + create mode 100644 third_party/waf/waflib/extras/clangxx_cross.py + create mode 100644 third_party/waf/waflib/extras/color_msvc.py + create mode 100644 third_party/waf/waflib/extras/fc_nfort.py + create mode 100644 third_party/waf/waflib/extras/sphinx.py + +diff --git a/buildtools/bin/waf b/buildtools/bin/waf +index 3ee4d5bc4df..8413f2332b7 100755 +--- a/buildtools/bin/waf ++++ b/buildtools/bin/waf +@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. + + import os, sys, inspect + +-VERSION="2.0.8" ++VERSION="2.0.17" + REVISION="x" + GIT="x" + INSTALL="x" +diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py +index a077026c690..760430460b8 100644 +--- a/buildtools/wafsamba/wafsamba.py ++++ b/buildtools/wafsamba/wafsamba.py +@@ -37,7 +37,7 @@ LIB_PATH="shared" + + os.environ['PYTHONUNBUFFERED'] = '1' + +-if Context.HEXVERSION not in (0x2000800,): ++if Context.HEXVERSION not in (0x2001100,): + Logs.error(''' + Please use the version of waf that comes with Samba, not + a system installed version. See http://wiki.samba.org/index.php/Waf +diff --git a/third_party/waf/waflib/Build.py b/third_party/waf/waflib/Build.py +index 8347a287a81..39f0991918b 100644 +--- a/third_party/waf/waflib/Build.py ++++ b/third_party/waf/waflib/Build.py +@@ -104,7 +104,7 @@ class BuildContext(Context.Context): + """Amount of jobs to run in parallel""" + + self.targets = Options.options.targets +- """List of targets to build (default: \*)""" ++ """List of targets to build (default: \\*)""" + + self.keep = Options.options.keep + """Whether the build should continue past errors""" +@@ -758,14 +758,31 @@ class BuildContext(Context.Context): + elif not ln.is_child_of(self.srcnode): + Logs.warn('CWD %s is not under %s, forcing --targets=* (run distclean?)', ln.abspath(), self.srcnode.abspath()) + ln = self.srcnode +- for tg in self.groups[self.current_group]: ++ ++ def is_post(tg, ln): + try: + p = tg.path + except AttributeError: + pass + else: + if p.is_child_of(ln): +- tgpost(tg) ++ return True ++ ++ def is_post_group(): ++ for i, g in enumerate(self.groups): ++ if i > self.current_group: ++ for tg in g: ++ if is_post(tg, ln): ++ return True ++ ++ if self.post_mode == POST_LAZY and ln != self.srcnode: ++ # partial folder builds require all targets from a previous build group ++ if is_post_group(): ++ ln = self.srcnode ++ ++ for tg in self.groups[self.current_group]: ++ if is_post(tg, ln): ++ tgpost(tg) + + def get_tasks_group(self, idx): + """ +@@ -884,7 +901,7 @@ class BuildContext(Context.Context): + + :param dest: absolute path of the symlink + :type dest: :py:class:`waflib.Node.Node` or string (absolute path) +- :param src: link contents, which is a relative or abolute path which may exist or not ++ :param src: link contents, which is a relative or absolute path which may exist or not + :type src: string + :param env: configuration set for performing substitutions in dest + :type env: :py:class:`waflib.ConfigSet.ConfigSet` +@@ -1038,12 +1055,16 @@ class inst(Task.Task): + """ + Returns the destination path where files will be installed, pre-pending `destdir`. + ++ Relative paths will be interpreted relative to `PREFIX` if no `destdir` is given. ++ + :rtype: string + """ + if isinstance(self.install_to, Node.Node): + dest = self.install_to.abspath() + else: +- dest = Utils.subst_vars(self.install_to, self.env) ++ dest = os.path.normpath(Utils.subst_vars(self.install_to, self.env)) ++ if not os.path.isabs(dest): ++ dest = os.path.join(self.env.PREFIX, dest) + if destdir and Options.options.destdir: + dest = os.path.join(Options.options.destdir, os.path.splitdrive(dest)[1].lstrip(os.sep)) + return dest +@@ -1139,11 +1160,19 @@ class inst(Task.Task): + # same size and identical timestamps -> make no copy + if st1.st_mtime + 2 >= st2.st_mtime and st1.st_size == st2.st_size: + if not self.generator.bld.progress_bar: +- Logs.info('- install %s (from %s)', tgt, lbl) ++ ++ c1 = Logs.colors.NORMAL ++ c2 = Logs.colors.BLUE ++ ++ Logs.info('%s- install %s%s%s (from %s)', c1, c2, tgt, c1, lbl) + return False + + if not self.generator.bld.progress_bar: +- Logs.info('+ install %s (from %s)', tgt, lbl) ++ ++ c1 = Logs.colors.NORMAL ++ c2 = Logs.colors.BLUE ++ ++ Logs.info('%s+ install %s%s%s (from %s)', c1, c2, tgt, c1, lbl) + + # Give best attempt at making destination overwritable, + # like the 'install' utility used by 'make install' does. +@@ -1200,14 +1229,18 @@ class inst(Task.Task): + """ + if os.path.islink(tgt) and os.readlink(tgt) == src: + if not self.generator.bld.progress_bar: +- Logs.info('- symlink %s (to %s)', tgt, src) ++ c1 = Logs.colors.NORMAL ++ c2 = Logs.colors.BLUE ++ Logs.info('%s- symlink %s%s%s (to %s)', c1, c2, tgt, c1, src) + else: + try: + os.remove(tgt) + except OSError: + pass + if not self.generator.bld.progress_bar: +- Logs.info('+ symlink %s (to %s)', tgt, src) ++ c1 = Logs.colors.NORMAL ++ c2 = Logs.colors.BLUE ++ Logs.info('%s+ symlink %s%s%s (to %s)', c1, c2, tgt, c1, src) + os.symlink(src, tgt) + self.fix_perms(tgt) + +@@ -1216,7 +1249,9 @@ class inst(Task.Task): + See :py:meth:`waflib.Build.inst.do_install` + """ + if not self.generator.bld.progress_bar: +- Logs.info('- remove %s', tgt) ++ c1 = Logs.colors.NORMAL ++ c2 = Logs.colors.BLUE ++ Logs.info('%s- remove %s%s%s', c1, c2, tgt, c1) + + #self.uninstall.append(tgt) + try: +@@ -1236,7 +1271,9 @@ class inst(Task.Task): + """ + try: + if not self.generator.bld.progress_bar: +- Logs.info('- remove %s', tgt) ++ c1 = Logs.colors.NORMAL ++ c2 = Logs.colors.BLUE ++ Logs.info('%s- remove %s%s%s', c1, c2, tgt, c1) + os.remove(tgt) + except OSError: + pass +@@ -1297,7 +1334,8 @@ class CleanContext(BuildContext): + lst = [] + for env in self.all_envs.values(): + lst.extend(self.root.find_or_declare(f) for f in env[CFG_FILES]) +- for n in self.bldnode.ant_glob('**/*', excl='.lock* *conf_check_*/** config.log c4che/*', quiet=True): ++ excluded_dirs = '.lock* *conf_check_*/** config.log %s/*' % CACHE_DIR ++ for n in self.bldnode.ant_glob('**/*', excl=excluded_dirs, quiet=True): + if n in lst: + continue + n.delete() +diff --git a/third_party/waf/waflib/ConfigSet.py b/third_party/waf/waflib/ConfigSet.py +index b300bb56b7c..901fba6c067 100644 +--- a/third_party/waf/waflib/ConfigSet.py ++++ b/third_party/waf/waflib/ConfigSet.py +@@ -11,7 +11,7 @@ The values put in :py:class:`ConfigSet` must be serializable (dicts, lists, stri + + import copy, re, os + from waflib import Logs, Utils +-re_imp = re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$', re.M) ++re_imp = re.compile(r'^(#)*?([^#=]*?)\ =\ (.*?)$', re.M) + + class ConfigSet(object): + """ +@@ -312,7 +312,7 @@ class ConfigSet(object): + :type filename: string + """ + tbl = self.table +- code = Utils.readf(filename, m='rU') ++ code = Utils.readf(filename, m='r') + for m in re_imp.finditer(code): + g = m.group + tbl[g(2)] = eval(g(3)) +diff --git a/third_party/waf/waflib/Configure.py b/third_party/waf/waflib/Configure.py +index 20ca705e696..db09c0e3a40 100644 +--- a/third_party/waf/waflib/Configure.py ++++ b/third_party/waf/waflib/Configure.py +@@ -125,7 +125,7 @@ class ConfigurationContext(Context.Context): + self.bldnode.mkdir() + + if not os.path.isdir(self.bldnode.abspath()): +- conf.fatal('Could not create the build directory %s' % self.bldnode.abspath()) ++ self.fatal('Could not create the build directory %s' % self.bldnode.abspath()) + + def execute(self): + """ +@@ -180,6 +180,7 @@ class ConfigurationContext(Context.Context): + env.hash = self.hash + env.files = self.files + env.environ = dict(self.environ) ++ env.launch_dir = Context.launch_dir + + if not (self.env.NO_LOCK_IN_RUN or env.environ.get('NO_LOCK_IN_RUN') or getattr(Options.options, 'no_lock_in_run')): + env.store(os.path.join(Context.run_dir, Options.lockfile)) +@@ -286,7 +287,7 @@ class ConfigurationContext(Context.Context): + + def eval_rules(self, rules): + """ +- Execute configuration tests provided as list of funcitons to run ++ Execute configuration tests provided as list of functions to run + + :param rules: list of configuration method names + :type rules: list of string +diff --git a/third_party/waf/waflib/Context.py b/third_party/waf/waflib/Context.py +index 3222fb1551c..d0759aada58 100644 +--- a/third_party/waf/waflib/Context.py ++++ b/third_party/waf/waflib/Context.py +@@ -11,13 +11,13 @@ from waflib import Utils, Errors, Logs + import waflib.Node + + # the following 3 constants are updated on each new release (do not touch) +-HEXVERSION=0x2000800 ++HEXVERSION=0x2001100 + """Constant updated on new releases""" + +-WAFVERSION="2.0.8" ++WAFVERSION="2.0.17" + """Constant updated on new releases""" + +-WAFREVISION="f78fbc32bb355a3291c9b5f79bbe0c8dfe81282a" ++WAFREVISION="6bc6cb599c702e985780e9f705b291b812123693" + """Git revision when the waf version is updated""" + + ABI = 20 +@@ -266,7 +266,7 @@ class Context(ctx): + cache[node] = True + self.pre_recurse(node) + try: +- function_code = node.read('rU', encoding) ++ function_code = node.read('r', encoding) + exec(compile(function_code, node.abspath(), 'exec'), self.exec_dict) + finally: + self.post_recurse(node) +@@ -502,7 +502,7 @@ class Context(ctx): + def build(bld): + bld.to_log('starting the build') + +- Provide a logger on the context class or override this methid if necessary. ++ Provide a logger on the context class or override this method if necessary. + + :param msg: message + :type msg: string +@@ -613,7 +613,7 @@ class Context(ctx): + is typically called once for a programming language group, see for + example :py:mod:`waflib.Tools.compiler_c` + +- :param var: glob expression, for example 'cxx\_\*.py' ++ :param var: glob expression, for example 'cxx\\_\\*.py' + :type var: string + :param ban: list of exact file names to exclude + :type ban: list of string +@@ -662,7 +662,7 @@ def load_module(path, encoding=None): + + module = imp.new_module(WSCRIPT_FILE) + try: +- code = Utils.readf(path, m='rU', encoding=encoding) ++ code = Utils.readf(path, m='r', encoding=encoding) + except EnvironmentError: + raise Errors.WafError('Could not read the file %r' % path) + +@@ -678,7 +678,7 @@ def load_module(path, encoding=None): + + def load_tool(tool, tooldir=None, ctx=None, with_sys_path=True): + """ +- Importx a Waf tool as a python module, and stores it in the dict :py:const:`waflib.Context.Context.tools` ++ Imports a Waf tool as a python module, and stores it in the dict :py:const:`waflib.Context.Context.tools` + + :type tool: string + :param tool: Name of the tool +diff --git a/third_party/waf/waflib/Logs.py b/third_party/waf/waflib/Logs.py +index 2a475169b9b..298411db51e 100644 +--- a/third_party/waf/waflib/Logs.py ++++ b/third_party/waf/waflib/Logs.py +@@ -237,7 +237,10 @@ class formatter(logging.Formatter): + if rec.levelno >= logging.INFO: + # the goal of this is to format without the leading "Logs, hour" prefix + if rec.args: +- return msg % rec.args ++ try: ++ return msg % rec.args ++ except UnicodeDecodeError: ++ return msg.encode('utf-8') % rec.args + return msg + + rec.msg = msg +@@ -276,9 +279,9 @@ def error(*k, **kw): + + def warn(*k, **kw): + """ +- Wraps logging.warn ++ Wraps logging.warning + """ +- log.warn(*k, **kw) ++ log.warning(*k, **kw) + + def info(*k, **kw): + """ +diff --git a/third_party/waf/waflib/Node.py b/third_party/waf/waflib/Node.py +index 4ac1ea8a0b8..2ad18466970 100644 +--- a/third_party/waf/waflib/Node.py ++++ b/third_party/waf/waflib/Node.py +@@ -73,7 +73,7 @@ def ant_matcher(s, ignorecase): + if k == '**': + accu.append(k) + else: +- k = k.replace('.', '[.]').replace('*','.*').replace('?', '.').replace('+', '\\+') ++ k = k.replace('.', '[.]').replace('*', '.*').replace('?', '.').replace('+', '\\+') + k = '^%s$' % k + try: + exp = re.compile(k, flags=reflags) +@@ -595,7 +595,6 @@ class Node(object): + :rtype: iterator + """ + dircont = self.listdir() +- dircont.sort() + + try: + lst = set(self.children.keys()) +diff --git a/third_party/waf/waflib/Runner.py b/third_party/waf/waflib/Runner.py +index 7535c83de9e..91d55479e20 100644 +--- a/third_party/waf/waflib/Runner.py ++++ b/third_party/waf/waflib/Runner.py +@@ -37,6 +37,8 @@ class PriorityTasks(object): + return len(self.lst) + def __iter__(self): + return iter(self.lst) ++ def __str__(self): ++ return 'PriorityTasks: [%s]' % '\n '.join(str(x) for x in self.lst) + def clear(self): + self.lst = [] + def append(self, task): +@@ -181,10 +183,12 @@ class Parallel(object): + The reverse dependency graph of dependencies obtained from Task.run_after + """ + +- self.spawner = Spawner(self) ++ self.spawner = None + """ + Coordinating daemon thread that spawns thread consumers + """ ++ if self.numjobs > 1: ++ self.spawner = Spawner(self) + + def get_next_task(self): + """ +@@ -226,6 +230,10 @@ class Parallel(object): + pass + else: + if cond: ++ # The most common reason is conflicting build order declaration ++ # for example: "X run_after Y" and "Y run_after X" ++ # Another can be changing "run_after" dependencies while the build is running ++ # for example: updating "tsk.run_after" in the "runnable_status" method + lst = [] + for tsk in self.postponed: + deps = [id(x) for x in tsk.run_after if not x.hasrun] +@@ -250,6 +258,8 @@ class Parallel(object): + self.outstanding.append(x) + break + else: ++ if self.stop or self.error: ++ break + raise Errors.WafError('Broken revdeps detected on %r' % self.incomplete) + else: + tasks = next(self.biter) +@@ -298,6 +308,8 @@ class Parallel(object): + def mark_finished(self, tsk): + def try_unfreeze(x): + # DAG ancestors are likely to be in the incomplete set ++ # This assumes that the run_after contents have not changed ++ # after the build starts, else a deadlock may occur + if x in self.incomplete: + # TODO remove dependencies to free some memory? + # x.run_after.remove(tsk) +@@ -323,6 +335,19 @@ class Parallel(object): + try_unfreeze(x) + del self.revdeps[tsk] + ++ if hasattr(tsk, 'semaphore'): ++ sem = tsk.semaphore ++ try: ++ sem.release(tsk) ++ except KeyError: ++ # TODO ++ pass ++ else: ++ while sem.waiting and not sem.is_locked(): ++ # take a frozen task, make it ready to run ++ x = sem.waiting.pop() ++ self._add_task(x) ++ + def get_out(self): + """ + Waits for a Task that task consumers add to :py:attr:`waflib.Runner.Parallel.out` after execution. +@@ -346,8 +371,29 @@ class Parallel(object): + :param tsk: task instance + :type tsk: :py:attr:`waflib.Task.Task` + """ ++ # TODO change in waf 2.1 + self.ready.put(tsk) + ++ def _add_task(self, tsk): ++ if hasattr(tsk, 'semaphore'): ++ sem = tsk.semaphore ++ try: ++ sem.acquire(tsk) ++ except IndexError: ++ sem.waiting.add(tsk) ++ return ++ ++ self.count += 1 ++ self.processed += 1 ++ if self.numjobs == 1: ++ tsk.log_display(tsk.generator.bld) ++ try: ++ self.process_task(tsk) ++ finally: ++ self.out.put(tsk) ++ else: ++ self.add_task(tsk) ++ + def process_task(self, tsk): + """ + Processes a task and attempts to stop the build in case of errors +@@ -447,17 +493,7 @@ class Parallel(object): + + st = self.task_status(tsk) + if st == Task.RUN_ME: +- self.count += 1 +- self.processed += 1 +- +- if self.numjobs == 1: +- tsk.log_display(tsk.generator.bld) +- try: +- self.process_task(tsk) +- finally: +- self.out.put(tsk) +- else: +- self.add_task(tsk) ++ self._add_task(tsk) + elif st == Task.ASK_LATER: + self.postpone(tsk) + elif st == Task.SKIP_ME: +diff --git a/third_party/waf/waflib/Scripting.py b/third_party/waf/waflib/Scripting.py +index 18203d52701..ae17a8b4503 100644 +--- a/third_party/waf/waflib/Scripting.py ++++ b/third_party/waf/waflib/Scripting.py +@@ -122,7 +122,8 @@ def waf_entry_point(current_directory, version, wafdir): + if no_climb: + break + +- if not Context.run_dir: ++ wscript = os.path.normpath(os.path.join(Context.run_dir, Context.WSCRIPT_FILE)) ++ if not os.path.exists(wscript): + if options.whelp: + Logs.warn('These are the generic options (no wscript/project found)') + ctx.parser.print_help() +@@ -137,7 +138,7 @@ def waf_entry_point(current_directory, version, wafdir): + sys.exit(1) + + try: +- set_main_module(os.path.normpath(os.path.join(Context.run_dir, Context.WSCRIPT_FILE))) ++ set_main_module(wscript) + except Errors.WafError as e: + Logs.pprint('RED', e.verbose_msg) + Logs.error(str(e)) +@@ -215,7 +216,10 @@ def parse_options(): + ctx = Context.create_context('options') + ctx.execute() + if not Options.commands: +- Options.commands.append(default_cmd) ++ if isinstance(default_cmd, list): ++ Options.commands.extend(default_cmd) ++ else: ++ Options.commands.append(default_cmd) + if Options.options.whelp: + ctx.parser.print_help() + sys.exit(0) +@@ -279,7 +283,7 @@ def distclean_dir(dirname): + pass + + try: +- shutil.rmtree('c4che') ++ shutil.rmtree(Build.CACHE_DIR) + except OSError: + pass + +@@ -597,12 +601,15 @@ def autoconfigure(execute_method): + cmd = env.config_cmd or 'configure' + if Configure.autoconfig == 'clobber': + tmp = Options.options.__dict__ ++ launch_dir_tmp = Context.launch_dir + if env.options: + Options.options.__dict__ = env.options ++ Context.launch_dir = env.launch_dir + try: + run_command(cmd) + finally: + Options.options.__dict__ = tmp ++ Context.launch_dir = launch_dir_tmp + else: + run_command(cmd) + run_command(self.cmd) +diff --git a/third_party/waf/waflib/Task.py b/third_party/waf/waflib/Task.py +index c4642443f55..cb49a7394df 100644 +--- a/third_party/waf/waflib/Task.py ++++ b/third_party/waf/waflib/Task.py +@@ -50,6 +50,9 @@ def f(tsk): + bld = gen.bld + cwdx = tsk.get_cwd() + p = env.get_flat ++ def to_list(xx): ++ if isinstance(xx, str): return [xx] ++ return xx + tsk.last_cmd = cmd = \'\'\' %s \'\'\' % s + return tsk.exec_command(cmd, cwd=cwdx, env=env.env or None) + ''' +@@ -75,6 +78,20 @@ def f(tsk): + return tsk.exec_command(lst, cwd=cwdx, env=env.env or None) + ''' + ++COMPILE_TEMPLATE_SIG_VARS = ''' ++def f(tsk): ++ sig = tsk.generator.bld.hash_env_vars(tsk.env, tsk.vars) ++ tsk.m.update(sig) ++ env = tsk.env ++ gen = tsk.generator ++ bld = gen.bld ++ cwdx = tsk.get_cwd() ++ p = env.get_flat ++ buf = [] ++ %s ++ tsk.m.update(repr(buf).encode()) ++''' ++ + classes = {} + """ + The metaclass :py:class:`waflib.Task.store_task_type` stores all class tasks +@@ -101,8 +118,13 @@ class store_task_type(type): + # change the name of run_str or it is impossible to subclass with a function + cls.run_str = None + cls.run = f ++ # process variables + cls.vars = list(set(cls.vars + dvars)) + cls.vars.sort() ++ if cls.vars: ++ fun = compile_sig_vars(cls.vars) ++ if fun: ++ cls.sig_vars = fun + elif getattr(cls, 'run', None) and not 'hcode' in cls.__dict__: + # getattr(cls, 'hcode') would look in the upper classes + cls.hcode = Utils.h_cmd(cls.run) +@@ -115,10 +137,12 @@ evil = store_task_type('evil', (object,), {}) + + class Task(evil): + """ +- This class deals with the filesystem (:py:class:`waflib.Node.Node`). The method :py:class:`waflib.Task.Task.runnable_status` +- uses a hash value (from :py:class:`waflib.Task.Task.signature`) which is persistent from build to build. When the value changes, +- the task has to be executed. The method :py:class:`waflib.Task.Task.post_run` will assign the task signature to the output +- nodes (if present). ++ Task objects represents actions to perform such as commands to execute by calling the `run` method. ++ ++ Detecting when to execute a task occurs in the method :py:meth:`waflib.Task.Task.runnable_status`. ++ ++ Detecting which tasks to execute is performed through a hash value returned by ++ :py:meth:`waflib.Task.Task.signature`. The task signature is persistent from build to build. + """ + vars = [] + """ConfigSet variables that should trigger a rebuild (class attribute used for :py:meth:`waflib.Task.Task.sig_vars`)""" +@@ -139,10 +163,10 @@ class Task(evil): + """File extensions that objects of this task class may create""" + + before = [] +- """List of task class names to execute before instances of this class""" ++ """The instances of this class are executed before the instances of classes whose names are in this list""" + + after = [] +- """List of task class names to execute after instances of this class""" ++ """The instances of this class are executed after the instances of classes whose names are in this list""" + + hcode = Utils.SIG_NIL + """String representing an additional hash for the class representation""" +@@ -282,25 +306,31 @@ class Task(evil): + if hasattr(self, 'stderr'): + kw['stderr'] = self.stderr + +- # workaround for command line length limit: +- # http://support.microsoft.com/kb/830473 +- if not isinstance(cmd, str) and (len(repr(cmd)) >= 8192 if Utils.is_win32 else len(cmd) > 200000): +- cmd, args = self.split_argfile(cmd) +- try: +- (fd, tmp) = tempfile.mkstemp() +- os.write(fd, '\r\n'.join(args).encode()) +- os.close(fd) +- if Logs.verbose: +- Logs.debug('argfile: @%r -> %r', tmp, args) +- return self.generator.bld.exec_command(cmd + ['@' + tmp], **kw) +- finally: ++ if not isinstance(cmd, str): ++ if Utils.is_win32: ++ # win32 compares the resulting length http://support.microsoft.com/kb/830473 ++ too_long = sum([len(arg) for arg in cmd]) + len(cmd) > 8192 ++ else: ++ # non-win32 counts the amount of arguments (200k) ++ too_long = len(cmd) > 200000 ++ ++ if too_long and getattr(self, 'allow_argsfile', True): ++ # Shunt arguments to a temporary file if the command is too long. ++ cmd, args = self.split_argfile(cmd) + try: +- os.remove(tmp) +- except OSError: +- # anti-virus and indexers can keep files open -_- +- pass +- else: +- return self.generator.bld.exec_command(cmd, **kw) ++ (fd, tmp) = tempfile.mkstemp() ++ os.write(fd, '\r\n'.join(args).encode()) ++ os.close(fd) ++ if Logs.verbose: ++ Logs.debug('argfile: @%r -> %r', tmp, args) ++ return self.generator.bld.exec_command(cmd + ['@' + tmp], **kw) ++ finally: ++ try: ++ os.remove(tmp) ++ except OSError: ++ # anti-virus and indexers can keep files open -_- ++ pass ++ return self.generator.bld.exec_command(cmd, **kw) + + def process(self): + """ +@@ -572,6 +602,9 @@ class Task(evil): + """ + Run this task only after the given *task*. + ++ Calling this method from :py:meth:`waflib.Task.Task.runnable_status` may cause ++ build deadlocks; see :py:meth:`waflib.Tools.fc.fc.runnable_status` for details. ++ + :param task: task + :type task: :py:class:`waflib.Task.Task` + """ +@@ -751,6 +784,10 @@ class Task(evil): + def sig_vars(self): + """ + Used by :py:meth:`waflib.Task.Task.signature`; it hashes :py:attr:`waflib.Task.Task.env` variables/values ++ When overriding this method, and if scriptlet expressions are used, make sure to follow ++ the code in :py:meth:`waflib.Task.Task.compile_sig_vars` to enable dependencies on scriptlet results. ++ ++ This method may be replaced on subclasses by the metaclass to force dependencies on scriptlet code. + """ + sig = self.generator.bld.hash_env_vars(self.env, self.vars) + self.m.update(sig) +@@ -1013,7 +1050,7 @@ def funex(c): + exec(c, dc) + return dc['f'] + +-re_cond = re.compile('(?P\w+)|(?P\|)|(?P&)') ++re_cond = re.compile(r'(?P\w+)|(?P\|)|(?P&)') + re_novar = re.compile(r'^(SRC|TGT)\W+.*?$') + reg_act = re.compile(r'(?P\\)|(?P\$\$)|(?P\$\{(?P\w+)(?P.*?)\})', re.M) + def compile_fun_shell(line): +@@ -1033,6 +1070,9 @@ def compile_fun_shell(line): + return None + line = reg_act.sub(repl, line) or line + dvars = [] ++ def add_dvar(x): ++ if x not in dvars: ++ dvars.append(x) + + def replc(m): + # performs substitutions and populates dvars +@@ -1042,8 +1082,7 @@ def compile_fun_shell(line): + return ' or ' + else: + x = m.group('var') +- if x not in dvars: +- dvars.append(x) ++ add_dvar(x) + return 'env[%r]' % x + + parm = [] +@@ -1061,8 +1100,7 @@ def compile_fun_shell(line): + app('" ".join([a.path_from(cwdx) for a in tsk.outputs])') + elif meth: + if meth.startswith(':'): +- if var not in dvars: +- dvars.append(var) ++ add_dvar(var) + m = meth[1:] + if m == 'SRC': + m = '[a.path_from(cwdx) for a in tsk.inputs]' +@@ -1072,19 +1110,21 @@ def compile_fun_shell(line): + m = '[tsk.inputs%s]' % m[3:] + elif re_novar.match(m): + m = '[tsk.outputs%s]' % m[3:] +- elif m[:3] not in ('tsk', 'gen', 'bld'): +- dvars.append(meth[1:]) +- m = '%r' % m ++ else: ++ add_dvar(m) ++ if m[:3] not in ('tsk', 'gen', 'bld'): ++ m = '%r' % m + app('" ".join(tsk.colon(%r, %s))' % (var, m)) + elif meth.startswith('?'): + # In A?B|C output env.A if one of env.B or env.C is non-empty + expr = re_cond.sub(replc, meth[1:]) + app('p(%r) if (%s) else ""' % (var, expr)) + else: +- app('%s%s' % (var, meth)) ++ call = '%s%s' % (var, meth) ++ add_dvar(call) ++ app(call) + else: +- if var not in dvars: +- dvars.append(var) ++ add_dvar(var) + app("p('%s')" % var) + if parm: + parm = "%% (%s) " % (',\n\t\t'.join(parm)) +@@ -1105,6 +1145,10 @@ def compile_fun_noshell(line): + merge = False + app = buf.append + ++ def add_dvar(x): ++ if x not in dvars: ++ dvars.append(x) ++ + def replc(m): + # performs substitutions and populates dvars + if m.group('and'): +@@ -1113,8 +1157,7 @@ def compile_fun_noshell(line): + return ' or ' + else: + x = m.group('var') +- if x not in dvars: +- dvars.append(x) ++ add_dvar(x) + return 'env[%r]' % x + + for m in reg_act_noshell.finditer(line): +@@ -1139,8 +1182,7 @@ def compile_fun_noshell(line): + elif code: + if code.startswith(':'): + # a composed variable ${FOO:OUT} +- if not var in dvars: +- dvars.append(var) ++ add_dvar(var) + m = code[1:] + if m == 'SRC': + m = '[a.path_from(cwdx) for a in tsk.inputs]' +@@ -1150,9 +1192,10 @@ def compile_fun_noshell(line): + m = '[tsk.inputs%s]' % m[3:] + elif re_novar.match(m): + m = '[tsk.outputs%s]' % m[3:] +- elif m[:3] not in ('tsk', 'gen', 'bld'): +- dvars.append(m) +- m = '%r' % m ++ else: ++ add_dvar(m) ++ if m[:3] not in ('tsk', 'gen', 'bld'): ++ m = '%r' % m + app('tsk.colon(%r, %s)' % (var, m)) + elif code.startswith('?'): + # In A?B|C output env.A if one of env.B or env.C is non-empty +@@ -1160,12 +1203,13 @@ def compile_fun_noshell(line): + app('to_list(env[%r] if (%s) else [])' % (var, expr)) + else: + # plain code such as ${tsk.inputs[0].abspath()} +- app('gen.to_list(%s%s)' % (var, code)) ++ call = '%s%s' % (var, code) ++ add_dvar(call) ++ app('to_list(%s)' % call) + else: + # a plain variable such as # a plain variable like ${AR} + app('to_list(env[%r])' % var) +- if not var in dvars: +- dvars.append(var) ++ add_dvar(var) + if merge: + tmp = 'merge(%s, %s)' % (buf[-2], buf[-1]) + del buf[-1] +@@ -1222,6 +1266,36 @@ def compile_fun(line, shell=False): + else: + return compile_fun_noshell(line) + ++def compile_sig_vars(vars): ++ """ ++ This method produces a sig_vars method suitable for subclasses that provide ++ scriptlet code in their run_str code. ++ If no such method can be created, this method returns None. ++ ++ The purpose of the sig_vars method returned is to ensures ++ that rebuilds occur whenever the contents of the expression changes. ++ This is the case B below:: ++ ++ import time ++ # case A: regular variables ++ tg = bld(rule='echo ${FOO}') ++ tg.env.FOO = '%s' % time.time() ++ # case B ++ bld(rule='echo ${gen.foo}', foo='%s' % time.time()) ++ ++ :param vars: env variables such as CXXFLAGS or gen.foo ++ :type vars: list of string ++ :return: A sig_vars method relevant for dependencies if adequate, else None ++ :rtype: A function, or None in most cases ++ """ ++ buf = [] ++ for x in sorted(vars): ++ if x[:3] in ('tsk', 'gen', 'bld'): ++ buf.append('buf.append(%s)' % x) ++ if buf: ++ return funex(COMPILE_TEMPLATE_SIG_VARS % '\n\t'.join(buf)) ++ return None ++ + def task_factory(name, func=None, vars=None, color='GREEN', ext_in=[], ext_out=[], before=[], after=[], shell=False, scan=None): + """ + Returns a new task subclass with the function ``run`` compiled from the line given. +@@ -1279,3 +1353,54 @@ def deep_inputs(cls): + TaskBase = Task + "Provided for compatibility reasons, TaskBase should not be used" + ++class TaskSemaphore(object): ++ """ ++ Task semaphores provide a simple and efficient way of throttling the amount of ++ a particular task to run concurrently. The throttling value is capped ++ by the amount of maximum jobs, so for example, a `TaskSemaphore(10)` ++ has no effect in a `-j2` build. ++ ++ Task semaphores are typically specified on the task class level:: ++ ++ class compile(waflib.Task.Task): ++ semaphore = waflib.Task.TaskSemaphore(2) ++ run_str = 'touch ${TGT}' ++ ++ Task semaphores are meant to be used by the build scheduler in the main ++ thread, so there are no guarantees of thread safety. ++ """ ++ def __init__(self, num): ++ """ ++ :param num: maximum value of concurrent tasks ++ :type num: int ++ """ ++ self.num = num ++ self.locking = set() ++ self.waiting = set() ++ ++ def is_locked(self): ++ """Returns True if this semaphore cannot be acquired by more tasks""" ++ return len(self.locking) >= self.num ++ ++ def acquire(self, tsk): ++ """ ++ Mark the semaphore as used by the given task (not re-entrant). ++ ++ :param tsk: task object ++ :type tsk: :py:class:`waflib.Task.Task` ++ :raises: :py:class:`IndexError` in case the resource is already acquired ++ """ ++ if self.is_locked(): ++ raise IndexError('Cannot lock more %r' % self.locking) ++ self.locking.add(tsk) ++ ++ def release(self, tsk): ++ """ ++ Mark the semaphore as unused by the given task. ++ ++ :param tsk: task object ++ :type tsk: :py:class:`waflib.Task.Task` ++ :raises: :py:class:`KeyError` in case the resource is not acquired by the task ++ """ ++ self.locking.remove(tsk) ++ +diff --git a/third_party/waf/waflib/TaskGen.py b/third_party/waf/waflib/TaskGen.py +index 40007b55ca7..532b7d5cdb4 100644 +--- a/third_party/waf/waflib/TaskGen.py ++++ b/third_party/waf/waflib/TaskGen.py +@@ -74,7 +74,7 @@ class task_gen(object): + else: + self.bld = kw['bld'] + self.env = self.bld.env.derive() +- self.path = self.bld.path # emulate chdir when reading scripts ++ self.path = kw.get('path', self.bld.path) # by default, emulate chdir when reading scripts + + # Provide a unique index per folder + # This is part of a measure to prevent output file name collisions +@@ -556,7 +556,7 @@ def process_rule(self): + * chmod: permissions for the resulting files (integer value such as Utils.O755) + * shell: set to False to execute the command directly (default is True to use a shell) + * scan: scanner function +- * vars: list of variables to trigger rebuilts, such as CFLAGS ++ * vars: list of variables to trigger rebuilds, such as CFLAGS + * cls_str: string to display when executing the task + * cls_keyword: label to display when executing the task + * cache_rule: by default, try to re-use similar classes, set to False to disable +@@ -727,7 +727,7 @@ def sequence_order(self): + self.bld.prev = self + + +-re_m4 = re.compile('@(\w+)@', re.M) ++re_m4 = re.compile(r'@(\w+)@', re.M) + + class subst_pc(Task.Task): + """ +diff --git a/third_party/waf/waflib/Tools/c_config.py b/third_party/waf/waflib/Tools/c_config.py +index 76082152cd9..d546be95614 100644 +--- a/third_party/waf/waflib/Tools/c_config.py ++++ b/third_party/waf/waflib/Tools/c_config.py +@@ -250,9 +250,9 @@ def exec_cfg(self, kw): + :type atleast_pkgconfig_version: string + :param package: package name, for example *gtk+-2.0* + :type package: string +- :param uselib_store: if the test is successful, define HAVE\_*name*. It is also used to define *conf.env.FLAGS_name* variables. ++ :param uselib_store: if the test is successful, define HAVE\\_*name*. It is also used to define *conf.env.FLAGS_name* variables. + :type uselib_store: string +- :param modversion: if provided, return the version of the given module and define *name*\_VERSION ++ :param modversion: if provided, return the version of the given module and define *name*\\_VERSION + :type modversion: string + :param args: arguments to give to *package* when retrieving flags + :type args: list of string +@@ -358,13 +358,12 @@ def check_cfg(self, *k, **kw): + ret = None + try: + ret = self.exec_cfg(kw) +- except self.errors.WafError: ++ except self.errors.WafError as e: + if 'errmsg' in kw: + self.end_msg(kw['errmsg'], 'YELLOW', **kw) + if Logs.verbose > 1: +- raise +- else: +- self.fatal('The configuration failed') ++ self.to_log('Command failure: %s' % e) ++ self.fatal('The configuration failed') + else: + if not ret: + ret = True +diff --git a/third_party/waf/waflib/Tools/c_preproc.py b/third_party/waf/waflib/Tools/c_preproc.py +index c2c239baa26..68e5f5aea29 100644 +--- a/third_party/waf/waflib/Tools/c_preproc.py ++++ b/third_party/waf/waflib/Tools/c_preproc.py +@@ -75,13 +75,13 @@ re_lines = re.compile( + re.IGNORECASE | re.MULTILINE) + """Match #include lines""" + +-re_mac = re.compile("^[a-zA-Z_]\w*") ++re_mac = re.compile(r"^[a-zA-Z_]\w*") + """Match macro definitions""" + + re_fun = re.compile('^[a-zA-Z_][a-zA-Z0-9_]*[(]') + """Match macro functions""" + +-re_pragma_once = re.compile('^\s*once\s*', re.IGNORECASE) ++re_pragma_once = re.compile(r'^\s*once\s*', re.IGNORECASE) + """Match #pragma once statements""" + + re_nl = re.compile('\\\\\r*\n', re.MULTILINE) +@@ -146,7 +146,7 @@ def repl(m): + + prec = {} + """ +-Operator precendence rules required for parsing expressions of the form:: ++Operator precedence rules required for parsing expressions of the form:: + + #if 1 && 2 != 0 + """ +@@ -660,7 +660,7 @@ def extract_macro(txt): + # empty define, assign an empty token + return (v, [[], [('T','')]]) + +-re_include = re.compile('^\s*(<(?:.*)>|"(?:.*)")') ++re_include = re.compile(r'^\s*(<(?:.*)>|"(?:.*)")') + def extract_include(txt, defs): + """ + Process a line in the form:: +diff --git a/third_party/waf/waflib/Tools/ccroot.py b/third_party/waf/waflib/Tools/ccroot.py +index 394f36b8e12..579d5b2b72b 100644 +--- a/third_party/waf/waflib/Tools/ccroot.py ++++ b/third_party/waf/waflib/Tools/ccroot.py +@@ -111,7 +111,7 @@ def apply_incpaths(self): + tg = bld(features='includes', includes='.') + + The folders only need to be relative to the current directory, the equivalent build directory is +- added automatically (for headers created in the build directory). This enable using a build directory ++ added automatically (for headers created in the build directory). This enables using a build directory + or not (``top == out``). + + This method will add a list of nodes read by :py:func:`waflib.Tools.ccroot.to_incnodes` in ``tg.env.INCPATHS``, +@@ -161,7 +161,7 @@ class link_task(Task.Task): + nums = self.generator.vnum.split('.') + if self.env.DEST_BINFMT == 'pe': + # include the version in the dll file name, +- # the import lib file name stays unversionned. ++ # the import lib file name stays unversioned. + name = name + '-' + nums[0] + elif self.env.DEST_OS == 'openbsd': + pattern = '%s.%s' % (pattern, nums[0]) +@@ -238,6 +238,17 @@ def rm_tgt(cls): + setattr(cls, 'run', wrap) + rm_tgt(stlink_task) + ++@feature('skip_stlib_link_deps') ++@before_method('process_use') ++def apply_skip_stlib_link_deps(self): ++ """ ++ This enables an optimization in the :py:func:wafilb.Tools.ccroot.processes_use: method that skips dependency and ++ link flag optimizations for targets that generate static libraries (via the :py:class:Tools.ccroot.stlink_task task). ++ The actual behavior is implemented in :py:func:wafilb.Tools.ccroot.processes_use: method so this feature only tells waf ++ to enable the new behavior. ++ """ ++ self.env.SKIP_STLIB_LINK_DEPS = True ++ + @feature('c', 'cxx', 'd', 'fc', 'asm') + @after_method('process_source') + def apply_link(self): +@@ -386,7 +397,11 @@ def process_use(self): + y = self.bld.get_tgen_by_name(x) + var = y.tmp_use_var + if var and link_task: +- if var == 'LIB' or y.tmp_use_stlib or x in names: ++ if self.env.SKIP_STLIB_LINK_DEPS and isinstance(link_task, stlink_task): ++ # If the skip_stlib_link_deps feature is enabled then we should ++ # avoid adding lib deps to the stlink_task instance. ++ pass ++ elif var == 'LIB' or y.tmp_use_stlib or x in names: + self.env.append_value(var, [y.target[y.target.rfind(os.sep) + 1:]]) + self.link_task.dep_nodes.extend(y.link_task.outputs) + tmp_path = y.link_task.outputs[0].parent.path_from(self.get_cwd()) +@@ -600,6 +615,7 @@ def apply_vnum(self): + + if getattr(self, 'install_task', None): + self.install_task.hasrun = Task.SKIPPED ++ self.install_task.no_errcheck_out = True + path = self.install_task.install_to + if self.env.DEST_OS == 'openbsd': + libname = self.link_task.outputs[0].name +diff --git a/third_party/waf/waflib/Tools/d_scan.py b/third_party/waf/waflib/Tools/d_scan.py +index 14c6c313e9a..4e807a6b9fc 100644 +--- a/third_party/waf/waflib/Tools/d_scan.py ++++ b/third_party/waf/waflib/Tools/d_scan.py +@@ -93,8 +93,8 @@ class d_parser(object): + + self.allnames = [] + +- self.re_module = re.compile("module\s+([^;]+)") +- self.re_import = re.compile("import\s+([^;]+)") ++ self.re_module = re.compile(r"module\s+([^;]+)") ++ self.re_import = re.compile(r"import\s+([^;]+)") + self.re_import_bindings = re.compile("([^:]+):(.*)") + self.re_import_alias = re.compile("[^=]+=(.+)") + +@@ -138,7 +138,7 @@ class d_parser(object): + + mod_name = self.re_module.search(code) + if mod_name: +- self.module = re.sub('\s+', '', mod_name.group(1)) # strip all whitespaces ++ self.module = re.sub(r'\s+', '', mod_name.group(1)) # strip all whitespaces + + # go through the code, have a look at all import occurrences + +@@ -146,7 +146,7 @@ class d_parser(object): + import_iterator = self.re_import.finditer(code) + if import_iterator: + for import_match in import_iterator: +- import_match_str = re.sub('\s+', '', import_match.group(1)) # strip all whitespaces ++ import_match_str = re.sub(r'\s+', '', import_match.group(1)) # strip all whitespaces + + # does this end with an import bindings declaration? + # (import bindings always terminate the list of imports) +diff --git a/third_party/waf/waflib/Tools/fc.py b/third_party/waf/waflib/Tools/fc.py +index 621eb5029df..fd4d39c90ae 100644 +--- a/third_party/waf/waflib/Tools/fc.py ++++ b/third_party/waf/waflib/Tools/fc.py +@@ -28,10 +28,24 @@ def modfile(conf, name): + Turns a module name into the right module file name. + Defaults to all lower case. + """ +- return {'lower' :name.lower() + '.mod', +- 'lower.MOD' :name.lower() + '.MOD', +- 'UPPER.mod' :name.upper() + '.mod', +- 'UPPER' :name.upper() + '.MOD'}[conf.env.FC_MOD_CAPITALIZATION or 'lower'] ++ if name.find(':') >= 0: ++ # Depending on a submodule! ++ separator = conf.env.FC_SUBMOD_SEPARATOR or '@' ++ # Ancestors of the submodule will be prefixed to the ++ # submodule name, separated by a colon. ++ modpath = name.split(':') ++ # Only the ancestor (actual) module and the submodule name ++ # will be used for the filename. ++ modname = modpath[0] + separator + modpath[-1] ++ suffix = conf.env.FC_SUBMOD_SUFFIX or '.smod' ++ else: ++ modname = name ++ suffix = '.mod' ++ ++ return {'lower' :modname.lower() + suffix.lower(), ++ 'lower.MOD' :modname.lower() + suffix.upper(), ++ 'UPPER.mod' :modname.upper() + suffix.lower(), ++ 'UPPER' :modname.upper() + suffix.upper()}[conf.env.FC_MOD_CAPITALIZATION or 'lower'] + + def get_fortran_tasks(tsk): + """ +@@ -121,6 +135,8 @@ class fc(Task.Task): + for k in ins.keys(): + for a in ins[k]: + a.run_after.update(outs[k]) ++ for x in outs[k]: ++ self.generator.bld.producer.revdeps[x].add(a) + + # the scanner cannot output nodes, so we have to set them + # ourselves as task.dep_nodes (additional input nodes) +diff --git a/third_party/waf/waflib/Tools/fc_config.py b/third_party/waf/waflib/Tools/fc_config.py +index 0df460b5d1e..dc5e5c9e9a2 100644 +--- a/third_party/waf/waflib/Tools/fc_config.py ++++ b/third_party/waf/waflib/Tools/fc_config.py +@@ -178,8 +178,8 @@ def check_fortran_dummy_main(self, *k, **kw): + # ------------------------------------------------------------------------ + + GCC_DRIVER_LINE = re.compile('^Driving:') +-POSIX_STATIC_EXT = re.compile('\S+\.a') +-POSIX_LIB_FLAGS = re.compile('-l\S+') ++POSIX_STATIC_EXT = re.compile(r'\S+\.a') ++POSIX_LIB_FLAGS = re.compile(r'-l\S+') + + @conf + def is_link_verbose(self, txt): +@@ -281,7 +281,7 @@ def _parse_flink_token(lexer, token, tmp_flags): + elif POSIX_LIB_FLAGS.match(token): + tmp_flags.append(token) + else: +- # ignore anything not explicitely taken into account ++ # ignore anything not explicitly taken into account + pass + + t = lexer.get_token() +diff --git a/third_party/waf/waflib/Tools/fc_scan.py b/third_party/waf/waflib/Tools/fc_scan.py +index 12cb0fc041e..0824c92b7ee 100644 +--- a/third_party/waf/waflib/Tools/fc_scan.py ++++ b/third_party/waf/waflib/Tools/fc_scan.py +@@ -5,13 +5,15 @@ + + import re + +-INC_REGEX = """(?:^|['">]\s*;)\s*(?:|#\s*)INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])""" +-USE_REGEX = """(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)""" +-MOD_REGEX = """(?:^|;)\s*MODULE(?!\s*PROCEDURE)(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)""" ++INC_REGEX = r"""(?:^|['">]\s*;)\s*(?:|#\s*)INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])""" ++USE_REGEX = r"""(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)""" ++MOD_REGEX = r"""(?:^|;)\s*MODULE(?!\s+(?:PROCEDURE|SUBROUTINE|FUNCTION))\s+(\w+)""" ++SMD_REGEX = r"""(?:^|;)\s*SUBMODULE\s*\(([\w:]+)\)\s*(\w+)""" + + re_inc = re.compile(INC_REGEX, re.I) + re_use = re.compile(USE_REGEX, re.I) + re_mod = re.compile(MOD_REGEX, re.I) ++re_smd = re.compile(SMD_REGEX, re.I) + + class fortran_parser(object): + """ +@@ -58,6 +60,10 @@ class fortran_parser(object): + m = re_mod.search(line) + if m: + mods.append(m.group(1)) ++ m = re_smd.search(line) ++ if m: ++ uses.append(m.group(1)) ++ mods.append('{0}:{1}'.format(m.group(1),m.group(2))) + return (incs, uses, mods) + + def start(self, node): +diff --git a/third_party/waf/waflib/Tools/ifort.py b/third_party/waf/waflib/Tools/ifort.py +index 74934f3f661..17d3052910f 100644 +--- a/third_party/waf/waflib/Tools/ifort.py ++++ b/third_party/waf/waflib/Tools/ifort.py +@@ -107,7 +107,7 @@ def gather_ifort_versions(conf, versions): + """ + List compiler versions by looking up registry keys + """ +- version_pattern = re.compile('^...?.?\....?.?') ++ version_pattern = re.compile(r'^...?.?\....?.?') + try: + all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Compilers\\Fortran') + except OSError: +diff --git a/third_party/waf/waflib/Tools/javaw.py b/third_party/waf/waflib/Tools/javaw.py +index f6fd20cc689..fd1cf469abf 100644 +--- a/third_party/waf/waflib/Tools/javaw.py ++++ b/third_party/waf/waflib/Tools/javaw.py +@@ -24,12 +24,95 @@ You would have to run:: + java -jar /path/to/jython.jar waf configure + + [1] http://www.jython.org/ ++ ++Usage ++===== ++ ++Load the "java" tool. ++ ++def configure(conf): ++ conf.load('java') ++ ++Java tools will be autodetected and eventually, if present, the quite ++standard JAVA_HOME environment variable will be used. The also standard ++CLASSPATH variable is used for library searching. ++ ++In configuration phase checks can be done on the system environment, for ++example to check if a class is known in the classpath:: ++ ++ conf.check_java_class('java.io.FileOutputStream') ++ ++or if the system supports JNI applications building:: ++ ++ conf.check_jni_headers() ++ ++ ++The java tool supports compiling java code, creating jar files and ++creating javadoc documentation. This can be either done separately or ++together in a single definition. For example to manage them separately:: ++ ++ bld(features = 'javac', ++ srcdir = 'src', ++ compat = '1.7', ++ use = 'animals', ++ name = 'cats-src', ++ ) ++ ++ bld(features = 'jar', ++ basedir = '.', ++ destfile = '../cats.jar', ++ name = 'cats', ++ use = 'cats-src' ++ ) ++ ++ ++Or together by defining all the needed attributes:: ++ ++ bld(features = 'javac jar javadoc', ++ srcdir = 'src/', # folder containing the sources to compile ++ outdir = 'src', # folder where to output the classes (in the build directory) ++ compat = '1.6', # java compatibility version number ++ classpath = ['.', '..'], ++ ++ # jar ++ basedir = 'src', # folder containing the classes and other files to package (must match outdir) ++ destfile = 'foo.jar', # do not put the destfile in the folder of the java classes! ++ use = 'NNN', ++ jaropts = ['-C', 'default/src/', '.'], # can be used to give files ++ manifest = 'src/Manifest.mf', # Manifest file to include ++ ++ # javadoc ++ javadoc_package = ['com.meow' , 'com.meow.truc.bar', 'com.meow.truc.foo'], ++ javadoc_output = 'javadoc', ++ ) ++ ++External jar dependencies can be mapped to a standard waf "use" dependency by ++setting an environment variable with a CLASSPATH prefix in the configuration, ++for example:: ++ ++ conf.env.CLASSPATH_NNN = ['aaaa.jar', 'bbbb.jar'] ++ ++and then NNN can be freely used in rules as:: ++ ++ use = 'NNN', ++ ++In the java tool the dependencies via use are not transitive by default, as ++this necessity depends on the code. To enable recursive dependency scanning ++use on a specific rule: ++ ++ recurse_use = True ++ ++Or build-wise by setting RECURSE_JAVA: ++ ++ bld.env.RECURSE_JAVA = True ++ ++Unit tests can be integrated in the waf unit test environment using the javatest extra. + """ + + import os, shutil + from waflib import Task, Utils, Errors, Node + from waflib.Configure import conf +-from waflib.TaskGen import feature, before_method, after_method ++from waflib.TaskGen import feature, before_method, after_method, taskgen_method + + from waflib.Tools import ccroot + ccroot.USELIB_VARS['javac'] = set(['CLASSPATH', 'JAVACFLAGS']) +@@ -107,6 +190,37 @@ def apply_java(self): + if names: + tsk.env.append_value('JAVACFLAGS', ['-sourcepath', names]) + ++ ++@taskgen_method ++def java_use_rec(self, name, **kw): ++ """ ++ Processes recursively the *use* attribute for each referred java compilation ++ """ ++ if name in self.tmp_use_seen: ++ return ++ ++ self.tmp_use_seen.append(name) ++ ++ try: ++ y = self.bld.get_tgen_by_name(name) ++ except Errors.WafError: ++ self.uselib.append(name) ++ return ++ else: ++ y.post() ++ # Add generated JAR name for CLASSPATH. Task ordering (set_run_after) ++ # is already guaranteed by ordering done between the single tasks ++ if hasattr(y, 'jar_task'): ++ self.use_lst.append(y.jar_task.outputs[0].abspath()) ++ else: ++ if hasattr(y,'outdir'): ++ self.use_lst.append(y.outdir.abspath()) ++ else: ++ self.use_lst.append(y.path.get_bld().abspath()) ++ ++ for x in self.to_list(getattr(y, 'use', [])): ++ self.java_use_rec(x) ++ + @feature('javac') + @before_method('propagate_uselib_vars') + @after_method('apply_java') +@@ -114,24 +228,39 @@ def use_javac_files(self): + """ + Processes the *use* attribute referring to other java compilations + """ +- lst = [] ++ self.use_lst = [] ++ self.tmp_use_seen = [] + self.uselib = self.to_list(getattr(self, 'uselib', [])) + names = self.to_list(getattr(self, 'use', [])) + get = self.bld.get_tgen_by_name + for x in names: + try: +- y = get(x) ++ tg = get(x) + except Errors.WafError: + self.uselib.append(x) + else: +- y.post() +- if hasattr(y, 'jar_task'): +- lst.append(y.jar_task.outputs[0].abspath()) +- self.javac_task.set_run_after(y.jar_task) ++ tg.post() ++ if hasattr(tg, 'jar_task'): ++ self.use_lst.append(tg.jar_task.outputs[0].abspath()) ++ self.javac_task.set_run_after(tg.jar_task) ++ self.javac_task.dep_nodes.extend(tg.jar_task.outputs) + else: +- for tsk in y.tasks: ++ if hasattr(tg, 'outdir'): ++ base_node = tg.outdir.abspath() ++ else: ++ base_node = tg.path.get_bld() ++ ++ self.use_lst.append(base_node.abspath()) ++ self.javac_task.dep_nodes.extend([x for x in base_node.ant_glob(JAR_RE, remove=False, quiet=True)]) ++ ++ for tsk in tg.tasks: + self.javac_task.set_run_after(tsk) +- self.env.append_value('CLASSPATH', lst) ++ ++ # If recurse use scan is enabled recursively add use attribute for each used one ++ if getattr(self, 'recurse_use', False) or self.bld.env.RECURSE_JAVA: ++ self.java_use_rec(x) ++ ++ self.env.append_value('CLASSPATH', self.use_lst) + + @feature('javac') + @after_method('apply_java', 'propagate_uselib_vars', 'use_javac_files') +@@ -245,7 +374,7 @@ class jar_create(JTask): + return Task.ASK_LATER + if not self.inputs: + try: +- self.inputs = [x for x in self.basedir.ant_glob(JAR_RE, remove=False) if id(x) != id(self.outputs[0])] ++ self.inputs = [x for x in self.basedir.ant_glob(JAR_RE, remove=False, quiet=True) if id(x) != id(self.outputs[0])] + except Exception: + raise Errors.WafError('Could not find the basedir %r for %r' % (self.basedir, self)) + return super(jar_create, self).runnable_status() +@@ -279,14 +408,14 @@ class javac(JTask): + self.inputs = [] + for x in self.srcdir: + if x.exists(): +- self.inputs.extend(x.ant_glob(SOURCE_RE, remove=False)) ++ self.inputs.extend(x.ant_glob(SOURCE_RE, remove=False, quiet=True)) + return super(javac, self).runnable_status() + + def post_run(self): + """ + List class files created + """ +- for node in self.generator.outdir.ant_glob('**/*.class'): ++ for node in self.generator.outdir.ant_glob('**/*.class', quiet=True): + self.generator.bld.node_sigs[node] = self.uid() + self.generator.bld.task_sigs[self.uid()] = self.cache_sig + +@@ -338,7 +467,7 @@ class javadoc(Task.Task): + self.generator.bld.cmd_and_log(lst, cwd=wd, env=env.env or None, quiet=0) + + def post_run(self): +- nodes = self.generator.javadoc_output.ant_glob('**') ++ nodes = self.generator.javadoc_output.ant_glob('**', quiet=True) + for node in nodes: + self.generator.bld.node_sigs[node] = self.uid() + self.generator.bld.task_sigs[self.uid()] = self.cache_sig +@@ -356,7 +485,7 @@ def configure(self): + self.env.JAVA_HOME = [self.environ['JAVA_HOME']] + + for x in 'javac java jar javadoc'.split(): +- self.find_program(x, var=x.upper(), path_list=java_path) ++ self.find_program(x, var=x.upper(), path_list=java_path, mandatory=(x not in ('javadoc'))) + + if 'CLASSPATH' in self.environ: + v.CLASSPATH = self.environ['CLASSPATH'] +diff --git a/third_party/waf/waflib/Tools/md5_tstamp.py b/third_party/waf/waflib/Tools/md5_tstamp.py +index 6428e46024e..d1569fa9ec1 100644 +--- a/third_party/waf/waflib/Tools/md5_tstamp.py ++++ b/third_party/waf/waflib/Tools/md5_tstamp.py +@@ -2,8 +2,10 @@ + # encoding: utf-8 + + """ +-Re-calculate md5 hashes of files only when the file times or the file +-size have changed. ++Re-calculate md5 hashes of files only when the file time have changed:: ++ ++ def options(opt): ++ opt.load('md5_tstamp') + + The hashes can also reflect either the file contents (STRONGEST=True) or the + file time and file size. +diff --git a/third_party/waf/waflib/Tools/msvc.py b/third_party/waf/waflib/Tools/msvc.py +index 17b347d4583..f169c7f441b 100644 +--- a/third_party/waf/waflib/Tools/msvc.py ++++ b/third_party/waf/waflib/Tools/msvc.py +@@ -281,7 +281,7 @@ def gather_wince_supported_platforms(): + + def gather_msvc_detected_versions(): + #Detected MSVC versions! +- version_pattern = re.compile('^(\d\d?\.\d\d?)(Exp)?$') ++ version_pattern = re.compile(r'^(\d\d?\.\d\d?)(Exp)?$') + detected_versions = [] + for vcver,vcvar in (('VCExpress','Exp'), ('VisualStudio','')): + prefix = 'SOFTWARE\\Wow6432node\\Microsoft\\' + vcver +@@ -367,7 +367,7 @@ def gather_wsdk_versions(conf, versions): + :param versions: list to modify + :type versions: list + """ +- version_pattern = re.compile('^v..?.?\...?.?') ++ version_pattern = re.compile(r'^v..?.?\...?.?') + try: + all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Microsoft\\Microsoft SDKs\\Windows') + except OSError: +@@ -525,7 +525,7 @@ def gather_icl_versions(conf, versions): + :param versions: list to modify + :type versions: list + """ +- version_pattern = re.compile('^...?.?\....?.?') ++ version_pattern = re.compile(r'^...?.?\....?.?') + try: + all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Compilers\\C++') + except OSError: +@@ -579,7 +579,7 @@ def gather_intel_composer_versions(conf, versions): + :param versions: list to modify + :type versions: list + """ +- version_pattern = re.compile('^...?.?\...?.?.?') ++ version_pattern = re.compile(r'^...?.?\...?.?.?') + try: + all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Suites') + except OSError: +@@ -683,7 +683,7 @@ def find_lt_names_msvc(self, libname, is_static=False): + if not is_static and ltdict.get('library_names', ''): + dllnames=ltdict['library_names'].split() + dll=dllnames[0].lower() +- dll=re.sub('\.dll$', '', dll) ++ dll=re.sub(r'\.dll$', '', dll) + return (lt_libdir, dll, False) + elif ltdict.get('old_library', ''): + olib=ltdict['old_library'] +@@ -700,7 +700,7 @@ def find_lt_names_msvc(self, libname, is_static=False): + @conf + def libname_msvc(self, libname, is_static=False): + lib = libname.lower() +- lib = re.sub('\.lib$','',lib) ++ lib = re.sub(r'\.lib$','',lib) + + if lib in g_msvc_systemlibs: + return lib +@@ -747,11 +747,11 @@ def libname_msvc(self, libname, is_static=False): + for libn in libnames: + if os.path.exists(os.path.join(path, libn)): + Logs.debug('msvc: lib found: %s', os.path.join(path,libn)) +- return re.sub('\.lib$', '',libn) ++ return re.sub(r'\.lib$', '',libn) + + #if no lib can be found, just return the libname as msvc expects it + self.fatal('The library %r could not be found' % libname) +- return re.sub('\.lib$', '', libname) ++ return re.sub(r'\.lib$', '', libname) + + @conf + def check_lib_msvc(self, libname, is_static=False, uselib_store=None): +@@ -969,7 +969,7 @@ def apply_flags_msvc(self): + if not is_static: + for f in self.env.LINKFLAGS: + d = f.lower() +- if d[1:] == 'debug': ++ if d[1:] in ('debug', 'debug:full', 'debug:fastlink'): + pdbnode = self.link_task.outputs[0].change_ext('.pdb') + self.link_task.outputs.append(pdbnode) + +diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py +index 52a05c668e3..63a8917d7c1 100644 +--- a/third_party/waf/waflib/Tools/python.py ++++ b/third_party/waf/waflib/Tools/python.py +@@ -329,6 +329,10 @@ def check_python_headers(conf, features='pyembed pyext'): + conf.find_program([''.join(pybin) + '-config', 'python%s-config' % num, 'python-config-%s' % num, 'python%sm-config' % num], var='PYTHON_CONFIG', msg="python-config", mandatory=False) + + if env.PYTHON_CONFIG: ++ # check python-config output only once ++ if conf.env.HAVE_PYTHON_H: ++ return ++ + # python2.6-config requires 3 runs + all_flags = [['--cflags', '--libs', '--ldflags']] + if sys.hexversion < 0x2070000: +@@ -338,7 +342,13 @@ def check_python_headers(conf, features='pyembed pyext'): + + if 'pyembed' in features: + for flags in all_flags: +- conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(flags), path=env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=flags) ++ # Python 3.8 has different flags for pyembed, needs --embed ++ embedflags = flags + ['--embed'] ++ try: ++ conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(embedflags), path=env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=embedflags) ++ except conf.errors.ConfigurationError: ++ # However Python < 3.8 doesn't accept --embed, so we need a fallback ++ conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(flags), path=env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=flags) + + try: + conf.test_pyembed(xx) +@@ -446,9 +456,9 @@ def check_python_version(conf, minver=None): + Check if the python interpreter is found matching a given minimum version. + minver should be a tuple, eg. to check for python >= 2.4.2 pass (2,4,2) as minver. + +- If successful, PYTHON_VERSION is defined as 'MAJOR.MINOR' +- (eg. '2.4') of the actual python version found, and PYTHONDIR is +- defined, pointing to the site-packages directory appropriate for ++ If successful, PYTHON_VERSION is defined as 'MAJOR.MINOR' (eg. '2.4') ++ of the actual python version found, and PYTHONDIR and PYTHONARCHDIR ++ are defined, pointing to the site-packages directories appropriate for + this python version, where modules/packages/extensions should be + installed. + +diff --git a/third_party/waf/waflib/Tools/qt5.py b/third_party/waf/waflib/Tools/qt5.py +index 4f9c6908fc5..287c25374a4 100644 +--- a/third_party/waf/waflib/Tools/qt5.py ++++ b/third_party/waf/waflib/Tools/qt5.py +@@ -74,7 +74,7 @@ else: + + import os, sys, re + from waflib.Tools import cxx +-from waflib import Task, Utils, Options, Errors, Context ++from waflib import Build, Task, Utils, Options, Errors, Context + from waflib.TaskGen import feature, after_method, extension, before_method + from waflib.Configure import conf + from waflib import Logs +@@ -167,6 +167,10 @@ class qxx(Task.classes['cxx']): + node = self.inputs[0] + bld = self.generator.bld + ++ # skip on uninstall due to generated files ++ if bld.is_install == Build.UNINSTALL: ++ return ++ + try: + # compute the signature once to know if there is a moc file to create + self.signature() +@@ -313,11 +317,11 @@ def apply_qt5(self): + + The additional parameters are: + +- :param lang: list of translation files (\*.ts) to process ++ :param lang: list of translation files (\\*.ts) to process + :type lang: list of :py:class:`waflib.Node.Node` or string without the .ts extension +- :param update: whether to process the C++ files to update the \*.ts files (use **waf --translate**) ++ :param update: whether to process the C++ files to update the \\*.ts files (use **waf --translate**) + :type update: bool +- :param langname: if given, transform the \*.ts files into a .qrc files to include in the binary file ++ :param langname: if given, transform the \\*.ts files into a .qrc files to include in the binary file + :type langname: :py:class:`waflib.Node.Node` or string without the .qrc extension + """ + if getattr(self, 'lang', None): +@@ -762,7 +766,7 @@ def set_qt5_libs_to_check(self): + if self.environ.get('QT5_FORCE_STATIC'): + pat = self.env.cxxstlib_PATTERN + if Utils.unversioned_sys_platform() == 'darwin': +- pat = "%s\.framework" ++ pat = r"%s\.framework" + re_qt = re.compile(pat%'Qt5?(?P.*)'+'$') + for x in dirlst: + m = re_qt.match(x) +diff --git a/third_party/waf/waflib/Tools/waf_unit_test.py b/third_party/waf/waflib/Tools/waf_unit_test.py +index a71ed1c0909..6ff6f72739f 100644 +--- a/third_party/waf/waflib/Tools/waf_unit_test.py ++++ b/third_party/waf/waflib/Tools/waf_unit_test.py +@@ -205,7 +205,7 @@ class utest(Task.Task): + return self.exec_command(self.ut_exec) + + def exec_command(self, cmd, **kw): +- Logs.debug('runner: %r', cmd) ++ self.generator.bld.log_command(cmd, kw) + if getattr(Options.options, 'dump_test_scripts', False): + script_code = SCRIPT_TEMPLATE % { + 'python': sys.executable, +@@ -214,7 +214,7 @@ class utest(Task.Task): + 'cmd': cmd + } + script_file = self.inputs[0].abspath() + '_run.py' +- Utils.writef(script_file, script_code) ++ Utils.writef(script_file, script_code, encoding='utf-8') + os.chmod(script_file, Utils.O755) + if Logs.verbose > 1: + Logs.info('Test debug file written as %r' % script_file) +diff --git a/third_party/waf/waflib/Tools/winres.py b/third_party/waf/waflib/Tools/winres.py +index 586c596cf93..9be1ed66009 100644 +--- a/third_party/waf/waflib/Tools/winres.py ++++ b/third_party/waf/waflib/Tools/winres.py +@@ -24,8 +24,8 @@ def rc_file(self, node): + self.compiled_tasks = [rctask] + + re_lines = re.compile( +- '(?:^[ \t]*(#|%:)[ \t]*(ifdef|ifndef|if|else|elif|endif|include|import|define|undef|pragma)[ \t]*(.*?)\s*$)|'\ +- '(?:^\w+[ \t]*(ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)[ \t]*(.*?)\s*$)', ++ r'(?:^[ \t]*(#|%:)[ \t]*(ifdef|ifndef|if|else|elif|endif|include|import|define|undef|pragma)[ \t]*(.*?)\s*$)|'\ ++ r'(?:^\w+[ \t]*(ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)[ \t]*(.*?)\s*$)', + re.IGNORECASE | re.MULTILINE) + + class rc_parser(c_preproc.c_parser): +diff --git a/third_party/waf/waflib/Utils.py b/third_party/waf/waflib/Utils.py +index b4665c4dc2b..7472226da58 100644 +--- a/third_party/waf/waflib/Utils.py ++++ b/third_party/waf/waflib/Utils.py +@@ -49,10 +49,16 @@ try: + from hashlib import md5 + except ImportError: + try: +- from md5 import md5 ++ from hashlib import sha1 as md5 + except ImportError: +- # never fail to enable fixes from another module ++ # never fail to enable potential fixes from another module + pass ++else: ++ try: ++ md5().digest() ++ except ValueError: ++ # Fips? #2213 ++ from hashlib import sha1 as md5 + + try: + import threading +@@ -202,7 +208,7 @@ class lazy_generator(object): + + next = __next__ + +-is_win32 = os.sep == '\\' or sys.platform == 'win32' # msys2 ++is_win32 = os.sep == '\\' or sys.platform == 'win32' or os.name == 'nt' # msys2 + """ + Whether this system is a Windows series + """ +@@ -484,7 +490,9 @@ def split_path_msys(path): + if sys.platform == 'cygwin': + split_path = split_path_cygwin + elif is_win32: +- if os.environ.get('MSYSTEM'): ++ # Consider this an MSYSTEM environment if $MSYSTEM is set and python ++ # reports is executable from a unix like path on a windows host. ++ if os.environ.get('MSYSTEM') and sys.executable.startswith('/'): + split_path = split_path_msys + else: + split_path = split_path_win32 +@@ -596,6 +604,12 @@ def h_list(lst): + """ + return md5(repr(lst).encode()).digest() + ++if sys.hexversion < 0x3000000: ++ def h_list_python2(lst): ++ return md5(repr(lst)).digest() ++ h_list_python2.__doc__ = h_list.__doc__ ++ h_list = h_list_python2 ++ + def h_fun(fun): + """ + Hash functions +@@ -730,7 +744,7 @@ def unversioned_sys_platform(): + if s == 'cli' and os.name == 'nt': + # ironpython is only on windows as far as we know + return 'win32' +- return re.split('\d+$', s)[0] ++ return re.split(r'\d+$', s)[0] + + def nada(*k, **kw): + """ +@@ -871,7 +885,7 @@ def get_process(): + except IndexError: + filepath = os.path.dirname(os.path.abspath(__file__)) + os.sep + 'processor.py' + cmd = [sys.executable, '-c', readf(filepath)] +- return subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, bufsize=0) ++ return subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, bufsize=0, close_fds=not is_win32) + + def run_prefork_process(cmd, kwargs, cargs): + """ +diff --git a/third_party/waf/waflib/ansiterm.py b/third_party/waf/waflib/ansiterm.py +index 0d20c6374b7..027f0ad68a3 100644 +--- a/third_party/waf/waflib/ansiterm.py ++++ b/third_party/waf/waflib/ansiterm.py +@@ -264,7 +264,7 @@ else: + 'u': pop_cursor, + } + # Match either the escape sequence or text not containing escape sequence +- ansi_tokens = re.compile('(?:\x1b\[([0-9?;]*)([a-zA-Z])|([^\x1b]+))') ++ ansi_tokens = re.compile(r'(?:\x1b\[([0-9?;]*)([a-zA-Z])|([^\x1b]+))') + def write(self, text): + try: + wlock.acquire() +diff --git a/third_party/waf/waflib/extras/buildcopy.py b/third_party/waf/waflib/extras/buildcopy.py +index a6d9ac83114..eaff7e605a6 100644 +--- a/third_party/waf/waflib/extras/buildcopy.py ++++ b/third_party/waf/waflib/extras/buildcopy.py +@@ -22,7 +22,7 @@ Examples:: + + """ + import os, shutil +-from waflib import Errors, Task, TaskGen, Utils, Node ++from waflib import Errors, Task, TaskGen, Utils, Node, Logs + + @TaskGen.before_method('process_source') + @TaskGen.feature('buildcopy') +@@ -58,10 +58,13 @@ def make_buildcopy(self): + raise Errors.WafError('buildcopy: File not found in src: %s'%os.path.join(*lst)) + + nodes = [ to_src_nodes(n) for n in getattr(self, 'buildcopy_source', getattr(self, 'source', [])) ] ++ if not nodes: ++ Logs.warn('buildcopy: No source files provided to buildcopy in %s (set `buildcopy_source` or `source`)', ++ self) ++ return + node_pairs = [(n, n.get_bld()) for n in nodes] + self.create_task('buildcopy', [n[0] for n in node_pairs], [n[1] for n in node_pairs], node_pairs=node_pairs) + +- + class buildcopy(Task.Task): + """ + Copy for each pair `n` in `node_pairs`: n[0] -> n[1]. +diff --git a/third_party/waf/waflib/extras/clang_cross.py b/third_party/waf/waflib/extras/clang_cross.py +new file mode 100644 +index 00000000000..1b51e2886cb +--- /dev/null ++++ b/third_party/waf/waflib/extras/clang_cross.py +@@ -0,0 +1,92 @@ ++#!/usr/bin/env python ++# encoding: utf-8 ++# Krzysztof Kosiński 2014 ++# DragoonX6 2018 ++ ++""" ++Detect the Clang C compiler ++This version is an attempt at supporting the -target and -sysroot flag of Clang. ++""" ++ ++from waflib.Tools import ccroot, ar, gcc ++from waflib.Configure import conf ++import waflib.Context ++import waflib.extras.clang_cross_common ++ ++def options(opt): ++ """ ++ Target triplet for clang:: ++ $ waf configure --clang-target-triple=x86_64-pc-linux-gnu ++ """ ++ cc_compiler_opts = opt.add_option_group('Configuration options') ++ cc_compiler_opts.add_option('--clang-target-triple', default=None, ++ help='Target triple for clang', ++ dest='clang_target_triple') ++ cc_compiler_opts.add_option('--clang-sysroot', default=None, ++ help='Sysroot for clang', ++ dest='clang_sysroot') ++ ++@conf ++def find_clang(conf): ++ """ ++ Finds the program clang and executes it to ensure it really is clang ++ """ ++ ++ import os ++ ++ cc = conf.find_program('clang', var='CC') ++ ++ if conf.options.clang_target_triple != None: ++ conf.env.append_value('CC', ['-target', conf.options.clang_target_triple]) ++ ++ if conf.options.clang_sysroot != None: ++ sysroot = str() ++ ++ if os.path.isabs(conf.options.clang_sysroot): ++ sysroot = conf.options.clang_sysroot ++ else: ++ sysroot = os.path.normpath(os.path.join(os.getcwd(), conf.options.clang_sysroot)) ++ ++ conf.env.append_value('CC', ['--sysroot', sysroot]) ++ ++ conf.get_cc_version(cc, clang=True) ++ conf.env.CC_NAME = 'clang' ++ ++@conf ++def clang_modifier_x86_64_w64_mingw32(conf): ++ conf.gcc_modifier_win32() ++ ++@conf ++def clang_modifier_i386_w64_mingw32(conf): ++ conf.gcc_modifier_win32() ++ ++@conf ++def clang_modifier_x86_64_windows_msvc(conf): ++ conf.clang_modifier_msvc() ++ ++ # Allow the user to override any flags if they so desire. ++ clang_modifier_user_func = getattr(conf, 'clang_modifier_x86_64_windows_msvc_user', None) ++ if clang_modifier_user_func: ++ clang_modifier_user_func() ++ ++@conf ++def clang_modifier_i386_windows_msvc(conf): ++ conf.clang_modifier_msvc() ++ ++ # Allow the user to override any flags if they so desire. ++ clang_modifier_user_func = getattr(conf, 'clang_modifier_i386_windows_msvc_user', None) ++ if clang_modifier_user_func: ++ clang_modifier_user_func() ++ ++def configure(conf): ++ conf.find_clang() ++ conf.find_program(['llvm-ar', 'ar'], var='AR') ++ conf.find_ar() ++ conf.gcc_common_flags() ++ # Allow the user to provide flags for the target platform. ++ conf.gcc_modifier_platform() ++ # And allow more fine grained control based on the compiler's triplet. ++ conf.clang_modifier_target_triple() ++ conf.cc_load_tools() ++ conf.cc_add_flags() ++ conf.link_add_flags() +diff --git a/third_party/waf/waflib/extras/clang_cross_common.py b/third_party/waf/waflib/extras/clang_cross_common.py +new file mode 100644 +index 00000000000..b76a070065c +--- /dev/null ++++ b/third_party/waf/waflib/extras/clang_cross_common.py +@@ -0,0 +1,113 @@ ++#!/usr/bin/env python ++# encoding: utf-8 ++# DragoonX6 2018 ++ ++""" ++Common routines for cross_clang.py and cross_clangxx.py ++""" ++ ++from waflib.Configure import conf ++import waflib.Context ++ ++def normalize_target_triple(target_triple): ++ target_triple = target_triple[:-1] ++ normalized_triple = target_triple.replace('--', '-unknown-') ++ ++ if normalized_triple.startswith('-'): ++ normalized_triple = 'unknown' + normalized_triple ++ ++ if normalized_triple.endswith('-'): ++ normalized_triple += 'unknown' ++ ++ # Normalize MinGW builds to *arch*-w64-mingw32 ++ if normalized_triple.endswith('windows-gnu'): ++ normalized_triple = normalized_triple[:normalized_triple.index('-')] + '-w64-mingw32' ++ ++ # Strip the vendor when doing msvc builds, since it's unused anyway. ++ if normalized_triple.endswith('windows-msvc'): ++ normalized_triple = normalized_triple[:normalized_triple.index('-')] + '-windows-msvc' ++ ++ return normalized_triple.replace('-', '_') ++ ++@conf ++def clang_modifier_msvc(conf): ++ import os ++ ++ """ ++ Really basic setup to use clang in msvc mode. ++ We actually don't really want to do a lot, even though clang is msvc compatible ++ in this mode, that doesn't mean we're actually using msvc. ++ It's probably the best to leave it to the user, we can assume msvc mode if the user ++ uses the clang-cl frontend, but this module only concerns itself with the gcc-like frontend. ++ """ ++ v = conf.env ++ v.cprogram_PATTERN = '%s.exe' ++ ++ v.cshlib_PATTERN = '%s.dll' ++ v.implib_PATTERN = '%s.lib' ++ v.IMPLIB_ST = '-Wl,-IMPLIB:%s' ++ v.SHLIB_MARKER = [] ++ ++ v.CFLAGS_cshlib = [] ++ v.LINKFLAGS_cshlib = ['-Wl,-DLL'] ++ v.cstlib_PATTERN = '%s.lib' ++ v.STLIB_MARKER = [] ++ ++ del(v.AR) ++ conf.find_program(['llvm-lib', 'lib'], var='AR') ++ v.ARFLAGS = ['-nologo'] ++ v.AR_TGT_F = ['-out:'] ++ ++ # Default to the linker supplied with llvm instead of link.exe or ld ++ v.LINK_CC = v.CC + ['-fuse-ld=lld', '-nostdlib'] ++ v.CCLNK_TGT_F = ['-o'] ++ v.def_PATTERN = '-Wl,-def:%s' ++ ++ v.LINKFLAGS = [] ++ ++ v.LIB_ST = '-l%s' ++ v.LIBPATH_ST = '-Wl,-LIBPATH:%s' ++ v.STLIB_ST = '-l%s' ++ v.STLIBPATH_ST = '-Wl,-LIBPATH:%s' ++ ++ CFLAGS_CRT_COMMON = [ ++ '-Xclang', '--dependent-lib=oldnames', ++ '-Xclang', '-fno-rtti-data', ++ '-D_MT' ++ ] ++ ++ v.CFLAGS_CRT_MULTITHREADED = CFLAGS_CRT_COMMON + [ ++ '-Xclang', '-flto-visibility-public-std', ++ '-Xclang', '--dependent-lib=libcmt', ++ ] ++ v.CXXFLAGS_CRT_MULTITHREADED = v.CFLAGS_CRT_MULTITHREADED ++ ++ v.CFLAGS_CRT_MULTITHREADED_DBG = CFLAGS_CRT_COMMON + [ ++ '-D_DEBUG', ++ '-Xclang', '-flto-visibility-public-std', ++ '-Xclang', '--dependent-lib=libcmtd', ++ ] ++ v.CXXFLAGS_CRT_MULTITHREADED_DBG = v.CFLAGS_CRT_MULTITHREADED_DBG ++ ++ v.CFLAGS_CRT_MULTITHREADED_DLL = CFLAGS_CRT_COMMON + [ ++ '-D_DLL', ++ '-Xclang', '--dependent-lib=msvcrt' ++ ] ++ v.CXXFLAGS_CRT_MULTITHREADED_DLL = v.CFLAGS_CRT_MULTITHREADED_DLL ++ ++ v.CFLAGS_CRT_MULTITHREADED_DLL_DBG = CFLAGS_CRT_COMMON + [ ++ '-D_DLL', ++ '-D_DEBUG', ++ '-Xclang', '--dependent-lib=msvcrtd', ++ ] ++ v.CXXFLAGS_CRT_MULTITHREADED_DLL_DBG = v.CFLAGS_CRT_MULTITHREADED_DLL_DBG ++ ++@conf ++def clang_modifier_target_triple(conf, cpp=False): ++ compiler = conf.env.CXX if cpp else conf.env.CC ++ output = conf.cmd_and_log(compiler + ['-dumpmachine'], output=waflib.Context.STDOUT) ++ ++ modifier = ('clangxx' if cpp else 'clang') + '_modifier_' ++ clang_modifier_func = getattr(conf, modifier + normalize_target_triple(output), None) ++ if clang_modifier_func: ++ clang_modifier_func() +diff --git a/third_party/waf/waflib/extras/clangxx_cross.py b/third_party/waf/waflib/extras/clangxx_cross.py +new file mode 100644 +index 00000000000..0ad38ad46c0 +--- /dev/null ++++ b/third_party/waf/waflib/extras/clangxx_cross.py +@@ -0,0 +1,106 @@ ++#!/usr/bin/env python ++# encoding: utf-8 ++# Thomas Nagy 2009-2018 (ita) ++# DragoonX6 2018 ++ ++""" ++Detect the Clang++ C++ compiler ++This version is an attempt at supporting the -target and -sysroot flag of Clang++. ++""" ++ ++from waflib.Tools import ccroot, ar, gxx ++from waflib.Configure import conf ++import waflib.extras.clang_cross_common ++ ++def options(opt): ++ """ ++ Target triplet for clang++:: ++ $ waf configure --clangxx-target-triple=x86_64-pc-linux-gnu ++ """ ++ cxx_compiler_opts = opt.add_option_group('Configuration options') ++ cxx_compiler_opts.add_option('--clangxx-target-triple', default=None, ++ help='Target triple for clang++', ++ dest='clangxx_target_triple') ++ cxx_compiler_opts.add_option('--clangxx-sysroot', default=None, ++ help='Sysroot for clang++', ++ dest='clangxx_sysroot') ++ ++@conf ++def find_clangxx(conf): ++ """ ++ Finds the program clang++, and executes it to ensure it really is clang++ ++ """ ++ ++ import os ++ ++ cxx = conf.find_program('clang++', var='CXX') ++ ++ if conf.options.clangxx_target_triple != None: ++ conf.env.append_value('CXX', ['-target', conf.options.clangxx_target_triple]) ++ ++ if conf.options.clangxx_sysroot != None: ++ sysroot = str() ++ ++ if os.path.isabs(conf.options.clangxx_sysroot): ++ sysroot = conf.options.clangxx_sysroot ++ else: ++ sysroot = os.path.normpath(os.path.join(os.getcwd(), conf.options.clangxx_sysroot)) ++ ++ conf.env.append_value('CXX', ['--sysroot', sysroot]) ++ ++ conf.get_cc_version(cxx, clang=True) ++ conf.env.CXX_NAME = 'clang' ++ ++@conf ++def clangxx_modifier_x86_64_w64_mingw32(conf): ++ conf.gcc_modifier_win32() ++ ++@conf ++def clangxx_modifier_i386_w64_mingw32(conf): ++ conf.gcc_modifier_win32() ++ ++@conf ++def clangxx_modifier_msvc(conf): ++ v = conf.env ++ v.cxxprogram_PATTERN = v.cprogram_PATTERN ++ v.cxxshlib_PATTERN = v.cshlib_PATTERN ++ ++ v.CXXFLAGS_cxxshlib = [] ++ v.LINKFLAGS_cxxshlib = v.LINKFLAGS_cshlib ++ v.cxxstlib_PATTERN = v.cstlib_PATTERN ++ ++ v.LINK_CXX = v.CXX + ['-fuse-ld=lld', '-nostdlib'] ++ v.CXXLNK_TGT_F = v.CCLNK_TGT_F ++ ++@conf ++def clangxx_modifier_x86_64_windows_msvc(conf): ++ conf.clang_modifier_msvc() ++ conf.clangxx_modifier_msvc() ++ ++ # Allow the user to override any flags if they so desire. ++ clang_modifier_user_func = getattr(conf, 'clangxx_modifier_x86_64_windows_msvc_user', None) ++ if clang_modifier_user_func: ++ clang_modifier_user_func() ++ ++@conf ++def clangxx_modifier_i386_windows_msvc(conf): ++ conf.clang_modifier_msvc() ++ conf.clangxx_modifier_msvc() ++ ++ # Allow the user to override any flags if they so desire. ++ clang_modifier_user_func = getattr(conf, 'clangxx_modifier_i386_windows_msvc_user', None) ++ if clang_modifier_user_func: ++ clang_modifier_user_func() ++ ++def configure(conf): ++ conf.find_clangxx() ++ conf.find_program(['llvm-ar', 'ar'], var='AR') ++ conf.find_ar() ++ conf.gxx_common_flags() ++ # Allow the user to provide flags for the target platform. ++ conf.gxx_modifier_platform() ++ # And allow more fine grained control based on the compiler's triplet. ++ conf.clang_modifier_target_triple(cpp=True) ++ conf.cxx_load_tools() ++ conf.cxx_add_flags() ++ conf.link_add_flags() +diff --git a/third_party/waf/waflib/extras/color_msvc.py b/third_party/waf/waflib/extras/color_msvc.py +new file mode 100644 +index 00000000000..60bacb7b240 +--- /dev/null ++++ b/third_party/waf/waflib/extras/color_msvc.py +@@ -0,0 +1,59 @@ ++#!/usr/bin/env python ++# encoding: utf-8 ++ ++# Replaces the default formatter by one which understands MSVC output and colorizes it. ++# Modified from color_gcc.py ++ ++__author__ = __maintainer__ = "Alibek Omarov " ++__copyright__ = "Alibek Omarov, 2019" ++ ++import sys ++from waflib import Logs ++ ++class ColorMSVCFormatter(Logs.formatter): ++ def __init__(self, colors): ++ self.colors = colors ++ Logs.formatter.__init__(self) ++ ++ def parseMessage(self, line, color): ++ # Split messaage from 'disk:filepath: type: message' ++ arr = line.split(':', 3) ++ if len(arr) < 4: ++ return line ++ ++ colored = self.colors.BOLD + arr[0] + ':' + arr[1] + ':' + self.colors.NORMAL ++ colored += color + arr[2] + ':' + self.colors.NORMAL ++ colored += arr[3] ++ return colored ++ ++ def format(self, rec): ++ frame = sys._getframe() ++ while frame: ++ func = frame.f_code.co_name ++ if func == 'exec_command': ++ cmd = frame.f_locals.get('cmd') ++ if isinstance(cmd, list): ++ # Fix file case, it may be CL.EXE or cl.exe ++ argv0 = cmd[0].lower() ++ if 'cl.exe' in argv0: ++ lines = [] ++ # This will not work with "localized" versions ++ # of MSVC ++ for line in rec.msg.splitlines(): ++ if ': warning ' in line: ++ lines.append(self.parseMessage(line, self.colors.YELLOW)) ++ elif ': error ' in line: ++ lines.append(self.parseMessage(line, self.colors.RED)) ++ elif ': fatal error ' in line: ++ lines.append(self.parseMessage(line, self.colors.RED + self.colors.BOLD)) ++ elif ': note: ' in line: ++ lines.append(self.parseMessage(line, self.colors.CYAN)) ++ else: ++ lines.append(line) ++ rec.msg = "\n".join(lines) ++ frame = frame.f_back ++ return Logs.formatter.format(self, rec) ++ ++def options(opt): ++ Logs.log.handlers[0].setFormatter(ColorMSVCFormatter(Logs.colors)) ++ +diff --git a/third_party/waf/waflib/extras/cppcheck.py b/third_party/waf/waflib/extras/cppcheck.py +index 43dc544df73..13ff42477fd 100644 +--- a/third_party/waf/waflib/extras/cppcheck.py ++++ b/third_party/waf/waflib/extras/cppcheck.py +@@ -205,11 +205,17 @@ def _tgen_create_cmd(self): + args.append('--enable=%s' % lib_enable) + + for src in self.to_list(getattr(self, 'source', [])): +- args.append('%r' % src) ++ if not isinstance(src, str): ++ src = repr(src) ++ args.append(src) + for inc in self.to_incnodes(self.to_list(getattr(self, 'includes', []))): +- args.append('-I%r' % inc) ++ if not isinstance(inc, str): ++ inc = repr(inc) ++ args.append('-I%s' % inc) + for inc in self.to_incnodes(self.to_list(self.env.INCLUDES)): +- args.append('-I%r' % inc) ++ if not isinstance(inc, str): ++ inc = repr(inc) ++ args.append('-I%s' % inc) + return cmd + args + + +diff --git a/third_party/waf/waflib/extras/cpplint.py b/third_party/waf/waflib/extras/cpplint.py +index fc914c2450b..8cdd6ddacb3 100644 +--- a/third_party/waf/waflib/extras/cpplint.py ++++ b/third_party/waf/waflib/extras/cpplint.py +@@ -38,26 +38,25 @@ When using this tool, the wscript will look like: + from __future__ import absolute_import + import sys, re + import logging +-import threading +-from waflib import Task, TaskGen, Logs, Options, Node +-try: +- import cpplint.cpplint as cpplint_tool +-except ImportError: +- try: +- import cpplint as cpplint_tool +- except ImportError: +- pass ++from waflib import Errors, Task, TaskGen, Logs, Options, Node, Utils + + + critical_errors = 0 + CPPLINT_FORMAT = '[CPPLINT] %(filename)s:\nline %(linenum)s, severity %(confidence)s, category: %(category)s\n%(message)s\n' +-RE_EMACS = re.compile('(?P.*):(?P\d+): (?P.*) \[(?P.*)\] \[(?P\d+)\]') ++RE_EMACS = re.compile(r'(?P.*):(?P\d+): (?P.*) \[(?P.*)\] \[(?P\d+)\]') + CPPLINT_RE = { + 'waf': RE_EMACS, + 'emacs': RE_EMACS, +- 'vs7': re.compile('(?P.*)\((?P\d+)\): (?P.*) \[(?P.*)\] \[(?P\d+)\]'), +- 'eclipse': re.compile('(?P.*):(?P\d+): warning: (?P.*) \[(?P.*)\] \[(?P\d+)\]'), ++ 'vs7': re.compile(r'(?P.*)\((?P\d+)\): (?P.*) \[(?P.*)\] \[(?P\d+)\]'), ++ 'eclipse': re.compile(r'(?P.*):(?P\d+): warning: (?P.*) \[(?P.*)\] \[(?P\d+)\]'), + } ++CPPLINT_STR = ('${CPPLINT} ' ++ '--verbose=${CPPLINT_LEVEL} ' ++ '--output=${CPPLINT_OUTPUT} ' ++ '--filter=${CPPLINT_FILTERS} ' ++ '--root=${CPPLINT_ROOT} ' ++ '--linelength=${CPPLINT_LINE_LENGTH} ') ++ + + def options(opt): + opt.add_option('--cpplint-filters', type='string', +@@ -71,24 +70,21 @@ def options(opt): + opt.add_option('--cpplint-break', default=5, type='int', dest='CPPLINT_BREAK', + help='break the build if error >= level (default: 5)') + opt.add_option('--cpplint-root', type='string', +- default=None, dest='CPPLINT_ROOT', ++ default='', dest='CPPLINT_ROOT', + help='root directory used to derive header guard') + opt.add_option('--cpplint-skip', action='store_true', + default=False, dest='CPPLINT_SKIP', + help='skip cpplint during build') + opt.add_option('--cpplint-output', type='string', + default='waf', dest='CPPLINT_OUTPUT', +- help='select output format (waf, emacs, vs7)') ++ help='select output format (waf, emacs, vs7, eclipse)') + + + def configure(conf): +- conf.start_msg('Checking cpplint') + try: +- cpplint_tool._cpplint_state +- conf.end_msg('ok') +- except NameError: ++ conf.find_program('cpplint', var='CPPLINT') ++ except Errors.ConfigurationError: + conf.env.CPPLINT_SKIP = True +- conf.end_msg('not found, skipping it.') + + + class cpplint_formatter(Logs.formatter, object): +@@ -117,34 +113,22 @@ class cpplint_handler(Logs.log_handler, object): + + + class cpplint_wrapper(object): +- stream = None +- tasks_count = 0 +- lock = threading.RLock() +- + def __init__(self, logger, threshold, fmt): + self.logger = logger + self.threshold = threshold +- self.error_count = 0 + self.fmt = fmt + + def __enter__(self): +- with cpplint_wrapper.lock: +- cpplint_wrapper.tasks_count += 1 +- if cpplint_wrapper.tasks_count == 1: +- sys.stderr.flush() +- cpplint_wrapper.stream = sys.stderr +- sys.stderr = self +- return self ++ return self + + def __exit__(self, exc_type, exc_value, traceback): +- with cpplint_wrapper.lock: +- cpplint_wrapper.tasks_count -= 1 +- if cpplint_wrapper.tasks_count == 0: +- sys.stderr = cpplint_wrapper.stream +- sys.stderr.flush() +- +- def isatty(self): +- return True ++ if isinstance(exc_value, Utils.subprocess.CalledProcessError): ++ messages = [m for m in exc_value.output.splitlines() ++ if 'Done processing' not in m ++ and 'Total errors found' not in m] ++ for message in messages: ++ self.write(message) ++ return True + + def write(self, message): + global critical_errors +@@ -184,12 +168,15 @@ class cpplint(Task.Task): + def run(self): + global critical_errors + with cpplint_wrapper(get_cpplint_logger(self.env.CPPLINT_OUTPUT), self.env.CPPLINT_BREAK, self.env.CPPLINT_OUTPUT): +- if self.env.CPPLINT_OUTPUT != 'waf': +- cpplint_tool._SetOutputFormat(self.env.CPPLINT_OUTPUT) +- cpplint_tool._SetFilters(self.env.CPPLINT_FILTERS) +- cpplint_tool._line_length = self.env.CPPLINT_LINE_LENGTH +- cpplint_tool._root = self.env.CPPLINT_ROOT +- cpplint_tool.ProcessFile(self.inputs[0].abspath(), self.env.CPPLINT_LEVEL) ++ params = {key: str(self.env[key]) for key in self.env if 'CPPLINT_' in key} ++ if params['CPPLINT_OUTPUT'] is 'waf': ++ params['CPPLINT_OUTPUT'] = 'emacs' ++ params['CPPLINT'] = self.env.get_flat('CPPLINT') ++ cmd = Utils.subst_vars(CPPLINT_STR, params) ++ env = self.env.env or None ++ Utils.subprocess.check_output(cmd + self.inputs[0].abspath(), ++ stderr=Utils.subprocess.STDOUT, ++ env=env, shell=True) + return critical_errors + + @TaskGen.extension('.h', '.hh', '.hpp', '.hxx') +diff --git a/third_party/waf/waflib/extras/cython.py b/third_party/waf/waflib/extras/cython.py +index 2b2c7ccc265..591c274d950 100644 +--- a/third_party/waf/waflib/extras/cython.py ++++ b/third_party/waf/waflib/extras/cython.py +@@ -8,8 +8,9 @@ from waflib.TaskGen import extension + + cy_api_pat = re.compile(r'\s*?cdef\s*?(public|api)\w*') + re_cyt = re.compile(r""" +- (?:from\s+(\w+)\s+)? # optionally match "from foo" and capture foo +- c?import\s(\w+|[*]) # require "import bar" and capture bar ++ ^\s* # must begin with some whitespace characters ++ (?:from\s+(\w+)(?:\.\w+)*\s+)? # optionally match "from foo(.baz)" and capture foo ++ c?import\s(\w+|[*]) # require "import bar" and capture bar + """, re.M | re.VERBOSE) + + @extension('.pyx') +@@ -85,12 +86,12 @@ class cython(Task.Task): + node = self.inputs[0] + txt = node.read() + +- mods = [] ++ mods = set() + for m in re_cyt.finditer(txt): + if m.group(1): # matches "from foo import bar" +- mods.append(m.group(1)) ++ mods.add(m.group(1)) + else: +- mods.append(m.group(2)) ++ mods.add(m.group(2)) + + Logs.debug('cython: mods %r', mods) + incs = getattr(self.generator, 'cython_includes', []) +@@ -99,7 +100,7 @@ class cython(Task.Task): + + found = [] + missing = [] +- for x in mods: ++ for x in sorted(mods): + for y in incs: + k = y.find_resource(x + '.pxd') + if k: +@@ -141,6 +142,6 @@ def configure(ctx): + if not ctx.env.PYTHON: + ctx.fatal('Load the python tool first!') + ctx.find_program('cython', var='CYTHON') +- if ctx.options.cython_flags: ++ if hasattr(ctx.options, 'cython_flags'): + ctx.env.CYTHONFLAGS = ctx.options.cython_flags + +diff --git a/third_party/waf/waflib/extras/distnet.py b/third_party/waf/waflib/extras/distnet.py +index 09a31a6d437..ff3ed8e1146 100644 +--- a/third_party/waf/waflib/extras/distnet.py ++++ b/third_party/waf/waflib/extras/distnet.py +@@ -44,7 +44,7 @@ TARFORMAT = 'w:bz2' + TIMEOUT = 60 + REQUIRES = 'requires.txt' + +-re_com = re.compile('\s*#.*', re.M) ++re_com = re.compile(r'\s*#.*', re.M) + + def total_version_order(num): + lst = num.split('.') +diff --git a/third_party/waf/waflib/extras/doxygen.py b/third_party/waf/waflib/extras/doxygen.py +index 3eae22fe179..423d8455025 100644 +--- a/third_party/waf/waflib/extras/doxygen.py ++++ b/third_party/waf/waflib/extras/doxygen.py +@@ -27,6 +27,7 @@ When using this tool, the wscript will look like: + """ + + import os, os.path, re ++from collections import OrderedDict + from waflib import Task, Utils, Node + from waflib.TaskGen import feature + +@@ -40,7 +41,13 @@ inc m mm py f90c cc cxx cpp c++ java ii ixx ipp i++ inl h hh hxx + re_rl = re.compile('\\\\\r*\n', re.MULTILINE) + re_nl = re.compile('\r*\n', re.M) + def parse_doxy(txt): +- tbl = {} ++ ''' ++ Parses a doxygen file. ++ Returns an ordered dictionary. We cannot return a default dictionary, as the ++ order in which the entries are reported does matter, especially for the ++ '@INCLUDE' lines. ++ ''' ++ tbl = OrderedDict() + txt = re_rl.sub('', txt) + lines = re_nl.split(txt) + for x in lines: +@@ -190,13 +197,13 @@ class tar(Task.Task): + @feature('doxygen') + def process_doxy(self): + if not getattr(self, 'doxyfile', None): +- self.generator.bld.fatal('no doxyfile??') ++ self.bld.fatal('no doxyfile variable specified??') + + node = self.doxyfile + if not isinstance(node, Node.Node): + node = self.path.find_resource(node) + if not node: +- raise ValueError('doxygen file not found') ++ self.bld.fatal('doxygen file %s not found' % self.doxyfile) + + # the task instance + dsk = self.create_task('doxygen', node) +diff --git a/third_party/waf/waflib/extras/erlang.py b/third_party/waf/waflib/extras/erlang.py +index 49f6d5b475b..0b93d9a4f46 100644 +--- a/third_party/waf/waflib/extras/erlang.py ++++ b/third_party/waf/waflib/extras/erlang.py +@@ -51,7 +51,7 @@ class erl(Task.Task): + if n.abspath() in scanned: + continue + +- for i in re.findall('-include\("(.*)"\)\.', n.read()): ++ for i in re.findall(r'-include\("(.*)"\)\.', n.read()): + for d in task.erlc_incnodes: + r = d.find_node(i) + if r: +diff --git a/third_party/waf/waflib/extras/fast_partial.py b/third_party/waf/waflib/extras/fast_partial.py +index b3af513b255..71b8318eecb 100644 +--- a/third_party/waf/waflib/extras/fast_partial.py ++++ b/third_party/waf/waflib/extras/fast_partial.py +@@ -17,8 +17,9 @@ Usage:: + def options(opt): + opt.load('fast_partial') + +-Assuptions: ++Assumptions: + * Mostly for C/C++/Fortran targets with link tasks (object-only targets are not handled) ++ try it in the folder generated by utils/genbench.py + * For full project builds: no --targets and no pruning from subfolders + * The installation phase is ignored + * `use=` dependencies are specified up front even across build groups +diff --git a/third_party/waf/waflib/extras/fc_cray.py b/third_party/waf/waflib/extras/fc_cray.py +index ec2906742b4..da733fade3d 100644 +--- a/third_party/waf/waflib/extras/fc_cray.py ++++ b/third_party/waf/waflib/extras/fc_cray.py +@@ -20,7 +20,7 @@ def find_crayftn(conf): + @conf + def crayftn_flags(conf): + v = conf.env +- v['_FCMODOUTFLAGS'] = ['-em', '-J.'] # enable module files and put them in the current directoy ++ v['_FCMODOUTFLAGS'] = ['-em', '-J.'] # enable module files and put them in the current directory + v['FCFLAGS_DEBUG'] = ['-m1'] # more verbose compiler warnings + v['FCFLAGS_fcshlib'] = ['-h pic'] + v['LINKFLAGS_fcshlib'] = ['-h shared'] +diff --git a/third_party/waf/waflib/extras/fc_nec.py b/third_party/waf/waflib/extras/fc_nec.py +index 4b70f3dcccd..67c86808985 100644 +--- a/third_party/waf/waflib/extras/fc_nec.py ++++ b/third_party/waf/waflib/extras/fc_nec.py +@@ -20,7 +20,7 @@ def find_sxfc(conf): + @conf + def sxfc_flags(conf): + v = conf.env +- v['_FCMODOUTFLAGS'] = [] # enable module files and put them in the current directoy ++ v['_FCMODOUTFLAGS'] = [] # enable module files and put them in the current directory + v['FCFLAGS_DEBUG'] = [] # more verbose compiler warnings + v['FCFLAGS_fcshlib'] = [] + v['LINKFLAGS_fcshlib'] = [] +diff --git a/third_party/waf/waflib/extras/fc_nfort.py b/third_party/waf/waflib/extras/fc_nfort.py +new file mode 100644 +index 00000000000..c25886b8e70 +--- /dev/null ++++ b/third_party/waf/waflib/extras/fc_nfort.py +@@ -0,0 +1,52 @@ ++#! /usr/bin/env python ++# encoding: utf-8 ++# Detection of the NEC Fortran compiler for Aurora Tsubasa ++ ++import re ++from waflib.Tools import fc,fc_config,fc_scan ++from waflib.Configure import conf ++from waflib.Tools.compiler_fc import fc_compiler ++fc_compiler['linux'].append('fc_nfort') ++ ++@conf ++def find_nfort(conf): ++ fc=conf.find_program(['nfort'],var='FC') ++ conf.get_nfort_version(fc) ++ conf.env.FC_NAME='NFORT' ++ conf.env.FC_MOD_CAPITALIZATION='lower' ++ ++@conf ++def nfort_flags(conf): ++ v=conf.env ++ v['_FCMODOUTFLAGS']=[] ++ v['FCFLAGS_DEBUG']=[] ++ v['FCFLAGS_fcshlib']=[] ++ v['LINKFLAGS_fcshlib']=[] ++ v['FCSTLIB_MARKER']='' ++ v['FCSHLIB_MARKER']='' ++ ++@conf ++def get_nfort_version(conf,fc): ++ version_re=re.compile(r"nfort\s*\(NFORT\)\s*(?P\d+)\.(?P\d+)\.",re.I).search ++ cmd=fc+['--version'] ++ out,err=fc_config.getoutput(conf,cmd,stdin=False) ++ if out: ++ match=version_re(out) ++ else: ++ match=version_re(err) ++ if not match: ++ return(False) ++ conf.fatal('Could not determine the NEC NFORT Fortran compiler version.') ++ else: ++ k=match.groupdict() ++ conf.env['FC_VERSION']=(k['major'],k['minor']) ++ ++def configure(conf): ++ conf.find_nfort() ++ conf.find_program('nar',var='AR') ++ conf.add_os_flags('ARFLAGS') ++ if not conf.env.ARFLAGS: ++ conf.env.ARFLAGS=['rcs'] ++ conf.fc_flags() ++ conf.fc_add_flags() ++ conf.nfort_flags() +diff --git a/third_party/waf/waflib/extras/gccdeps.py b/third_party/waf/waflib/extras/gccdeps.py +index d9758ab34d5..bfabe72e6fd 100644 +--- a/third_party/waf/waflib/extras/gccdeps.py ++++ b/third_party/waf/waflib/extras/gccdeps.py +@@ -36,7 +36,7 @@ def scan(self): + names = [] + return (nodes, names) + +-re_o = re.compile("\.o$") ++re_o = re.compile(r"\.o$") + re_splitter = re.compile(r'(? '2': +- m = re.search(r'^message\s+(\w*)\s*{*', line) +- if m: +- messages.append(m.groups()[0]) +- +- if javapkg: +- nodename = javapkg +- elif pkgname: +- nodename = pkgname +- else: +- raise Errors.WafError('Cannot derive java name from protoc file') +- +- nodename = nodename.replace('.',os.sep) + os.sep +- if javacn: +- nodename += javacn + '.java' +- else: +- if self.env.PROTOC_MAJOR > '2' and node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title() in messages: +- nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title().replace('_','') + 'OuterClass.java' +- else: +- nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title().replace('_','') + '.java' +- +- java_node = node.parent.find_or_declare(nodename) +- out_nodes.append(java_node) +- protoc_flags.append('--java_out=%s' % node.parent.get_bld().bldpath()) +- + # Make javac get also pick java code generated in build + if not node.parent.get_bld() in self.javac_task.srcdir: + self.javac_task.srcdir.append(node.parent.get_bld()) + +- if not out_nodes: +- raise Errors.WafError('Feature %r not supported by protoc extra' % self.features) ++ protoc_flags.append('--java_out=%s' % node.parent.get_bld().bldpath()) ++ node.parent.get_bld().mkdir() + + tsk = self.create_task('protoc', node, out_nodes) + tsk.env.append_value('PROTOC_FLAGS', protoc_flags) +@@ -219,9 +187,22 @@ def process_protoc(self, node): + # For C++ standard include files dirs are used, + # but this doesn't apply to Python for example + for incpath in getattr(self, 'protoc_includes', []): +- incdirs.append(self.path.find_node(incpath).bldpath()) ++ incpath_node = self.path.find_node(incpath) ++ if incpath_node: ++ incdirs.append(incpath_node.bldpath()) ++ else: ++ # Check if relative to top-level for extra tg dependencies ++ incpath_node = self.bld.path.find_node(incpath) ++ if incpath_node: ++ incdirs.append(incpath_node.bldpath()) ++ else: ++ raise Errors.WafError('protoc: include path %r does not exist' % incpath) ++ + tsk.env.PROTOC_INCPATHS = incdirs + ++ # Include paths external to the waf project (ie. shared pb repositories) ++ tsk.env.PROTOC_EXTINCPATHS = getattr(self, 'protoc_extincludes', []) ++ + # PR2115: protoc generates output of .proto files in nested + # directories by canonicalizing paths. To avoid this we have to pass + # as first include the full directory file of the .proto file +diff --git a/third_party/waf/waflib/extras/pyqt5.py b/third_party/waf/waflib/extras/pyqt5.py +index c21dfa72048..9c941764cc2 100644 +--- a/third_party/waf/waflib/extras/pyqt5.py ++++ b/third_party/waf/waflib/extras/pyqt5.py +@@ -1,6 +1,6 @@ + #!/usr/bin/env python + # encoding: utf-8 +-# Federico Pellegrin, 2016-2018 (fedepell) adapted for Python ++# Federico Pellegrin, 2016-2019 (fedepell) adapted for Python + + """ + This tool helps with finding Python Qt5 tools and libraries, +@@ -30,7 +30,7 @@ Load the "pyqt5" tool. + + Add into the sources list also the qrc resources files or ui5 + definition files and they will be translated into python code +-with the system tools (PyQt5, pyside2, PyQt4 are searched in this ++with the system tools (PyQt5, PySide2, PyQt4 are searched in this + order) and then compiled + """ + +@@ -111,9 +111,9 @@ def apply_pyqt5(self): + """ + The additional parameters are: + +- :param lang: list of translation files (\*.ts) to process ++ :param lang: list of translation files (\\*.ts) to process + :type lang: list of :py:class:`waflib.Node.Node` or string without the .ts extension +- :param langname: if given, transform the \*.ts files into a .qrc files to include in the binary file ++ :param langname: if given, transform the \\*.ts files into a .qrc files to include in the binary file + :type langname: :py:class:`waflib.Node.Node` or string without the .qrc extension + """ + if getattr(self, 'lang', None): +@@ -207,11 +207,15 @@ def configure(self): + @conf + def find_pyqt5_binaries(self): + """ +- Detects PyQt5 or pyside2 programs such as pyuic5/pyside2-uic, pyrcc5/pyside2-rcc ++ Detects PyQt5 or PySide2 programs such as pyuic5/pyside2-uic, pyrcc5/pyside2-rcc + """ + env = self.env + +- if getattr(Options.options, 'want_pyside2', True): ++ if getattr(Options.options, 'want_pyqt5', True): ++ self.find_program(['pyuic5'], var='QT_PYUIC') ++ self.find_program(['pyrcc5'], var='QT_PYRCC') ++ self.find_program(['pylupdate5'], var='QT_PYLUPDATE') ++ elif getattr(Options.options, 'want_pyside2', True): + self.find_program(['pyside2-uic'], var='QT_PYUIC') + self.find_program(['pyside2-rcc'], var='QT_PYRCC') + self.find_program(['pyside2-lupdate'], var='QT_PYLUPDATE') +@@ -227,7 +231,7 @@ def find_pyqt5_binaries(self): + if not env.QT_PYUIC: + self.fatal('cannot find the uic compiler for python for qt5') + +- if not env.QT_PYUIC: ++ if not env.QT_PYRCC: + self.fatal('cannot find the rcc compiler for python for qt5') + + self.find_program(['lrelease-qt5', 'lrelease'], var='QT_LRELEASE') +@@ -237,5 +241,6 @@ def options(opt): + Command-line options + """ + pyqt5opt=opt.add_option_group("Python QT5 Options") +- pyqt5opt.add_option('--pyqt5-pyside2', action='store_true', default=False, dest='want_pyside2', help='use pyside2 bindings as python QT5 bindings (default PyQt5 is searched first, PySide2 after)') ++ pyqt5opt.add_option('--pyqt5-pyqt5', action='store_true', default=False, dest='want_pyqt5', help='use PyQt5 bindings as python QT5 bindings (default PyQt5 is searched first, PySide2 after, PyQt4 last)') ++ pyqt5opt.add_option('--pyqt5-pyside2', action='store_true', default=False, dest='want_pyside2', help='use PySide2 bindings as python QT5 bindings (default PyQt5 is searched first, PySide2 after, PyQt4 last)') + pyqt5opt.add_option('--pyqt5-pyqt4', action='store_true', default=False, dest='want_pyqt4', help='use PyQt4 bindings as python QT5 bindings (default PyQt5 is searched first, PySide2 after, PyQt4 last)') +diff --git a/third_party/waf/waflib/extras/qt4.py b/third_party/waf/waflib/extras/qt4.py +index 90cae7e0ae5..d19a4ddac3f 100644 +--- a/third_party/waf/waflib/extras/qt4.py ++++ b/third_party/waf/waflib/extras/qt4.py +@@ -290,11 +290,11 @@ def apply_qt4(self): + + The additional parameters are: + +- :param lang: list of translation files (\*.ts) to process ++ :param lang: list of translation files (\\*.ts) to process + :type lang: list of :py:class:`waflib.Node.Node` or string without the .ts extension +- :param update: whether to process the C++ files to update the \*.ts files (use **waf --translate**) ++ :param update: whether to process the C++ files to update the \\*.ts files (use **waf --translate**) + :type update: bool +- :param langname: if given, transform the \*.ts files into a .qrc files to include in the binary file ++ :param langname: if given, transform the \\*.ts files into a .qrc files to include in the binary file + :type langname: :py:class:`waflib.Node.Node` or string without the .qrc extension + """ + if getattr(self, 'lang', None): +diff --git a/third_party/waf/waflib/extras/remote.py b/third_party/waf/waflib/extras/remote.py +index 3b038f772b5..f43b600f023 100644 +--- a/third_party/waf/waflib/extras/remote.py ++++ b/third_party/waf/waflib/extras/remote.py +@@ -203,7 +203,7 @@ class remote(BuildContext): + Options.commands.remove(k) + + def login_to_host(self, login): +- return re.sub('(\w+@)', '', login) ++ return re.sub(r'(\w+@)', '', login) + + def variant_to_login(self, variant): + """linux_32_debug -> search env.LINUX_32 and then env.LINUX""" +diff --git a/third_party/waf/waflib/extras/run_do_script.py b/third_party/waf/waflib/extras/run_do_script.py +index f3c58122c9b..07e3aa2591c 100644 +--- a/third_party/waf/waflib/extras/run_do_script.py ++++ b/third_party/waf/waflib/extras/run_do_script.py +@@ -101,7 +101,7 @@ class run_do_script(run_do_script_base): + with open(**kwargs) as log: + log_tail = log.readlines()[-10:] + for line in log_tail: +- error_found = re.match("r\(([0-9]+)\)", line) ++ error_found = re.match(r"r\(([0-9]+)\)", line) + if error_found: + return error_found.group(1), ''.join(log_tail) + else: +diff --git a/third_party/waf/waflib/extras/sphinx.py b/third_party/waf/waflib/extras/sphinx.py +new file mode 100644 +index 00000000000..ce11110e634 +--- /dev/null ++++ b/third_party/waf/waflib/extras/sphinx.py +@@ -0,0 +1,81 @@ ++"""Support for Sphinx documentation ++ ++This is a wrapper for sphinx-build program. Please note that sphinx-build supports only one output format which can ++passed to build via sphinx_output_format attribute. The default output format is html. ++ ++Example wscript: ++ ++def configure(cnf): ++ conf.load('sphinx') ++ ++def build(bld): ++ bld( ++ features='sphinx', ++ sphinx_source='sources', # path to source directory ++ sphinx_options='-a -v', # sphinx-build program additional options ++ sphinx_output_format='man' # output format of sphinx documentation ++ ) ++ ++""" ++ ++from waflib.Node import Node ++from waflib import Utils ++from waflib.Task import Task ++from waflib.TaskGen import feature, after_method ++ ++ ++def configure(cnf): ++ """Check if sphinx-build program is available and loads gnu_dirs tool.""" ++ cnf.find_program('sphinx-build', var='SPHINX_BUILD', mandatory=False) ++ cnf.load('gnu_dirs') ++ ++ ++@feature('sphinx') ++def build_sphinx(self): ++ """Builds sphinx sources. ++ """ ++ if not self.env.SPHINX_BUILD: ++ self.bld.fatal('Program SPHINX_BUILD not defined.') ++ if not getattr(self, 'sphinx_source', None): ++ self.bld.fatal('Attribute sphinx_source not defined.') ++ if not isinstance(self.sphinx_source, Node): ++ self.sphinx_source = self.path.find_node(self.sphinx_source) ++ if not self.sphinx_source: ++ self.bld.fatal('Can\'t find sphinx_source: %r' % self.sphinx_source) ++ ++ Utils.def_attrs(self, sphinx_output_format='html') ++ self.env.SPHINX_OUTPUT_FORMAT = self.sphinx_output_format ++ self.env.SPHINX_OPTIONS = getattr(self, 'sphinx_options', []) ++ ++ for source_file in self.sphinx_source.ant_glob('**/*'): ++ self.bld.add_manual_dependency(self.sphinx_source, source_file) ++ ++ sphinx_build_task = self.create_task('SphinxBuildingTask') ++ sphinx_build_task.set_inputs(self.sphinx_source) ++ sphinx_build_task.set_outputs(self.path.get_bld()) ++ ++ # the sphinx-build results are in directory ++ sphinx_output_directory = self.path.get_bld().make_node(self.env.SPHINX_OUTPUT_FORMAT) ++ sphinx_output_directory.mkdir() ++ Utils.def_attrs(self, install_path=get_install_path(self)) ++ self.add_install_files(install_to=self.install_path, ++ install_from=sphinx_output_directory.ant_glob('**/*'), ++ cwd=sphinx_output_directory, ++ relative_trick=True) ++ ++ ++def get_install_path(tg): ++ if tg.env.SPHINX_OUTPUT_FORMAT == 'man': ++ return tg.env.MANDIR ++ elif tg.env.SPHINX_OUTPUT_FORMAT == 'info': ++ return tg.env.INFODIR ++ else: ++ return tg.env.DOCDIR ++ ++ ++class SphinxBuildingTask(Task): ++ color = 'BOLD' ++ run_str = '${SPHINX_BUILD} -M ${SPHINX_OUTPUT_FORMAT} ${SRC} ${TGT} ${SPHINX_OPTIONS}' ++ ++ def keyword(self): ++ return 'Compiling (%s)' % self.env.SPHINX_OUTPUT_FORMAT +diff --git a/third_party/waf/waflib/extras/swig.py b/third_party/waf/waflib/extras/swig.py +index fd3d6d2c995..740ab46d963 100644 +--- a/third_party/waf/waflib/extras/swig.py ++++ b/third_party/waf/waflib/extras/swig.py +@@ -17,10 +17,10 @@ tasks have to be added dynamically: + + SWIG_EXTS = ['.swig', '.i'] + +-re_module = re.compile('%module(?:\s*\(.*\))?\s+(.+)', re.M) ++re_module = re.compile(r'%module(?:\s*\(.*\))?\s+(.+)', re.M) + + re_1 = re.compile(r'^%module.*?\s+([\w]+)\s*?$', re.M) +-re_2 = re.compile('[#%]include [<"](.*)[">]', re.M) ++re_2 = re.compile(r'[#%](?:include|import(?:\(module=".*"\))+|python(?:begin|code)) [<"](.*)[">]', re.M) + + class swig(Task.Task): + color = 'BLUE' +diff --git a/third_party/waf/waflib/extras/syms.py b/third_party/waf/waflib/extras/syms.py +index dfa005930e4..562f708e1ea 100644 +--- a/third_party/waf/waflib/extras/syms.py ++++ b/third_party/waf/waflib/extras/syms.py +@@ -31,7 +31,7 @@ class gen_sym(Task): + if self.env.DEST_BINFMT == 'pe': #gcc uses nm, and has a preceding _ on windows + re_nm = re.compile(r'(T|D)\s+_(?P%s)\b' % reg) + elif self.env.DEST_BINFMT=='mac-o': +- re_nm=re.compile(r'(T|D)\s+(?P_?%s)\b' % reg) ++ re_nm=re.compile(r'(T|D)\s+(?P_?(%s))\b' % reg) + else: + re_nm = re.compile(r'(T|D)\s+(?P%s)\b' % reg) + cmd = (self.env.NM or ['nm']) + ['-g', obj.abspath()] +diff --git a/third_party/waf/waflib/extras/use_config.py b/third_party/waf/waflib/extras/use_config.py +index 71df793a2a3..ef5129f219b 100644 +--- a/third_party/waf/waflib/extras/use_config.py ++++ b/third_party/waf/waflib/extras/use_config.py +@@ -52,7 +52,7 @@ import os + + local_repo = '' + """Local repository containing additional Waf tools (plugins)""" +-remote_repo = 'https://raw.githubusercontent.com/waf-project/waf/master/' ++remote_repo = 'https://gitlab.com/ita1024/waf/raw/master/' + """ + Remote directory containing downloadable waf tools. The missing tools can be downloaded by using:: + +diff --git a/third_party/waf/waflib/extras/xcode6.py b/third_party/waf/waflib/extras/xcode6.py +index c062a74e4fc..91bbff181ec 100644 +--- a/third_party/waf/waflib/extras/xcode6.py ++++ b/third_party/waf/waflib/extras/xcode6.py +@@ -147,7 +147,7 @@ def newid(): + Represents a tree node in the XCode project plist file format. + When written to a file, all attributes of XCodeNode are stringified together with + its value. However, attributes starting with an underscore _ are ignored +-during that process and allows you to store arbitray values that are not supposed ++during that process and allows you to store arbitrary values that are not supposed + to be written out. + """ + class XCodeNode(object): +@@ -247,7 +247,7 @@ class PBXBuildFile(XCodeNode): + # fileRef is a reference to a PBXFileReference object + self.fileRef = fileRef + +- # A map of key/value pairs for additionnal settings. ++ # A map of key/value pairs for additional settings. + self.settings = settings + + def __hash__(self): +@@ -435,8 +435,8 @@ class PBXProject(XCodeNode): + def create_target_dependency(self, target, name): + """ : param target : PXBNativeTarget """ + proxy = PBXContainerItemProxy(self, target, name) +- dependecy = PBXTargetDependency(target, proxy) +- return dependecy ++ dependency = PBXTargetDependency(target, proxy) ++ return dependency + + def write(self, file): + +diff --git a/third_party/waf/waflib/processor.py b/third_party/waf/waflib/processor.py +index 2eecf3bd93f..eff2e69adfb 100755 +--- a/third_party/waf/waflib/processor.py ++++ b/third_party/waf/waflib/processor.py +@@ -27,6 +27,10 @@ def run(): + [cmd, kwargs, cargs] = cPickle.loads(base64.b64decode(txt)) + cargs = cargs or {} + ++ if not 'close_fds' in kwargs: ++ # workers have no fds ++ kwargs['close_fds'] = False ++ + ret = 1 + out, err, ex, trace = (None, None, None, None) + try: +-- +2.21.0 + diff --git a/samba.spec b/samba.spec index 5414a05..44efa8b 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 1 +%define main_release 2 %define samba_version 4.10.5 %define talloc_version 2.1.16 @@ -121,6 +121,8 @@ Source201: README.downgrade Patch0: samba-4.10.6-vfs_fruit.patch Patch1: samba-4.10.6-vfs_glusterfs.patch Patch2: samba-4.10.6-smbspool.patch +Patch3: samba-4.10.x-waf_update.patch +Patch4: samba-4.10.x-waf_timer.patch Requires(pre): /usr/sbin/groupadd Requires(post): systemd @@ -3439,6 +3441,10 @@ fi %endif # with_clustering_support %changelog +* Mon Jul 01 2019 Guenther Deschner - 4.10.5-2 +- resolves: #1718113 - Avoid deprecated time.clock in wafsamba +- resolves: #1711638 - Update to latest waf version 2.0.17 + * Thu Jun 20 2019 Guenther Deschner - 4.10.5-1 - resolves: #1602824 - Make vfs_fruit operable with other remote VFS modules - resolves: #1716455 - Avoid pathconf() in get_real_filename() VFS calls From f69b2b0217f457cf3552dbbb05fe470456356e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Mon, 8 Jul 2019 16:10:49 +0200 Subject: [PATCH 64/76] Update to Samba 4.10.6 Guenther --- .gitignore | 2 + samba-4.10.6-smbspool.patch | 1127 ----------- samba-4.10.6-vfs_fruit.patch | 3175 ------------------------------ samba-4.10.6-vfs_glusterfs.patch | 276 --- samba-4.10.x-waf_timer.patch | 115 -- samba.spec | 15 +- sources | 4 +- 7 files changed, 11 insertions(+), 4703 deletions(-) delete mode 100644 samba-4.10.6-smbspool.patch delete mode 100644 samba-4.10.6-vfs_fruit.patch delete mode 100644 samba-4.10.6-vfs_glusterfs.patch delete mode 100644 samba-4.10.x-waf_timer.patch diff --git a/.gitignore b/.gitignore index 2ae044a..c351ef4 100644 --- a/.gitignore +++ b/.gitignore @@ -167,3 +167,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.4.tar.asc /samba-4.10.5.tar.xz /samba-4.10.5.tar.asc +/samba-4.10.6.tar.xz +/samba-4.10.6.tar.asc diff --git a/samba-4.10.6-smbspool.patch b/samba-4.10.6-smbspool.patch deleted file mode 100644 index fa12f06..0000000 --- a/samba-4.10.6-smbspool.patch +++ /dev/null @@ -1,1127 +0,0 @@ -From 16056895403f3c673dc5adc531b7e739d46292fb Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 13 May 2019 16:55:49 +0200 -Subject: [PATCH 1/9] s3:smbspool: Add the 'lp' group to the users groups - -This is required to access files in /var/spool/cups which have been -temporarily created in there by CUPS. - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 - -Signed-off-by: Andreas Schneider -Reviewed-by: Guenther Deschner -(cherry picked from commit 6086efb6808089c431e7307fa239924bfda1185b) ---- - source3/client/smbspool_krb5_wrapper.c | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c -index 5c4da33238b..e6684fc0d0c 100644 ---- a/source3/client/smbspool_krb5_wrapper.c -+++ b/source3/client/smbspool_krb5_wrapper.c -@@ -82,6 +82,7 @@ int main(int argc, char *argv[]) - { - char smbspool_cmd[PATH_MAX] = {0}; - struct passwd *pwd; -+ struct group *g = NULL; - char gen_cc[PATH_MAX] = {0}; - struct stat sb; - char *env = NULL; -@@ -89,6 +90,7 @@ int main(int argc, char *argv[]) - char device_uri[4096] = {0}; - uid_t uid = (uid_t)-1; - gid_t gid = (gid_t)-1; -+ gid_t groups[1] = { (gid_t)-1 }; - unsigned long tmp; - int cmp; - int rc; -@@ -176,6 +178,26 @@ int main(int argc, char *argv[]) - return CUPS_BACKEND_FAILED; - } - -+ /* -+ * We need the primary group of the 'lp' user. This is needed to access -+ * temporary files in /var/spool/cups/. -+ */ -+ g = getgrnam("lp"); -+ if (g == NULL) { -+ CUPS_SMB_ERROR("Failed to find user 'lp' - %s", -+ strerror(errno)); -+ return CUPS_BACKEND_FAILED; -+ } -+ -+ CUPS_SMB_DEBUG("Adding group 'lp' (%u)", g->gr_gid); -+ groups[0] = g->gr_gid; -+ rc = setgroups(sizeof(groups), groups); -+ if (rc != 0) { -+ CUPS_SMB_ERROR("Failed to set groups for 'lp' - %s", -+ strerror(errno)); -+ return CUPS_BACKEND_FAILED; -+ } -+ - CUPS_SMB_DEBUG("Switching to gid=%d", gid); - rc = setgid(gid); - if (rc != 0) { --- -2.21.0 - - -From a6b29458e833db85057ef1b7c0403e90f76adfa4 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Thu, 16 May 2019 13:41:02 +0200 -Subject: [PATCH 2/9] s3:smbspool: Print the principal we use to authenticate - with - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 - -Signed-off-by: Andreas Schneider -Reviewed-by: Guenther Deschner -(cherry picked from commit 42492d547661cb7a98c237b32d42ee93de35aba5) ---- - source3/client/smbspool.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c -index 22071613677..efbdd418fdb 100644 ---- a/source3/client/smbspool.c -+++ b/source3/client/smbspool.c -@@ -616,6 +616,7 @@ static bool kerberos_ccache_is_valid(void) { - return false; - } else { - krb5_principal default_princ = NULL; -+ char *princ_name = NULL; - - code = krb5_cc_get_principal(ctx, - ccache, -@@ -625,6 +626,16 @@ static bool kerberos_ccache_is_valid(void) { - krb5_free_context(ctx); - return false; - } -+ -+ code = krb5_unparse_name(ctx, -+ default_princ, -+ &princ_name); -+ if (code == 0) { -+ fprintf(stderr, -+ "DEBUG: Try to authenticate as %s\n", -+ princ_name); -+ krb5_free_unparsed_name(ctx, princ_name); -+ } - krb5_free_principal(ctx, default_princ); - } - krb5_cc_close(ctx, ccache); --- -2.21.0 - - -From b64ed8bb51c7c78d757881fc3944f7bc812f5457 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Thu, 16 May 2019 14:25:00 +0200 -Subject: [PATCH 3/9] s3:smbspool: Add debug for finding KRB5CCNAME - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 - -Signed-off-by: Andreas Schneider -Reviewed-by: Guenther Deschner -(cherry picked from commit 3632bfef25e471075886eb7aecddd4cc260db8ba) ---- - source3/client/smbspool_krb5_wrapper.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c -index e6684fc0d0c..2cdcd372ec6 100644 ---- a/source3/client/smbspool_krb5_wrapper.c -+++ b/source3/client/smbspool_krb5_wrapper.c -@@ -219,10 +219,14 @@ int main(int argc, char *argv[]) - env = getenv("KRB5CCNAME"); - if (env != NULL && env[0] != 0) { - snprintf(gen_cc, sizeof(gen_cc), "%s", env); -+ CUPS_SMB_DEBUG("User already set KRB5CCNAME [%s] as ccache", -+ gen_cc); - - goto create_env; - } - -+ CUPS_SMB_DEBUG("Trying to guess KRB5CCNAME (FILE, DIR, KEYRING)"); -+ - snprintf(gen_cc, sizeof(gen_cc), "/tmp/krb5cc_%d", uid); - - rc = lstat(gen_cc, &sb); --- -2.21.0 - - -From 3b7be905d256955e7e8c056f14626547e08fea2d Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Thu, 16 May 2019 17:10:57 +0200 -Subject: [PATCH 4/9] s3:smbspool: Use %u format specifier to print uid - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 - -Signed-off-by: Andreas Schneider -Reviewed-by: Guenther Deschner -(cherry picked from commit be596ce3d2455bd49a8ebd311d8c764c37852858) ---- - source3/client/smbspool_krb5_wrapper.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c -index 2cdcd372ec6..3266b90ec1a 100644 ---- a/source3/client/smbspool_krb5_wrapper.c -+++ b/source3/client/smbspool_krb5_wrapper.c -@@ -227,13 +227,13 @@ int main(int argc, char *argv[]) - - CUPS_SMB_DEBUG("Trying to guess KRB5CCNAME (FILE, DIR, KEYRING)"); - -- snprintf(gen_cc, sizeof(gen_cc), "/tmp/krb5cc_%d", uid); -+ snprintf(gen_cc, sizeof(gen_cc), "/tmp/krb5cc_%u", uid); - - rc = lstat(gen_cc, &sb); - if (rc == 0) { -- snprintf(gen_cc, sizeof(gen_cc), "FILE:/tmp/krb5cc_%d", uid); -+ snprintf(gen_cc, sizeof(gen_cc), "FILE:/tmp/krb5cc_%u", uid); - } else { -- snprintf(gen_cc, sizeof(gen_cc), "/run/user/%d/krb5cc", uid); -+ snprintf(gen_cc, sizeof(gen_cc), "/run/user/%u/krb5cc", uid); - - rc = lstat(gen_cc, &sb); - if (rc == 0 && S_ISDIR(sb.st_mode)) { --- -2.21.0 - - -From 6e2069b014358b6f7e04121fa39c5f2750506d78 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Thu, 16 May 2019 17:40:43 +0200 -Subject: [PATCH 5/9] s3:smbspool: Fallback to default ccache if KRB5CCNAME is - not set - -This could also support the new KCM credential cache storage. - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 - -Signed-off-by: Andreas Schneider -Reviewed-by: Guenther Deschner -(cherry picked from commit 6bbdf69e406916107400e2cabdbc831e2a2bbee3) ---- - source3/client/smbspool_krb5_wrapper.c | 79 ++++++++++++++++++-------- - source3/wscript_build | 1 + - 2 files changed, 55 insertions(+), 25 deletions(-) - -diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c -index 3266b90ec1a..bff1df417e8 100644 ---- a/source3/client/smbspool_krb5_wrapper.c -+++ b/source3/client/smbspool_krb5_wrapper.c -@@ -21,6 +21,7 @@ - - #include "includes.h" - #include "system/filesys.h" -+#include "system/kerberos.h" - #include "system/passwd.h" - - #include -@@ -68,6 +69,50 @@ static void cups_smb_debug(enum cups_smb_dbglvl_e lvl, const char *format, ...) - buffer); - } - -+static bool kerberos_get_default_ccache(char *ccache_buf, size_t len) -+{ -+ krb5_context ctx; -+ const char *ccache_name = NULL; -+ char *full_ccache_name = NULL; -+ krb5_ccache ccache = NULL; -+ krb5_error_code code; -+ -+ code = krb5_init_context(&ctx); -+ if (code != 0) { -+ return false; -+ } -+ -+ ccache_name = krb5_cc_default_name(ctx); -+ if (ccache_name == NULL) { -+ krb5_free_context(ctx); -+ return false; -+ } -+ -+ code = krb5_cc_resolve(ctx, ccache_name, &ccache); -+ if (code != 0) { -+ krb5_free_context(ctx); -+ return false; -+ } -+ -+ code = krb5_cc_get_full_name(ctx, ccache, &full_ccache_name); -+ krb5_cc_close(ctx, ccache); -+ if (code != 0) { -+ krb5_free_context(ctx); -+ return false; -+ } -+ -+ snprintf(ccache_buf, len, "%s", full_ccache_name); -+ -+#ifdef SAMBA4_USES_HEIMDAL -+ free(full_ccache_name); -+#else -+ krb5_free_string(ctx, full_ccache_name); -+#endif -+ krb5_free_context(ctx); -+ -+ return true; -+} -+ - /* - * This is a helper binary to execute smbspool. - * -@@ -84,7 +129,6 @@ int main(int argc, char *argv[]) - struct passwd *pwd; - struct group *g = NULL; - char gen_cc[PATH_MAX] = {0}; -- struct stat sb; - char *env = NULL; - char auth_info_required[256] = {0}; - char device_uri[4096] = {0}; -@@ -92,6 +136,7 @@ int main(int argc, char *argv[]) - gid_t gid = (gid_t)-1; - gid_t groups[1] = { (gid_t)-1 }; - unsigned long tmp; -+ bool ok; - int cmp; - int rc; - -@@ -225,32 +270,16 @@ int main(int argc, char *argv[]) - goto create_env; - } - -- CUPS_SMB_DEBUG("Trying to guess KRB5CCNAME (FILE, DIR, KEYRING)"); -- -- snprintf(gen_cc, sizeof(gen_cc), "/tmp/krb5cc_%u", uid); -- -- rc = lstat(gen_cc, &sb); -- if (rc == 0) { -- snprintf(gen_cc, sizeof(gen_cc), "FILE:/tmp/krb5cc_%u", uid); -- } else { -- snprintf(gen_cc, sizeof(gen_cc), "/run/user/%u/krb5cc", uid); -- -- rc = lstat(gen_cc, &sb); -- if (rc == 0 && S_ISDIR(sb.st_mode)) { -- snprintf(gen_cc, -- sizeof(gen_cc), -- "DIR:/run/user/%d/krb5cc", -- uid); -- } else { --#if defined(__linux__) -- snprintf(gen_cc, -- sizeof(gen_cc), -- "KEYRING:persistent:%d", -- uid); --#endif -- } -+ ok = kerberos_get_default_ccache(gen_cc, sizeof(gen_cc)); -+ if (ok) { -+ CUPS_SMB_DEBUG("Use default KRB5CCNAME [%s]", -+ gen_cc); -+ goto create_env; - } - -+ /* Fallback to a FILE ccache */ -+ snprintf(gen_cc, sizeof(gen_cc), "FILE:/tmp/krb5cc_%u", uid); -+ - create_env: - /* - * Make sure we do not have LD_PRELOAD or other security relevant -diff --git a/source3/wscript_build b/source3/wscript_build -index f67ce59fe52..8e34b7d0261 100644 ---- a/source3/wscript_build -+++ b/source3/wscript_build -@@ -1134,6 +1134,7 @@ bld.SAMBA3_BINARY('smbspool_krb5_wrapper', - deps=''' - DYNCONFIG - cups -+ krb5 - ''', - install_path='${LIBEXECDIR}/samba', - enabled=bld.CONFIG_SET('HAVE_CUPS')) --- -2.21.0 - - -From d6673500b639ad1402014aa35113bd395e35d4f5 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 13 May 2019 16:48:31 +0200 -Subject: [PATCH 6/9] s3:smbspool: Print the filename we failed to open - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 - -Signed-off-by: Andreas Schneider -Reviewed-by: Guenther Deschner -(cherry picked from commit 281274572bcc3125fe6026a01ef7bf7ef584a0dd) ---- - source3/client/smbspool.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c -index efbdd418fdb..ef16c2bed42 100644 ---- a/source3/client/smbspool.c -+++ b/source3/client/smbspool.c -@@ -224,7 +224,9 @@ main(int argc, /* I - Number of command-line arguments */ - - fp = fopen(print_file, "rb"); - if (fp == NULL) { -- perror("ERROR: Unable to open print file"); -+ fprintf(stderr, -+ "ERROR: Unable to open print file: %s", -+ print_file); - goto done; - } - --- -2.21.0 - - -From ea931f33d92506cdab17a7b746e43831d6bf2112 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 13 May 2019 18:54:02 +0200 -Subject: [PATCH 7/9] s3:smbspool: Always try to authenticate using Kerberos - -If username and password is given, then fallback to NTLM. However try -kinit first. Also we correctly handle NULL passwords in the meantime and -this makes it easier to deal with issues. - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 - -Signed-off-by: Andreas Schneider -Reviewed-by: Guenther Deschner -(cherry picked from commit 3d719a1f85db8e423dc3a4116a2228961d5ac48d) ---- - source3/client/smbspool.c | 90 ++++++++++++++++++++++----------------- - 1 file changed, 51 insertions(+), 39 deletions(-) - -diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c -index ef16c2bed42..f21aac2ac58 100644 ---- a/source3/client/smbspool.c -+++ b/source3/client/smbspool.c -@@ -88,8 +88,8 @@ main(int argc, /* I - Number of command-line arguments */ - int port; /* Port number */ - char uri[1024], /* URI */ - *sep, /* Pointer to separator */ -- *tmp, *tmp2, /* Temp pointers to do escaping */ -- *password; /* Password */ -+ *tmp, *tmp2; /* Temp pointers to do escaping */ -+ const char *password = NULL; /* Password */ - char *username, /* Username */ - *server, /* Server name */ - *printer;/* Printer name */ -@@ -293,8 +293,6 @@ main(int argc, /* I - Number of command-line arguments */ - if ((tmp2 = strchr_m(tmp, ':')) != NULL) { - *tmp2++ = '\0'; - password = uri_unescape_alloc(tmp2); -- } else { -- password = empty_str; - } - username = uri_unescape_alloc(tmp); - } else { -@@ -302,14 +300,15 @@ main(int argc, /* I - Number of command-line arguments */ - username = empty_str; - } - -- if ((password = getenv("AUTH_PASSWORD")) == NULL) { -- password = empty_str; -+ env = getenv("AUTH_PASSWORD"); -+ if (env != NULL && strlen(env) > 0) { -+ password = env; - } - - server = uri + 6; - } - -- if (password != empty_str) { -+ if (password != NULL) { - auth_info_required = "username,password"; - } - -@@ -514,6 +513,7 @@ smb_complete_connection(const char *myname, - NTSTATUS nt_status; - struct cli_credentials *creds = NULL; - bool use_kerberos = false; -+ bool fallback_after_kerberos = false; - - /* Start the SMB connection */ - *need_auth = false; -@@ -524,27 +524,21 @@ smb_complete_connection(const char *myname, - return NULL; - } - -- /* -- * We pretty much guarantee password must be valid or a pointer to a -- * 0 char. -- */ -- if (!password) { -- *need_auth = true; -- return NULL; -- } -- - if (flags & CLI_FULL_CONNECTION_USE_KERBEROS) { -- auth_info_required = "negotiate"; - use_kerberos = true; - } - -+ if (flags & CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS) { -+ fallback_after_kerberos = true; -+ } -+ - creds = cli_session_creds_init(cli, - username, - workgroup, - NULL, /* realm */ - password, - use_kerberos, -- false, /* fallback_after_kerberos */ -+ fallback_after_kerberos, - false, /* use_ccache */ - false); /* password_is_nt_hash */ - if (creds == NULL) { -@@ -663,6 +657,10 @@ smb_connect(const char *workgroup, /* I - Workgroup */ - struct cli_state *cli; /* New connection */ - char *myname = NULL; /* Client name */ - struct passwd *pwd; -+ int flags = CLI_FULL_CONNECTION_USE_KERBEROS; -+ bool use_kerberos = false; -+ const char *user = username; -+ int cmp; - - /* - * Get the names and addresses of the client and server... -@@ -672,42 +670,56 @@ smb_connect(const char *workgroup, /* I - Workgroup */ - return NULL; - } - -- /* -- * See if we have a username first. This is for backwards compatible -- * behavior with 3.0.14a -- */ - -- if (username == NULL || username[0] == '\0') { -- if (kerberos_ccache_is_valid()) { -- goto kerberos_auth; -+ cmp = strcmp(auth_info_required, "negotiate"); -+ if (cmp == 0) { -+ if (!kerberos_ccache_is_valid()) { -+ return NULL; - } -+ user = jobusername; -+ -+ use_kerberos = true; -+ fprintf(stderr, -+ "DEBUG: Try to connect using Kerberos ...\n"); -+ } -+ -+ cmp = strcmp(auth_info_required, "username,password"); -+ if (cmp == 0) { -+ if (username == NULL || username[0] == '\0') { -+ return NULL; -+ } -+ -+ /* Fallback to NTLM */ -+ flags |= CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS; -+ -+ fprintf(stderr, -+ "DEBUG: Try to connect using username/password ...\n"); -+ } -+ -+ cmp = strcmp(auth_info_required, "none"); -+ if (cmp == 0) { -+ fprintf(stderr, -+ "DEBUG: This backend doesn't support none auth ...\n"); -+ return NULL; - } - - cli = smb_complete_connection(myname, - server, - port, -- username, -+ user, - password, - workgroup, - share, -- 0, -+ flags, - need_auth); - if (cli != NULL) { -- fputs("DEBUG: Connected with username/password...\n", stderr); -+ fprintf(stderr, "DEBUG: SMB connection established.\n"); - return (cli); - } - --kerberos_auth: -- /* -- * Try to use the user kerberos credentials (if any) to authenticate -- */ -- cli = smb_complete_connection(myname, server, port, jobusername, "", -- workgroup, share, -- CLI_FULL_CONNECTION_USE_KERBEROS, need_auth); -- -- if (cli) { -- fputs("DEBUG: Connected using Kerberos...\n", stderr); -- return (cli); -+ if (!use_kerberos) { -+ fprintf(stderr, "ERROR: SMB connection failed!\n"); -+ return NULL; - } - - /* give a chance for a passwordless NTLMSSP session setup */ --- -2.21.0 - - -From 8689e83030160fbdbe9b72ff0c86826b49f707a1 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Thu, 16 May 2019 18:24:32 +0200 -Subject: [PATCH 8/9] s3:smbspool: Add debug messages to - kerberos_ccache_is_valid() - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 - -Signed-off-by: Andreas Schneider -Reviewed-by: Guenther Deschner -(cherry picked from commit 93acd880801524c5e621df7b5bf5ad650f93cec3) ---- - source3/client/smbspool.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c -index f21aac2ac58..79e210dd12e 100644 ---- a/source3/client/smbspool.c -+++ b/source3/client/smbspool.c -@@ -602,12 +602,15 @@ static bool kerberos_ccache_is_valid(void) { - - ccache_name = krb5_cc_default_name(ctx); - if (ccache_name == NULL) { -+ DBG_ERR("Failed to get default ccache name\n"); - krb5_free_context(ctx); - return false; - } - - code = krb5_cc_resolve(ctx, ccache_name, &ccache); - if (code != 0) { -+ DBG_ERR("Failed to resolve ccache name: %s\n", -+ ccache_name); - krb5_free_context(ctx); - return false; - } else { -@@ -618,6 +621,9 @@ static bool kerberos_ccache_is_valid(void) { - ccache, - &default_princ); - if (code != 0) { -+ DBG_ERR("Failed to get default principal from " -+ "ccache: %s\n", -+ ccache_name); - krb5_cc_close(ctx, ccache); - krb5_free_context(ctx); - return false; --- -2.21.0 - - -From d1cee66a5e66d83b2aee3a803351c51d4f5a8118 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Tue, 14 May 2019 11:35:46 +0200 -Subject: [PATCH 9/9] s3:smbspool: Use NTSTATUS return codes - -This allows us to simplify some code and return better errors. - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 - -Signed-off-by: Andreas Schneider -Reviewed-by: Guenther Deschner -(cherry picked from commit d9af3dc02e98a3eb22441dfbdeddbaca0af078ea) ---- - source3/client/smbspool.c | 250 ++++++++++++++++++++++---------------- - 1 file changed, 145 insertions(+), 105 deletions(-) - -diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c -index 79e210dd12e..ad988eb0df9 100644 ---- a/source3/client/smbspool.c -+++ b/source3/client/smbspool.c -@@ -61,12 +61,27 @@ - * Local functions... - */ - --static int get_exit_code(struct cli_state * cli, NTSTATUS nt_status); -+static int get_exit_code(NTSTATUS nt_status); - static void list_devices(void); --static struct cli_state *smb_complete_connection(const char *, const char *, -- int, const char *, const char *, const char *, const char *, int, bool *need_auth); --static struct cli_state *smb_connect(const char *, const char *, int, const -- char *, const char *, const char *, const char *, bool *need_auth); -+static NTSTATUS -+smb_complete_connection(struct cli_state **output_cli, -+ const char *myname, -+ const char *server, -+ int port, -+ const char *username, -+ const char *password, -+ const char *workgroup, -+ const char *share, -+ int flags); -+static NTSTATUS -+smb_connect(struct cli_state **output_cli, -+ const char *workgroup, -+ const char *server, -+ const int port, -+ const char *share, -+ const char *username, -+ const char *password, -+ const char *jobusername); - static int smb_print(struct cli_state *, const char *, FILE *); - static char *uri_unescape_alloc(const char *); - #if 0 -@@ -90,16 +105,15 @@ main(int argc, /* I - Number of command-line arguments */ - *sep, /* Pointer to separator */ - *tmp, *tmp2; /* Temp pointers to do escaping */ - const char *password = NULL; /* Password */ -- char *username, /* Username */ -- *server, /* Server name */ -+ const char *username = NULL; /* Username */ -+ char *server, /* Server name */ - *printer;/* Printer name */ - const char *workgroup; /* Workgroup */ - FILE *fp; /* File to print */ - int status = 1; /* Status of LPD job */ -- struct cli_state *cli; /* SMB interface */ -- char empty_str[] = ""; -+ NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; -+ struct cli_state *cli = NULL; /* SMB interface */ - int tries = 0; -- bool need_auth = true; - const char *dev_uri = NULL; - const char *env = NULL; - const char *config_file = NULL; -@@ -296,8 +310,9 @@ main(int argc, /* I - Number of command-line arguments */ - } - username = uri_unescape_alloc(tmp); - } else { -- if ((username = getenv("AUTH_USERNAME")) == NULL) { -- username = empty_str; -+ env = getenv("AUTH_USERNAME"); -+ if (env != NULL && strlen(env) > 0) { -+ username = env; - } - - env = getenv("AUTH_PASSWORD"); -@@ -369,27 +384,39 @@ main(int argc, /* I - Number of command-line arguments */ - load_interfaces(); - - do { -- cli = smb_connect(workgroup, -- server, -- port, -- printer, -- username, -- password, -- print_user, -- &need_auth); -- if (cli == NULL) { -- if (need_auth) { -- exit(2); -+ nt_status = smb_connect(&cli, -+ workgroup, -+ server, -+ port, -+ printer, -+ username, -+ password, -+ print_user); -+ if (!NT_STATUS_IS_OK(nt_status)) { -+ status = get_exit_code(nt_status); -+ if (status == 2) { -+ fprintf(stderr, -+ "DEBUG: Unable to connect to CIFS " -+ "host: %s", -+ nt_errstr(nt_status)); -+ goto done; - } else if (getenv("CLASS") == NULL) { -- fprintf(stderr, "ERROR: Unable to connect to CIFS host, will retry in 60 seconds...\n"); -+ fprintf(stderr, -+ "ERROR: Unable to connect to CIFS " -+ "host: %s. Will retry in 60 " -+ "seconds...\n", -+ nt_errstr(nt_status)); - sleep(60); - tries++; - } else { -- fprintf(stderr, "ERROR: Unable to connect to CIFS host, trying next printer...\n"); -+ fprintf(stderr, -+ "ERROR: Unable to connect to CIFS " -+ "host: %s. Trying next printer...\n", -+ nt_errstr(nt_status)); - goto done; - } - } -- } while ((cli == NULL) && (tries < MAX_RETRY_CONNECT)); -+ } while (!NT_STATUS_IS_OK(nt_status) && (tries < MAX_RETRY_CONNECT)); - - if (cli == NULL) { - fprintf(stderr, "ERROR: Unable to connect to CIFS host after (tried %d times)\n", tries); -@@ -436,10 +463,9 @@ done: - */ - - static int --get_exit_code(struct cli_state * cli, -- NTSTATUS nt_status) -+get_exit_code(NTSTATUS nt_status) - { -- int i; -+ size_t i; - - /* List of NTSTATUS errors that are considered - * authentication errors -@@ -455,17 +481,16 @@ get_exit_code(struct cli_state * cli, - }; - - -- fprintf(stderr, "DEBUG: get_exit_code(cli=%p, nt_status=%s [%x])\n", -- cli, nt_errstr(nt_status), NT_STATUS_V(nt_status)); -+ fprintf(stderr, -+ "DEBUG: get_exit_code(nt_status=%s [%x])\n", -+ nt_errstr(nt_status), NT_STATUS_V(nt_status)); - - for (i = 0; i < ARRAY_SIZE(auth_errors); i++) { - if (!NT_STATUS_EQUAL(nt_status, auth_errors[i])) { - continue; - } - -- if (cli) { -- fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required); -- } -+ fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required); - - /* - * 2 = authentication required... -@@ -498,16 +523,16 @@ list_devices(void) - } - - --static struct cli_state * --smb_complete_connection(const char *myname, -+static NTSTATUS -+smb_complete_connection(struct cli_state **output_cli, -+ const char *myname, - const char *server, - int port, - const char *username, - const char *password, - const char *workgroup, - const char *share, -- int flags, -- bool *need_auth) -+ int flags) - { - struct cli_state *cli; /* New connection */ - NTSTATUS nt_status; -@@ -516,12 +541,11 @@ smb_complete_connection(const char *myname, - bool fallback_after_kerberos = false; - - /* Start the SMB connection */ -- *need_auth = false; - nt_status = cli_start_connection(&cli, myname, server, NULL, port, - SMB_SIGNING_DEFAULT, flags); - if (!NT_STATUS_IS_OK(nt_status)) { - fprintf(stderr, "ERROR: Connection failed: %s\n", nt_errstr(nt_status)); -- return NULL; -+ return nt_status; - } - - if (flags & CLI_FULL_CONNECTION_USE_KERBEROS) { -@@ -544,20 +568,16 @@ smb_complete_connection(const char *myname, - if (creds == NULL) { - fprintf(stderr, "ERROR: cli_session_creds_init failed\n"); - cli_shutdown(cli); -- return NULL; -+ return NT_STATUS_NO_MEMORY; - } - - nt_status = cli_session_setup_creds(cli, creds); - if (!NT_STATUS_IS_OK(nt_status)) { - fprintf(stderr, "ERROR: Session setup failed: %s\n", nt_errstr(nt_status)); - -- if (get_exit_code(cli, nt_status) == 2) { -- *need_auth = true; -- } -- - cli_shutdown(cli); - -- return NULL; -+ return nt_status; - } - - nt_status = cli_tree_connect_creds(cli, share, "?????", creds); -@@ -565,13 +585,9 @@ smb_complete_connection(const char *myname, - fprintf(stderr, "ERROR: Tree connect failed (%s)\n", - nt_errstr(nt_status)); - -- if (get_exit_code(cli, nt_status) == 2) { -- *need_auth = true; -- } -- - cli_shutdown(cli); - -- return NULL; -+ return nt_status; - } - #if 0 - /* Need to work out how to specify this on the URL. */ -@@ -584,7 +600,8 @@ smb_complete_connection(const char *myname, - } - #endif - -- return cli; -+ *output_cli = cli; -+ return NT_STATUS_OK; - } - - static bool kerberos_ccache_is_valid(void) { -@@ -650,49 +667,48 @@ static bool kerberos_ccache_is_valid(void) { - * 'smb_connect()' - Return a connection to a server. - */ - --static struct cli_state * /* O - SMB connection */ --smb_connect(const char *workgroup, /* I - Workgroup */ -+static NTSTATUS -+smb_connect(struct cli_state **output_cli, -+ const char *workgroup, /* I - Workgroup */ - const char *server, /* I - Server */ - const int port, /* I - Port */ - const char *share, /* I - Printer */ - const char *username, /* I - Username */ - const char *password, /* I - Password */ -- const char *jobusername, /* I - User who issued the print job */ -- bool *need_auth) --{ /* O - Need authentication? */ -- struct cli_state *cli; /* New connection */ -+ const char *jobusername) /* I - User who issued the print job */ -+{ -+ struct cli_state *cli = NULL; /* New connection */ - char *myname = NULL; /* Client name */ - struct passwd *pwd; - int flags = CLI_FULL_CONNECTION_USE_KERBEROS; - bool use_kerberos = false; - const char *user = username; -- int cmp; -+ NTSTATUS nt_status; - - /* - * Get the names and addresses of the client and server... - */ - myname = get_myname(talloc_tos()); - if (!myname) { -- return NULL; -+ return NT_STATUS_NO_MEMORY; - } - - -- cmp = strcmp(auth_info_required, "negotiate"); -- if (cmp == 0) { -+ if (strcmp(auth_info_required, "negotiate") == 0) { - if (!kerberos_ccache_is_valid()) { -- return NULL; -+ fprintf(stderr, -+ "ERROR: No valid Kerberos credential cache " -+ "found!\n"); -+ return NT_STATUS_LOGON_FAILURE; - } - user = jobusername; - - use_kerberos = true; - fprintf(stderr, - "DEBUG: Try to connect using Kerberos ...\n"); -- } -- -- cmp = strcmp(auth_info_required, "username,password"); -- if (cmp == 0) { -- if (username == NULL || username[0] == '\0') { -- return NULL; -+ } else if (strcmp(auth_info_required, "username,password") == 0) { -+ if (username == NULL) { -+ return NT_STATUS_INVALID_ACCOUNT_NAME; - } - - /* Fallback to NTLM */ -@@ -700,59 +716,83 @@ smb_connect(const char *workgroup, /* I - Workgroup */ - - fprintf(stderr, - "DEBUG: Try to connect using username/password ...\n"); -- } -+ } else { -+ if (username != NULL) { -+ flags |= CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS; -+ } else if (kerberos_ccache_is_valid()) { -+ auth_info_required = "negotiate"; - -- cmp = strcmp(auth_info_required, "none"); -- if (cmp == 0) { -- fprintf(stderr, -- "DEBUG: This backend doesn't support none auth ...\n"); -- return NULL; -+ user = jobusername; -+ use_kerberos = true; -+ } else { -+ fprintf(stderr, -+ "DEBUG: This backend requires credentials!\n"); -+ return NT_STATUS_ACCESS_DENIED; -+ } - } - -- cli = smb_complete_connection(myname, -- server, -- port, -- user, -- password, -- workgroup, -- share, -- flags, -- need_auth); -- if (cli != NULL) { -+ nt_status = smb_complete_connection(&cli, -+ myname, -+ server, -+ port, -+ user, -+ password, -+ workgroup, -+ share, -+ flags); -+ if (NT_STATUS_IS_OK(nt_status)) { - fprintf(stderr, "DEBUG: SMB connection established.\n"); -- return (cli); -+ -+ *output_cli = cli; -+ return NT_STATUS_OK; - } - - if (!use_kerberos) { - fprintf(stderr, "ERROR: SMB connection failed!\n"); -- return NULL; -+ return nt_status; - } - - /* give a chance for a passwordless NTLMSSP session setup */ - pwd = getpwuid(geteuid()); - if (pwd == NULL) { -- return NULL; -- } -- -- cli = smb_complete_connection(myname, server, port, pwd->pw_name, "", -- workgroup, share, 0, need_auth); -- -- if (cli) { -+ return NT_STATUS_ACCESS_DENIED; -+ } -+ -+ nt_status = smb_complete_connection(&cli, -+ myname, -+ server, -+ port, -+ pwd->pw_name, -+ "", -+ workgroup, -+ share, -+ 0); -+ if (NT_STATUS_IS_OK(nt_status)) { - fputs("DEBUG: Connected with NTLMSSP...\n", stderr); -- return (cli); -+ -+ *output_cli = cli; -+ return NT_STATUS_OK; - } - - /* - * last try. Use anonymous authentication - */ - -- cli = smb_complete_connection(myname, server, port, "", "", -- workgroup, share, 0, need_auth); -- /* -- * Return the new connection... -- */ -- -- return (cli); -+ nt_status = smb_complete_connection(&cli, -+ myname, -+ server, -+ port, -+ "", -+ "", -+ workgroup, -+ share, -+ 0); -+ if (NT_STATUS_IS_OK(nt_status)) { -+ *output_cli = cli; -+ return NT_STATUS_OK; -+ } -+ -+ return nt_status; - } - - -@@ -798,7 +838,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */ - if (!NT_STATUS_IS_OK(nt_status)) { - fprintf(stderr, "ERROR: %s opening remote spool %s\n", - nt_errstr(nt_status), title); -- return get_exit_code(cli, nt_status); -+ return get_exit_code(nt_status); - } - - /* -@@ -816,7 +856,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */ - status = cli_writeall(cli, fnum, 0, (uint8_t *)buffer, - tbytes, nbytes, NULL); - if (!NT_STATUS_IS_OK(status)) { -- int ret = get_exit_code(cli, status); -+ int ret = get_exit_code(status); - fprintf(stderr, "ERROR: Error writing spool: %s\n", - nt_errstr(status)); - fprintf(stderr, "DEBUG: Returning status %d...\n", -@@ -832,7 +872,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */ - if (!NT_STATUS_IS_OK(nt_status)) { - fprintf(stderr, "ERROR: %s closing remote spool %s\n", - nt_errstr(nt_status), title); -- return get_exit_code(cli, nt_status); -+ return get_exit_code(nt_status); - } else { - return (0); - } --- -2.21.0 - -From ffa5f8b65c662130c2d23e47df6d00fef3b73cc3 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Tue, 18 Jun 2019 14:43:50 +0200 -Subject: [PATCH] s3:client: Link smbspool_krb5_wrapper against krb5samba - -Heimdal doesn't provide krb5_free_unparsed_name(), so we need to use the -function we provide in krb5samba. - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 - -Signed-off-by: Andreas Schneider -Reviewed-by: Ralph Boehme -(cherry picked from commit 9268919e046190c7b423133de3f9d0edada3f1b8) ---- - source3/wscript_build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/source3/wscript_build b/source3/wscript_build -index 1ebb006781a..26e251f442a 100644 ---- a/source3/wscript_build -+++ b/source3/wscript_build -@@ -1133,7 +1133,7 @@ bld.SAMBA3_BINARY('smbspool_krb5_wrapper', - deps=''' - DYNCONFIG - cups -- krb5 -+ krb5samba - ''', - install_path='${LIBEXECDIR}/samba', - enabled=bld.CONFIG_SET('HAVE_CUPS')) --- -2.21.0 - diff --git a/samba-4.10.6-vfs_fruit.patch b/samba-4.10.6-vfs_fruit.patch deleted file mode 100644 index ddabd9e..0000000 --- a/samba-4.10.6-vfs_fruit.patch +++ /dev/null @@ -1,3175 +0,0 @@ -From 919036329cf0005ac0d97a6f3eacac24617bbf26 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Tue, 21 May 2019 18:39:52 +0200 -Subject: [PATCH 1/5] s4:torture/vfs/fruit: ensure test_adouble_conversion() - uses a non-emtpy resourcefork - -This ensures the resource fork is not deleted as part of the AppleDouble file -conversion for the option fruit:wipe_intentionally_left_blank_rfork=yes. - -This is currently not a problem in selftest, as we don't enable the option, but -a subsequent commit will run all vfs.fruit tests against a share with this -option enabled. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit c3d28d49be3c7536d1ccfe8d00553ce72843f369) ---- - source4/torture/vfs/fruit.c | 671 +++++++++++++++++++++++++++++++++++- - 1 file changed, 668 insertions(+), 3 deletions(-) - -diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c -index e0ba935ff99..1c0754af456 100644 ---- a/source4/torture/vfs/fruit.c -+++ b/source4/torture/vfs/fruit.c -@@ -1027,6 +1027,666 @@ static char osx_adouble_without_xattr[] = { - 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1e, 0xff, 0xff - }; - -+/* -+The buf below contains the following AppleDouble encoded data: -+ -+------------------------------------------------------------------------------- -+MagicNumber: 00051607 : AppleDouble -+Version : 00020000 : Version 2 -+Filler : 4D 61 63 20 4F 53 20 58 20 20 20 20 20 20 20 20 : Mac OS X -+Num. of ent: 0002 : 2 -+ -+------------------------------------------------------------------------------- -+Entry ID : 00000009 : Finder Info -+Offset : 00000032 : 50 -+Length : 00000EB0 : 3760 -+ -+-FInfo-----: -+Type : 54455354 : TEST -+Creator : 534C4F57 : SLOW -+isAlias : 0 -+Invisible : 0 -+hasBundle : 0 -+nameLocked : 0 -+Stationery : 0 -+CustomIcon : 0 -+Reserved : 0 -+Inited : 0 -+NoINITS : 0 -+Shared : 0 -+SwitchLaunc: 0 -+Hidden Ext : 0 -+color : 100 : blue -+isOnDesk : 0 -+Location v : 0000 : 0 -+Location h : 0000 : 0 -+Fldr : 0000 : .. -+ -+-FXInfo----: -+Rsvd|IconID: 0000 : 0 -+Rsvd : 0000 : .. -+Rsvd : 0000 : .. -+Rsvd : 0000 : .. -+AreInvalid : 0 -+unknown bit: 0 -+unknown bit: 0 -+unknown bit: 0 -+unknown bit: 0 -+unknown bit: 0 -+unknown bit: 0 -+CustomBadge: 0 -+ObjctIsBusy: 0 -+unknown bit: 0 -+unknown bit: 0 -+unknown bit: 0 -+unknown bit: 0 -+RoutingInfo: 0 -+unknown bit: 0 -+unknown bit: 0 -+Rsvd|commnt: 0000 : 0 -+PutAway : 00000000 : 0 -+ -+-EA--------: -+pad : 0000 : .. -+magic : 41545452 : ATTR -+debug_tag : 53D4580C : 1406425100 -+total_size : 00000EE2 : 3810 -+data_start : 000000BC : 188 -+data_length: 0000005E : 94 -+reserved[0]: 00000000 : .... -+reserved[1]: 00000000 : .... -+reserved[2]: 00000000 : .... -+flags : 0000 : .. -+num_attrs : 0002 : 2 -+-EA ENTRY--: -+offset : 000000BC : 188 -+length : 0000005B : 91 -+flags : 0000 : .. -+namelen : 24 : 36 -+-EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) -+00000000 : 63 6F 6D 2E 61 70 70 6C 65 2E 6D 65 74 61 64 61 : com.apple.metada -+00000010 : 74 61 3A 5F 6B 4D 44 49 74 65 6D 55 73 65 72 54 : ta:_kMDItemUserT -+00000020 : 61 67 73 00 : ags. -+-EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) -+00000000 : 62 70 6C 69 73 74 30 30 A5 01 02 03 04 05 54 74 : bplist00......Tt -+00000010 : 65 73 74 66 00 47 00 72 00 FC 00 6E 00 0A 00 32 : estf.G.r...n...2 -+00000020 : 56 4C 69 6C 61 0A 33 56 47 65 6C 62 0A 35 56 42 : VLila.3VGelb.5VB -+00000030 : 6C 61 75 0A 34 08 0E 13 20 27 2E 00 00 00 00 00 : lau.4... '...... -+00000040 : 00 01 01 00 00 00 00 00 00 00 06 00 00 00 00 00 : ................ -+00000050 : 00 00 00 00 00 00 00 00 00 00 35 : ..........5 -+-EA ENTRY--: -+offset : 00000117 : 279 -+length : 00000003 : 3 -+flags : 0000 : .. -+namelen : 08 : 8 -+-EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) -+00000000 : 66 6F 6F 3A 62 61 72 00 : foo:bar. -+-EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) -+00000000 : 62 61 7A : baz -+ -+-RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) -+00000000 : 54 45 53 54 53 4C 4F 57 00 08 00 00 00 00 00 00 : TESTSLOW........ -+00000010 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+00000020 : 00 00 41 54 54 52 53 D4 58 0C 00 00 0E E2 00 00 : ..ATTRS.X....... -+00000030 : 00 BC 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 : .....^.......... -+00000040 : 00 00 00 00 00 02 00 00 00 BC 00 00 00 5B 00 00 : .............[.. -+00000050 : 24 63 6F 6D 2E 61 70 70 6C 65 2E 6D 65 74 61 64 : $com.apple.metad -+00000060 : 61 74 61 3A 5F 6B 4D 44 49 74 65 6D 55 73 65 72 : ata:_kMDItemUser -+00000070 : 54 61 67 73 00 00 00 00 01 17 00 00 00 03 00 00 : Tags............ -+00000080 : 08 66 6F 6F 3A 62 61 72 00 66 62 70 6C 69 73 74 : .foo:bar.fbplist -+00000090 : 30 30 A5 01 02 03 04 05 54 74 65 73 74 66 00 47 : 00......Ttestf.G -+000000A0 : 00 72 00 FC 00 6E 00 0A 00 32 56 4C 69 6C 61 0A : .r...n...2VLila. -+000000B0 : 33 56 47 65 6C 62 0A 35 56 42 6C 61 75 0A 34 08 : 3VGelb.5VBlau.4. -+000000C0 : 0E 13 20 27 2E 00 00 00 00 00 00 01 01 00 00 00 : .. '............ -+000000D0 : 00 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 : ................ -+000000E0 : 00 00 00 00 35 62 61 7A 00 00 00 00 00 00 00 00 : ....5baz........ -+000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+... all zeroes ... -+00000EA0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+ -+------------------------------------------------------------------------------- -+Entry ID : 00000002 : Resource Fork -+Offset : 00000EE2 : 3810 -+Length : 0000011E : 286 -+ -+-RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) -+00000000 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................ -+00000010 : F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF : This resource fo -+00000020 : 72 6B 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 6C 79 : rk intentionally -+00000030 : 20 6C 65 66 74 20 62 6C 61 6E 6B 20 20 20 00 00 : left blank .. -+00000040 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+00000050 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+00000060 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+00000070 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+00000080 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+00000090 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+000000A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+000000B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+000000C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+000000D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+000000E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -+00000100 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................ -+00000110 : 00 00 00 00 00 00 00 00 00 1C 00 1E FF FF : .............. -+ -+It was created with: -+$ hexdump -ve '"\t" 7/1 "0x%02x, " 1/1 " 0x%02x," "\n"' -+*/ -+static char osx_adouble_non_empty_rfork_w_xattr[] = { -+ 0x00, 0x05, 0x16, 0x07, 0x00, 0x02, 0x00, 0x00, -+ 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, -+ 0x00, 0x32, 0x00, 0x00, 0x0e, 0xb0, 0x00, 0x00, -+ 0x00, 0x02, 0x00, 0x00, 0x0e, 0xe2, 0x00, 0x00, -+ 0x01, 0x1e, 0x54, 0x45, 0x53, 0x54, 0x53, 0x4c, -+ 0x4f, 0x57, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x41, 0x54, 0x54, 0x52, -+ 0x53, 0xd4, 0x58, 0x0c, 0x00, 0x00, 0x0e, 0xe2, -+ 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x5e, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, -+ 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x5b, -+ 0x00, 0x00, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x61, -+ 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x6d, 0x65, 0x74, -+ 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x5f, 0x6b, -+ 0x4d, 0x44, 0x49, 0x74, 0x65, 0x6d, 0x55, 0x73, -+ 0x65, 0x72, 0x54, 0x61, 0x67, 0x73, 0x00, 0x00, -+ 0x00, 0x00, 0x01, 0x17, 0x00, 0x00, 0x00, 0x03, -+ 0x00, 0x00, 0x08, 0x66, 0x6f, 0x6f, 0x3a, 0x62, -+ 0x61, 0x72, 0x00, 0x66, 0x62, 0x70, 0x6c, 0x69, -+ 0x73, 0x74, 0x30, 0x30, 0xa5, 0x01, 0x02, 0x03, -+ 0x04, 0x05, 0x54, 0x74, 0x65, 0x73, 0x74, 0x66, -+ 0x00, 0x47, 0x00, 0x72, 0x00, 0xfc, 0x00, 0x6e, -+ 0x00, 0x0a, 0x00, 0x32, 0x56, 0x4c, 0x69, 0x6c, -+ 0x61, 0x0a, 0x33, 0x56, 0x47, 0x65, 0x6c, 0x62, -+ 0x0a, 0x35, 0x56, 0x42, 0x6c, 0x61, 0x75, 0x0a, -+ 0x34, 0x08, 0x0e, 0x13, 0x20, 0x27, 0x2e, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0x62, -+ 0x61, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x1e, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, -+ 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, -+ 0xfe, 0xff, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74, -+ 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, -+ 0x6c, 0x79, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20, -+ 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x20, 0x20, 0x20, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1e, 0xff, 0xff -+}; -+ - /** - * talloc and intialize an AfpInfo - **/ -@@ -2082,8 +2742,11 @@ static bool test_adouble_conversion(struct torture_context *tctx, - NTSTATUS status; - struct smb2_handle testdirh; - bool ret = true; -- const char *data = "This resource fork intentionally left blank"; -- size_t datalen = strlen(data); -+ const char data[] = { -+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, -+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff -+ }; -+ size_t datalen = sizeof(data); - const char *streams[] = { - "::$DATA", - AFPINFO_STREAM, -@@ -2113,7 +2776,9 @@ static bool test_adouble_conversion(struct torture_context *tctx, - - ret = write_stream(tree, __location__, tctx, mem_ctx, - adname, NULL, -- 0, sizeof(osx_adouble_w_xattr), osx_adouble_w_xattr); -+ 0, -+ sizeof(osx_adouble_non_empty_rfork_w_xattr), -+ osx_adouble_non_empty_rfork_w_xattr); - torture_assert_goto(tctx, ret == true, ret, done, - "write_stream failed\n"); - --- -2.21.0 - - -From 824a6bd86625611d79cec7c7aa7951c1537a843e Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Tue, 21 May 2019 18:39:52 +0200 -Subject: [PATCH 2/5] s4:torture/vfs/fruit: ensure - test_adouble_conversion_wo_xattr() uses a non-emtpy resourcefork - -This ensures the resource fork is not deleted as part of the AppleDouble file -conversion for the option fruit:wipe_intentionally_left_blank_rfork=yes. - -This is currently not a problem in selftest, as we don't enable the option, but -a subsequent commit will run all vfs.fruit tests against a share with this -option enabled. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit bb5a457f2872a383b58d62981dade322fca9b283) ---- - source4/torture/vfs/fruit.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c -index 1c0754af456..8e8731662fb 100644 ---- a/source4/torture/vfs/fruit.c -+++ b/source4/torture/vfs/fruit.c -@@ -902,7 +902,7 @@ static char osx_adouble_w_xattr[] = { - * - * -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII) - * 00000000 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................ -- * 00000010 : 54 68 69 73 20 72 65 73 6F 75 72 63 65 20 66 6F : This resource fo -+ * 00000010 : F0 F1 F2 F3 F5 F5 F6 F7 F8 F9 FA FB FC FD FE FF : ................ - * 00000020 : 72 6B 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 6C 79 : rk intentionally - * 00000030 : 20 6C 65 66 74 20 62 6C 61 6E 6B 20 20 20 00 00 : left blank .. - * 00000040 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................ -@@ -991,9 +991,9 @@ static char osx_adouble_without_xattr[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -- 0x00, 0x1e, 0x54, 0x68, 0x69, 0x73, 0x20, 0x72, -- 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, -- 0x66, 0x6f, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74, -+ 0x00, 0x1e, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, -+ 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, -+ 0xfe, 0xff, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x6c, 0x79, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20, - 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x20, 0x20, 0x20, -@@ -2833,8 +2833,11 @@ static bool test_adouble_conversion_wo_xattr(struct torture_context *tctx, - struct smb2_find find; - unsigned int count; - union smb_search_data *d; -- const char *data = "This resource fork intentionally left blank"; -- size_t datalen = strlen(data); -+ const char data[] = { -+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, -+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff -+ }; -+ size_t datalen = sizeof(data); - bool is_osx = torture_setting_bool(tctx, "osx", false); - - if (is_osx) { --- -2.21.0 - - -From a648e79902108152f15998a0a5a236cecec80ad0 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Tue, 21 May 2019 14:05:04 +0200 -Subject: [PATCH 3/5] selftest: run vfs.fruit test against a share that deletes - empty resource forks - -This reveals a bug in the AppleDouble conversion code: the conversion code that -unlinks an empty resource fork AppleDouble sidecar file ("._file") gets -triggered as part of open_file_ntcreate(..., "file:AFP_AfpResource", ...): - -after SMB_VFS_OPEN() has been called with O_CREAT, what created the file, we -call SMB_VFS_FSTAT() on the just created filehandle. This ends up in -ad_convert(), finds the resource fork empty and thus deletes the file. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 8ed9b6b457923d2353d1d18838f4a278db48c6b9) ---- - selftest/knownfail.d/samba3.vfs.fruit | 13 +++++++++++++ - source3/selftest/tests.py | 1 + - 2 files changed, 14 insertions(+) - -diff --git a/selftest/knownfail.d/samba3.vfs.fruit b/selftest/knownfail.d/samba3.vfs.fruit -index 6307e2b3404..b1a28bedff6 100644 ---- a/selftest/knownfail.d/samba3.vfs.fruit -+++ b/selftest/knownfail.d/samba3.vfs.fruit -@@ -1,2 +1,15 @@ - ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\) - ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.copyfile\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.resource fork IO\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.SMB2/CREATE context AAPL\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.truncate resource fork to 0 bytes\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.opening and creating resource fork\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.create delete-on-close AFP_AfpResource\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.setinfo delete-on-close AFP_AfpResource\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.delete\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.read open rsrc after rename\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.readdir_attr with names with illegal ntfs characters\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.copy-chunk streams\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.empty_stream\(nt4_dc\) -+^samba3.vfs.fruit fruit_delete_empty_adfiles.setinfo eof AFP_AfpResource\(nt4_dc\) -diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py -index 7067abc5fb4..1db806ef887 100755 ---- a/source3/selftest/tests.py -+++ b/source3/selftest/tests.py -@@ -595,6 +595,7 @@ tests = base + raw + smb2 + rpc + unix + local + rap + nbt + libsmbclient + idma - plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit', 'metadata_netatalk') - plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_metadata_stream -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit', 'metadata_stream') - plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_stream_depot -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit_stream_depot', 'streams_depot') -+ plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_delete_empty_adfiles -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit', 'fruit_delete_empty_adfiles') - elif t == "vfs.fruit_netatalk": - plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_xattr -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share') - elif t == "vfs.fruit_timemachine": --- -2.21.0 - - -From e5185fa8b4ae25a60557a014d3c30ee4bd6bbaff Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Tue, 21 May 2019 16:00:00 +0200 -Subject: [PATCH 4/5] vfs_fruit: add a forward declaration for ad_get() - -Will be needed in the next commit. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 4777d1163a7c18c89ce9be955903427a18134415) ---- - source3/modules/vfs_fruit.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index f54038f53d4..b74d26ca711 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -535,6 +535,10 @@ struct fio { - */ - static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle, - adouble_type_t type); -+static struct adouble *ad_get(TALLOC_CTX *ctx, -+ vfs_handle_struct *handle, -+ const struct smb_filename *smb_fname, -+ adouble_type_t type); - static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname); - static int ad_fset(struct adouble *ad, files_struct *fsp); - static int adouble_path(TALLOC_CTX *ctx, --- -2.21.0 - - -From d95745e8603906d105ec6cd12bc91a62d62fef6c Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Tue, 21 May 2019 16:00:53 +0200 -Subject: [PATCH 5/5] vfs_fruit: change trigger points of AppleDouble - conversion - -This moves the trigger points where AppleDouble file conversion is run by -ad_convert() from deep down the callchain in ad_read_rsrc_adouble() to high -level VFS entry points. - -Currently ad_convert() will be triggered as part of open_file_ntcreate(..., -"file:AFP_AfpResource", ...): after SMB_VFS_OPEN() has been called with O_CREAT, -what created the file, we call SMB_VFS_FSTAT() on the just created -filehandle. This ends up in ad_convert(), finds the resource fork empty and thus -deletes the file. - -This commit moves calling of the conversion funtion to the high level VFS entry -points where the converted metadata is needed: - -o for directory enumerations SMB_VFS_READDIR_ATTR() is called to fill in the - repurposed fields in the directory entry metadata - -o obviously for SMB_VFS_CREATE_FILE() on an macOS stream - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 78a4639b2d06cc69788861618d2e91945e142d2b) ---- - selftest/knownfail.d/samba3.vfs.fruit | 13 ------ - source3/modules/vfs_fruit.c | 61 ++++++++++++++++++--------- - 2 files changed, 40 insertions(+), 34 deletions(-) - -diff --git a/selftest/knownfail.d/samba3.vfs.fruit b/selftest/knownfail.d/samba3.vfs.fruit -index b1a28bedff6..6307e2b3404 100644 ---- a/selftest/knownfail.d/samba3.vfs.fruit -+++ b/selftest/knownfail.d/samba3.vfs.fruit -@@ -1,15 +1,2 @@ - ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\) - ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.copyfile\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.resource fork IO\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.SMB2/CREATE context AAPL\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.truncate resource fork to 0 bytes\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.opening and creating resource fork\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.create delete-on-close AFP_AfpResource\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.setinfo delete-on-close AFP_AfpResource\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.delete\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.read open rsrc after rename\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.readdir_attr with names with illegal ntfs characters\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.copy-chunk streams\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.empty_stream\(nt4_dc\) --^samba3.vfs.fruit fruit_delete_empty_adfiles.setinfo eof AFP_AfpResource\(nt4_dc\) -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index b74d26ca711..be85c9f5412 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1450,27 +1450,37 @@ static bool ad_convert_delete_adfile(struct adouble *ad, - * @return -1 in case an error occurred, 0 if no conversion was done, 1 - * otherwise - **/ --static int ad_convert(struct adouble *ad, -+static int ad_convert(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname) - { -+ struct adouble *ad = NULL; - bool ok; - bool converted_xattr = false; - bool blank; -+ int ret; -+ -+ ad = ad_get(talloc_tos(), handle, smb_fname, ADOUBLE_RSRC); -+ if (ad == NULL) { -+ return 0; -+ } - - ok = ad_convert_xattr(ad, smb_fname, &converted_xattr); - if (!ok) { -- return -1; -+ ret = -1; -+ goto done; - } - - ok = ad_convert_blank_rfork(ad, &blank); - if (!ok) { -- return -1; -+ ret = -1; -+ goto done; - } - - if (converted_xattr || blank) { - ok = ad_convert_truncate(ad, smb_fname); - if (!ok) { -- return -1; -+ ret = -1; -+ goto done; - } - } - -@@ -1478,15 +1488,20 @@ static int ad_convert(struct adouble *ad, - if (!ok) { - DBG_ERR("Failed to convert [%s]\n", - smb_fname_str_dbg(smb_fname)); -- return -1; -+ ret = -1; -+ goto done; - } - - ok = ad_convert_delete_adfile(ad, smb_fname); - if (!ok) { -- return -1; -+ ret = -1; -+ goto done; - } - -- return 0; -+ ret = 0; -+done: -+ TALLOC_FREE(ad); -+ return ret; - } - - /** -@@ -1739,17 +1754,6 @@ static ssize_t ad_read_rsrc_adouble(struct adouble *ad, - return -1; - } - -- /* -- * Try to fixup AppleDouble files created by OS X with xattrs -- * appended to the ADEID_FINDERI entry. -- */ -- -- ret = ad_convert(ad, smb_fname); -- if (ret != 0) { -- DBG_WARNING("Failed to convert [%s]\n", smb_fname->base_name); -- return len; -- } -- - return len; - } - -@@ -2137,9 +2141,8 @@ static bool is_afpresource_stream(const struct smb_filename *smb_fname) - } - - /** -- * Test whether stream is an Apple stream, not used atm -+ * Test whether stream is an Apple stream. - **/ --#if 0 - static bool is_apple_stream(const struct smb_filename *smb_fname) - { - if (is_afpinfo_stream(smb_fname)) { -@@ -2150,7 +2153,6 @@ static bool is_apple_stream(const struct smb_filename *smb_fname) - } - return false; - } --#endif - - /** - * Initialize config struct from our smb.conf config parameters -@@ -6051,6 +6053,8 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle, - struct fruit_config_data *config = NULL; - files_struct *fsp = NULL; - struct fio *fio = NULL; -+ bool internal_open = (oplock_request & INTERNAL_OPEN_ONLY); -+ int ret; - - status = check_aapl(handle, req, in_context_blobs, out_context_blobs); - if (!NT_STATUS_IS_OK(status)) { -@@ -6060,6 +6064,14 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle, - SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data, - return NT_STATUS_UNSUCCESSFUL); - -+ if (is_apple_stream(smb_fname) && !internal_open) { -+ ret = ad_convert(handle, smb_fname); -+ if (ret != 0) { -+ DBG_ERR("ad_convert() failed\n"); -+ return NT_STATUS_UNSUCCESSFUL; -+ } -+ } -+ - status = SMB_VFS_NEXT_CREATE_FILE( - handle, req, root_dir_fid, smb_fname, - access_mask, share_access, -@@ -6142,6 +6154,7 @@ static NTSTATUS fruit_readdir_attr(struct vfs_handle_struct *handle, - struct fruit_config_data *config = NULL; - struct readdir_attr_data *attr_data; - NTSTATUS status; -+ int ret; - - SMB_VFS_HANDLE_GET_DATA(handle, config, - struct fruit_config_data, -@@ -6153,6 +6166,12 @@ static NTSTATUS fruit_readdir_attr(struct vfs_handle_struct *handle, - - DEBUG(10, ("fruit_readdir_attr %s\n", fname->base_name)); - -+ ret = ad_convert(handle, fname); -+ if (ret != 0) { -+ DBG_ERR("ad_convert() failed\n"); -+ return NT_STATUS_UNSUCCESSFUL; -+ } -+ - *pattr_data = talloc_zero(mem_ctx, struct readdir_attr_data); - if (*pattr_data == NULL) { - return NT_STATUS_UNSUCCESSFUL; --- -2.21.0 - -From 99b63b4e720122ef9cbb8155c8cc73a1f2613650 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 10:41:29 +0200 -Subject: [PATCH 01/31] vfs_fruit: pass handle to ad_fset() - -On the course of removing ad_handle from struct adouble, step 1. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 585d4d49770b4ddc3f7d9dcbb3e322f072767781) ---- - source3/modules/vfs_fruit.c | 20 ++++++++++++-------- - 1 file changed, 12 insertions(+), 8 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index be85c9f5412..bef9bac2036 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -540,7 +540,9 @@ static struct adouble *ad_get(TALLOC_CTX *ctx, - const struct smb_filename *smb_fname, - adouble_type_t type); - static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname); --static int ad_fset(struct adouble *ad, files_struct *fsp); -+static int ad_fset(struct vfs_handle_struct *handle, -+ struct adouble *ad, -+ files_struct *fsp); - static int adouble_path(TALLOC_CTX *ctx, - const struct smb_filename *smb_fname__in, - struct smb_filename **ppsmb_fname_out); -@@ -2065,7 +2067,9 @@ static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname) - * - * @return status code, 0 means success - **/ --static int ad_fset(struct adouble *ad, files_struct *fsp) -+static int ad_fset(struct vfs_handle_struct *handle, -+ struct adouble *ad, -+ files_struct *fsp) - { - int rc = -1; - ssize_t len; -@@ -2087,7 +2091,7 @@ static int ad_fset(struct adouble *ad, files_struct *fsp) - - switch (ad->ad_type) { - case ADOUBLE_META: -- rc = SMB_VFS_NEXT_SETXATTR(ad->ad_handle, -+ rc = SMB_VFS_NEXT_SETXATTR(handle, - fsp->fsp_name, - AFPINFO_EA_NETATALK, - ad->ad_data, -@@ -2095,7 +2099,7 @@ static int ad_fset(struct adouble *ad, files_struct *fsp) - break; - - case ADOUBLE_RSRC: -- len = SMB_VFS_NEXT_PWRITE(ad->ad_handle, -+ len = SMB_VFS_NEXT_PWRITE(handle, - fsp, - ad->ad_data, - AD_DATASZ_DOT_UND, -@@ -3588,7 +3592,7 @@ static int fruit_open_rsrc_adouble(vfs_handle_struct *handle, - - fsp->fh->fd = hostfd; - -- rc = ad_fset(ad, fsp); -+ rc = ad_fset(handle, ad, fsp); - fsp->fh->fd = -1; - if (rc != 0) { - rc = -1; -@@ -4676,7 +4680,7 @@ static ssize_t fruit_pwrite_meta_netatalk(vfs_handle_struct *handle, - - memcpy(p, &ai->afpi_FinderInfo[0], ADEDLEN_FINDERI); - -- ret = ad_fset(ad, fsp); -+ ret = ad_fset(handle, ad, fsp); - if (ret != 0) { - DBG_ERR("ad_pwrite [%s] failed\n", fsp_str_dbg(fsp)); - TALLOC_FREE(ad); -@@ -4832,7 +4836,7 @@ static ssize_t fruit_pwrite_rsrc_adouble(vfs_handle_struct *handle, - - if ((n + offset) > ad_getentrylen(ad, ADEID_RFORK)) { - ad_setentrylen(ad, ADEID_RFORK, n + offset); -- ret = ad_fset(ad, fsp); -+ ret = ad_fset(handle, ad, fsp); - if (ret != 0) { - DBG_ERR("ad_pwrite [%s] failed\n", fsp_str_dbg(fsp)); - TALLOC_FREE(ad); -@@ -5934,7 +5938,7 @@ static int fruit_ftruncate_rsrc_adouble(struct vfs_handle_struct *handle, - - ad_setentrylen(ad, ADEID_RFORK, offset); - -- rc = ad_fset(ad, fsp); -+ rc = ad_fset(handle, ad, fsp); - if (rc != 0) { - DBG_ERR("ad_fset [%s] failed [%s]\n", - fsp_str_dbg(fsp), strerror(errno)); --- -2.21.0 - - -From aa457fc63f493208ef85d833e5764f84578f5858 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 10:43:55 +0200 -Subject: [PATCH 02/31] vfs_fruit: pass handle to ad_set() - -On the course of removing ad_handle from struct adouble, step 2. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit c78ba30ac4534b7037b979ac96b77b834b2eb2fe) ---- - source3/modules/vfs_fruit.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index bef9bac2036..cb87396b9b2 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -539,7 +539,9 @@ static struct adouble *ad_get(TALLOC_CTX *ctx, - vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - adouble_type_t type); --static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname); -+static int ad_set(vfs_handle_struct *handle, -+ struct adouble *ad, -+ const struct smb_filename *smb_fname); - static int ad_fset(struct vfs_handle_struct *handle, - struct adouble *ad, - files_struct *fsp); -@@ -2030,7 +2032,9 @@ static struct adouble *ad_fget(TALLOC_CTX *ctx, vfs_handle_struct *handle, - * - * @return status code, 0 means success - **/ --static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname) -+static int ad_set(vfs_handle_struct *handle, -+ struct adouble *ad, -+ const struct smb_filename *smb_fname) - { - bool ok; - int ret; -@@ -2048,7 +2052,7 @@ static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname) - return -1; - } - -- ret = SMB_VFS_SETXATTR(ad->ad_handle->conn, -+ ret = SMB_VFS_SETXATTR(handle->conn, - smb_fname, - AFPINFO_EA_NETATALK, - ad->ad_data, -@@ -5874,7 +5878,7 @@ static int fruit_ntimes(vfs_handle_struct *handle, - ad_setdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, - convert_time_t_to_uint32_t(ft->create_time.tv_sec)); - -- rc = ad_set(ad, smb_fname); -+ rc = ad_set(handle, ad, smb_fname); - - exit: - --- -2.21.0 - - -From c045cf398f4b59112539000fe629d89ff7d3bbc3 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 11:19:53 +0200 -Subject: [PATCH 03/31] vfs_fruit: pass handle to ad_read() - -On the course of removing ad_handle from struct adouble, step 3. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit d0abf945e683766029d28915541a4baf9f3879ab) ---- - source3/modules/vfs_fruit.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index cb87396b9b2..7e1d27476aa 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1785,7 +1785,9 @@ static ssize_t ad_read_rsrc(struct adouble *ad, - /** - * Read and unpack an AppleDouble metadata xattr or resource - **/ --static ssize_t ad_read(struct adouble *ad, const struct smb_filename *smb_fname) -+static ssize_t ad_read(vfs_handle_struct *handle, -+ struct adouble *ad, -+ const struct smb_filename *smb_fname) - { - switch (ad->ad_type) { - case ADOUBLE_META: -@@ -1970,7 +1972,7 @@ static struct adouble *ad_get_internal(TALLOC_CTX *ctx, - - } - -- len = ad_read(ad, smb_fname); -+ len = ad_read(handle, ad, smb_fname); - if (len == -1) { - DEBUG(10, ("error reading AppleDouble for %s\n", - smb_fname->base_name)); --- -2.21.0 - - -From ac757c82574c0434e2a0afc94a30571437dd4ee2 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 11:22:24 +0200 -Subject: [PATCH 04/31] vfs_fruit: pass handle to ad_read_meta() - -On the course of removing ad_handle from struct adouble, step 4. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit f8df09157f31b53dbe73eaf4349fc071bfcc1b90) ---- - source3/modules/vfs_fruit.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 7e1d27476aa..fab361164ac 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1511,7 +1511,8 @@ static int ad_convert(struct vfs_handle_struct *handle, - /** - * Read and parse Netatalk AppleDouble metadata xattr - **/ --static ssize_t ad_read_meta(struct adouble *ad, -+static ssize_t ad_read_meta(vfs_handle_struct *handle, -+ struct adouble *ad, - const struct smb_filename *smb_fname) - { - int rc = 0; -@@ -1520,7 +1521,7 @@ static ssize_t ad_read_meta(struct adouble *ad, - - DEBUG(10, ("reading meta xattr for %s\n", smb_fname->base_name)); - -- ealen = SMB_VFS_GETXATTR(ad->ad_handle->conn, smb_fname, -+ ealen = SMB_VFS_GETXATTR(handle->conn, smb_fname, - AFPINFO_EA_NETATALK, ad->ad_data, - AD_DATASZ_XATTR); - if (ealen == -1) { -@@ -1791,7 +1792,7 @@ static ssize_t ad_read(vfs_handle_struct *handle, - { - switch (ad->ad_type) { - case ADOUBLE_META: -- return ad_read_meta(ad, smb_fname); -+ return ad_read_meta(handle, ad, smb_fname); - case ADOUBLE_RSRC: - return ad_read_rsrc(ad, smb_fname); - default: --- -2.21.0 - - -From b802829d7648fce8e6641633f02f62e494d67eb9 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 11:23:17 +0200 -Subject: [PATCH 05/31] vfs_fruit: indentation fix - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 47721d8d359ef78b8dd4f77f92c30c2caf2c4a80) ---- - source3/modules/vfs_fruit.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index fab361164ac..1e9ab4f615f 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1513,7 +1513,7 @@ static int ad_convert(struct vfs_handle_struct *handle, - **/ - static ssize_t ad_read_meta(vfs_handle_struct *handle, - struct adouble *ad, -- const struct smb_filename *smb_fname) -+ const struct smb_filename *smb_fname) - { - int rc = 0; - ssize_t ealen; --- -2.21.0 - - -From 297ee52a9c6e1b5808d68cacd0b3c972bf7b7313 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 11:42:06 +0200 -Subject: [PATCH 06/31] vfs_fruit: use proper VFS function in ad_read_meta() - -Continuing to ignore a possible error for now, this is in an error codepath -anyway. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 30ca328c698c2e035e240359bda7c9dcbeb646df) ---- - source3/modules/vfs_fruit.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 1e9ab4f615f..046fa2da2e2 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1578,7 +1578,9 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle, - ealen = -1; - if (errno == EINVAL) { - become_root(); -- removexattr(smb_fname->base_name, AFPINFO_EA_NETATALK); -+ (void)SMB_VFS_REMOVEXATTR(handle->conn, -+ smb_fname, -+ AFPINFO_EA_NETATALK); - unbecome_root(); - errno = ENOENT; - } --- -2.21.0 - - -From d515ff9c7cc6f5b8a6863362d78af5911afec985 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 11:47:26 +0200 -Subject: [PATCH 07/31] vfs_fruit: pass handle to ad_read_rsrc() and all the - way down - -On the course of removing ad_handle from struct adouble, step 5. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 661dfa4a19673fdb30d5bf36279cdf867454b947) ---- - source3/modules/vfs_fruit.c | 21 ++++++++++++--------- - 1 file changed, 12 insertions(+), 9 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 046fa2da2e2..0bcf67c5834 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1682,7 +1682,8 @@ static int ad_open(vfs_handle_struct *handle, - return 0; - } - --static ssize_t ad_read_rsrc_xattr(struct adouble *ad) -+static ssize_t ad_read_rsrc_xattr(vfs_handle_struct *handle, -+ struct adouble *ad) - { - int ret; - SMB_STRUCT_STAT st; -@@ -1690,7 +1691,7 @@ static ssize_t ad_read_rsrc_xattr(struct adouble *ad) - /* FIXME: direct sys_fstat(), don't have an fsp */ - ret = sys_fstat(ad->ad_fd, &st, - lp_fake_directory_create_times( -- SNUM(ad->ad_handle->conn))); -+ SNUM(handle->conn))); - if (ret != 0) { - return -1; - } -@@ -1699,7 +1700,8 @@ static ssize_t ad_read_rsrc_xattr(struct adouble *ad) - return st.st_ex_size; - } - --static ssize_t ad_read_rsrc_adouble(struct adouble *ad, -+static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, -+ struct adouble *ad, - const struct smb_filename *smb_fname) - { - SMB_STRUCT_STAT sbuf; -@@ -1710,7 +1712,7 @@ static ssize_t ad_read_rsrc_adouble(struct adouble *ad, - bool ok; - - ret = sys_fstat(ad->ad_fd, &sbuf, lp_fake_directory_create_times( -- SNUM(ad->ad_handle->conn))); -+ SNUM(handle->conn))); - if (ret != 0) { - return -1; - } -@@ -1767,19 +1769,20 @@ static ssize_t ad_read_rsrc_adouble(struct adouble *ad, - /** - * Read and parse resource fork, either ._ AppleDouble file or xattr - **/ --static ssize_t ad_read_rsrc(struct adouble *ad, -+static ssize_t ad_read_rsrc(vfs_handle_struct *handle, -+ struct adouble *ad, - const struct smb_filename *smb_fname) - { - struct fruit_config_data *config = NULL; - ssize_t len; - -- SMB_VFS_HANDLE_GET_DATA(ad->ad_handle, config, -+ SMB_VFS_HANDLE_GET_DATA(handle, config, - struct fruit_config_data, return -1); - - if (config->rsrc == FRUIT_RSRC_XATTR) { -- len = ad_read_rsrc_xattr(ad); -+ len = ad_read_rsrc_xattr(handle, ad); - } else { -- len = ad_read_rsrc_adouble(ad, smb_fname); -+ len = ad_read_rsrc_adouble(handle, ad, smb_fname); - } - - return len; -@@ -1796,7 +1799,7 @@ static ssize_t ad_read(vfs_handle_struct *handle, - case ADOUBLE_META: - return ad_read_meta(handle, ad, smb_fname); - case ADOUBLE_RSRC: -- return ad_read_rsrc(ad, smb_fname); -+ return ad_read_rsrc(handle, ad, smb_fname); - default: - return -1; - } --- -2.21.0 - - -From cda7ebf61991a8640b696916d0769f965af325b5 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 11:23:17 +0200 -Subject: [PATCH 08/31] vfs_fruit: indentation fix - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 400b3c2f8c82b1defe1e321e0cdae486b930344f) ---- - source3/modules/vfs_fruit.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 0bcf67c5834..c649710d754 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1702,7 +1702,7 @@ static ssize_t ad_read_rsrc_xattr(vfs_handle_struct *handle, - - static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, - struct adouble *ad, -- const struct smb_filename *smb_fname) -+ const struct smb_filename *smb_fname) - { - SMB_STRUCT_STAT sbuf; - char *p_ad = NULL; -@@ -1771,7 +1771,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, - **/ - static ssize_t ad_read_rsrc(vfs_handle_struct *handle, - struct adouble *ad, -- const struct smb_filename *smb_fname) -+ const struct smb_filename *smb_fname) - { - struct fruit_config_data *config = NULL; - ssize_t len; --- -2.21.0 - - -From 796677632779f18cecb51209a4892de0ac6db84b Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 11:54:10 +0200 -Subject: [PATCH 09/31] vfs_fruit: pass handle to ad_convert_xattr() - -On the course of removing ad_handle from struct adouble, step 7. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit fd2f4cf828ee4c31e3b5a27a79d3a0ee12a5877a) ---- - source3/modules/vfs_fruit.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index c649710d754..0b58cf1a1e5 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1057,7 +1057,8 @@ static bool ad_convert_move_reso(struct adouble *ad, - return true; - } - --static bool ad_convert_xattr(struct adouble *ad, -+static bool ad_convert_xattr(vfs_handle_struct *handle, -+ struct adouble *ad, - const struct smb_filename *smb_fname, - bool *converted_xattr) - { -@@ -1108,7 +1109,7 @@ static bool ad_convert_xattr(struct adouble *ad, - files_struct *fsp = NULL; - ssize_t nwritten; - -- status = string_replace_allocate(ad->ad_handle->conn, -+ status = string_replace_allocate(handle->conn, - e->adx_name, - string_replace_cmaps, - talloc_tos(), -@@ -1145,7 +1146,7 @@ static bool ad_convert_xattr(struct adouble *ad, - DBG_DEBUG("stream_name: %s\n", smb_fname_str_dbg(stream_name)); - - status = SMB_VFS_CREATE_FILE( -- ad->ad_handle->conn, /* conn */ -+ handle->conn, /* conn */ - NULL, /* req */ - 0, /* root_dir_fid */ - stream_name, /* fname */ -@@ -1468,7 +1469,7 @@ static int ad_convert(struct vfs_handle_struct *handle, - return 0; - } - -- ok = ad_convert_xattr(ad, smb_fname, &converted_xattr); -+ ok = ad_convert_xattr(handle, ad, smb_fname, &converted_xattr); - if (!ok) { - ret = -1; - goto done; --- -2.21.0 - - -From ebae25734342988d6fcbe0489b4264455c27c97b Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 12:02:46 +0200 -Subject: [PATCH 10/31] vfs_fruit: pass handle to ad_convert_blank_rfork() - -On the course of removing ad_handle from struct adouble, step 8. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit adc7ac38b849b4dce4a85fd6442c8d4b9da57686) ---- - source3/modules/vfs_fruit.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 0b58cf1a1e5..80a647dc847 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1345,7 +1345,8 @@ static bool ad_convert_truncate(struct adouble *ad, - return true; - } - --static bool ad_convert_blank_rfork(struct adouble *ad, -+static bool ad_convert_blank_rfork(vfs_handle_struct *handle, -+ struct adouble *ad, - bool *blank) - { - struct fruit_config_data *config = NULL; -@@ -1358,7 +1359,7 @@ static bool ad_convert_blank_rfork(struct adouble *ad, - - *blank = false; - -- SMB_VFS_HANDLE_GET_DATA(ad->ad_handle, config, -+ SMB_VFS_HANDLE_GET_DATA(handle, config, - struct fruit_config_data, return false); - - if (!config->wipe_intentionally_left_blank_rfork) { -@@ -1475,7 +1476,7 @@ static int ad_convert(struct vfs_handle_struct *handle, - goto done; - } - -- ok = ad_convert_blank_rfork(ad, &blank); -+ ok = ad_convert_blank_rfork(handle, ad, &blank); - if (!ok) { - ret = -1; - goto done; --- -2.21.0 - - -From 203ef7c510f358c76aa7e582b6b7c519b4154e06 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 12:05:07 +0200 -Subject: [PATCH 11/31] vfs_fruit: pass handle to ad_convert_finderinfo() - -On the course of removing ad_handle from struct adouble, step 9. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 50874c1548d62ab0ddaaa6dd4124279ee5029fcf) ---- - source3/modules/vfs_fruit.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 80a647dc847..eb6137202a7 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1225,7 +1225,8 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, - return ok; - } - --static bool ad_convert_finderinfo(struct adouble *ad, -+static bool ad_convert_finderinfo(vfs_handle_struct *handle, -+ struct adouble *ad, - const struct smb_filename *smb_fname) - { - char *p_ad = NULL; -@@ -1282,7 +1283,7 @@ static bool ad_convert_finderinfo(struct adouble *ad, - DBG_DEBUG("stream_name: %s\n", smb_fname_str_dbg(stream_name)); - - status = SMB_VFS_CREATE_FILE( -- ad->ad_handle->conn, /* conn */ -+ handle->conn, /* conn */ - NULL, /* req */ - 0, /* root_dir_fid */ - stream_name, /* fname */ -@@ -1490,7 +1491,7 @@ static int ad_convert(struct vfs_handle_struct *handle, - } - } - -- ok = ad_convert_finderinfo(ad, smb_fname); -+ ok = ad_convert_finderinfo(handle, ad, smb_fname); - if (!ok) { - DBG_ERR("Failed to convert [%s]\n", - smb_fname_str_dbg(smb_fname)); --- -2.21.0 - - -From 6701abc1b2c68df2e134e5e7257c386fd35ea9fe Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 12:17:28 +0200 -Subject: [PATCH 12/31] vfs_fruit: pass handle to ad_convert_delete_adfile() - -On the course of removing ad_handle from struct adouble, step 10. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 5f4d16b40e07acf8d27fee62f1a56de175663a1d) ---- - source3/modules/vfs_fruit.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index eb6137202a7..38bfa5e2b6b 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1411,7 +1411,8 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle, - return true; - } - --static bool ad_convert_delete_adfile(struct adouble *ad, -+static bool ad_convert_delete_adfile(vfs_handle_struct *handle, -+ struct adouble *ad, - const struct smb_filename *smb_fname) - { - struct fruit_config_data *config = NULL; -@@ -1422,7 +1423,7 @@ static bool ad_convert_delete_adfile(struct adouble *ad, - return true; - } - -- SMB_VFS_HANDLE_GET_DATA(ad->ad_handle, config, -+ SMB_VFS_HANDLE_GET_DATA(handle, config, - struct fruit_config_data, return false); - - if (!config->delete_empty_adfiles) { -@@ -1434,7 +1435,7 @@ static bool ad_convert_delete_adfile(struct adouble *ad, - return false; - } - -- rc = SMB_VFS_NEXT_UNLINK(ad->ad_handle, ad_name); -+ rc = SMB_VFS_NEXT_UNLINK(handle, ad_name); - if (rc != 0) { - DBG_ERR("Unlinking [%s] failed: %s\n", - smb_fname_str_dbg(ad_name), strerror(errno)); -@@ -1499,7 +1500,7 @@ static int ad_convert(struct vfs_handle_struct *handle, - goto done; - } - -- ok = ad_convert_delete_adfile(ad, smb_fname); -+ ok = ad_convert_delete_adfile(handle, ad, smb_fname); - if (!ok) { - ret = -1; - goto done; --- -2.21.0 - - -From 6f953506ef2704ffc3c99cc492dfeb739128e5a8 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 12:19:06 +0200 -Subject: [PATCH 13/31] vfs_fruit: finally, remove ad_handle from struct - adouble - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit e266daaed149561b746dbb8d5e9523862f0057b5) ---- - source3/modules/vfs_fruit.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 38bfa5e2b6b..e79b548a511 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -411,7 +411,6 @@ struct ad_entry { - }; - - struct adouble { -- vfs_handle_struct *ad_handle; - int ad_fd; - bool ad_opened; - adouble_type_t ad_type; -@@ -1868,7 +1867,6 @@ static struct adouble *ad_alloc(TALLOC_CTX *ctx, vfs_handle_struct *handle, - } - } - -- ad->ad_handle = handle; - ad->ad_type = type; - ad->ad_magic = AD_MAGIC; - ad->ad_version = AD_VERSION; --- -2.21.0 - - -From 42f996a6983d0a2895bf49778446e6238b5bac10 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Tue, 21 May 2019 11:39:18 +0200 -Subject: [PATCH 14/31] vfs_fruit: add and use is_adouble_file() - -This adds a helper function that checks whether the last component of a path is -an AppleDouble sidecar file with "._" name prefix. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit ad70c947c759aa0965ee57f973fb8dc1909e0e39) ---- - source3/modules/vfs_fruit.c | 27 ++++++++++++++++++++++----- - 1 file changed, 22 insertions(+), 5 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index e79b548a511..0dd24293c9b 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -2172,6 +2172,27 @@ static bool is_apple_stream(const struct smb_filename *smb_fname) - return false; - } - -+static bool is_adouble_file(const char *path) -+{ -+ const char *p = NULL; -+ int match; -+ -+ p = strrchr(path, '/'); -+ if (p == NULL) { -+ p = path; -+ } else { -+ p++; -+ } -+ -+ match = strncmp(p, -+ ADOUBLE_NAME_PREFIX, -+ strlen(ADOUBLE_NAME_PREFIX)); -+ if (match != 0) { -+ return false; -+ } -+ return true; -+} -+ - /** - * Initialize config struct from our smb.conf config parameters - **/ -@@ -4204,16 +4225,12 @@ static int fruit_rmdir(struct vfs_handle_struct *handle, - } - - while ((de = SMB_VFS_READDIR(handle->conn, dh, NULL)) != NULL) { -- int match; - struct adouble *ad = NULL; - char *p = NULL; - struct smb_filename *ad_smb_fname = NULL; - int ret; - -- match = strncmp(de->d_name, -- ADOUBLE_NAME_PREFIX, -- strlen(ADOUBLE_NAME_PREFIX)); -- if (match != 0) { -+ if (!is_adouble_file(de->d_name)) { - continue; - } - --- -2.21.0 - - -From 12c65cc8aa37440c7e549da876564ff5cd47220b Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Tue, 21 May 2019 11:40:33 +0200 -Subject: [PATCH 15/31] vfs_fruit: add a missing else - -Luckily the missing else has the same control flow due to the previous if and -else blocks calling return. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 44d8568001c87d28962dfc4e3fde6d0f7f409997) ---- - source3/modules/vfs_fruit.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 0dd24293c9b..c7cb4cdba7d 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -4079,7 +4079,7 @@ static int fruit_unlink(vfs_handle_struct *handle, - return fruit_unlink_meta(handle, smb_fname); - } else if (is_afpresource_stream(smb_fname)) { - return fruit_unlink_rsrc(handle, smb_fname, false); -- } if (is_ntfs_stream_smb_fname(smb_fname)) { -+ } else if (is_ntfs_stream_smb_fname(smb_fname)) { - return SMB_VFS_NEXT_UNLINK(handle, smb_fname); - } - --- -2.21.0 - - -From 359fae9e2e0ef599d6778c65fcb3355d0bf5a8a0 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Tue, 21 May 2019 11:42:47 +0200 -Subject: [PATCH 16/31] vfs_fruit: ignore AppleDouble files in fruit_unlink() - -Otherwise, if SMB_VFS_UNLINK() is called for an AppleDouble path "._file", we -try to delete "._._file" which doesn't make sense. AppleDouble files don't have -AppleDouble themselves. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 797dc649456f39add4af8b54b60db0268ad4e90e) ---- - source3/modules/vfs_fruit.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index c7cb4cdba7d..e7e14673e10 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -4081,6 +4081,8 @@ static int fruit_unlink(vfs_handle_struct *handle, - return fruit_unlink_rsrc(handle, smb_fname, false); - } else if (is_ntfs_stream_smb_fname(smb_fname)) { - return SMB_VFS_NEXT_UNLINK(handle, smb_fname); -+ } else if (is_adouble_file(smb_fname->base_name)) { -+ return SMB_VFS_NEXT_UNLINK(handle, smb_fname); - } - - /* --- -2.21.0 - - -From 39bccb6c88eb19b6abcf3d49f72ae73bec1d6af6 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Wed, 22 May 2019 17:02:20 +0200 -Subject: [PATCH 17/31] vfs_fruit: use correct case FRUIT_RSRC_STREAM in - readdir_attr_rfork_size() - -This is a genuine bug, but luckily this would only impact configs which nobody -uses: - - fruit:metadata = netatalk - fruit:resource = stream - -With the above configuration the switch in readdir_attr_rfork_size() would hit -the default case and so always report resource forks as 0 bytes in size. - -All deployment that I've seen that use fruit:resource=stream also use -fruit:metadata=stream, so the switch takes FRUIT_META_STREAM case which runs the -correct code readdir_attr_rfork_size_stream(). - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 83179a74119de84d20f796c241aae6bccb83a68b) ---- - source3/modules/vfs_fruit.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index e7e14673e10..96a026acbf8 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -3223,7 +3223,7 @@ static uint64_t readdir_attr_rfork_size(struct vfs_handle_struct *handle, - smb_fname); - break; - -- case FRUIT_META_STREAM: -+ case FRUIT_RSRC_STREAM: - rfork_size = readdir_attr_rfork_size_stream(handle, - smb_fname); - break; --- -2.21.0 - - -From 4f611e9da46c49a5be3a0b7c491b23c9c5084526 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Wed, 22 May 2019 18:08:14 +0200 -Subject: [PATCH 18/31] vfs_fruit: use stream code for resource fork size - calculation in readdir_attr_rfork_size() - -This works as well, using an fstat() on the filehandle to get the size. This is -tested by the torture test "vfs.fruit.SMB2/CREATE context AAPL". - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit a23bcc1916a49bf3e0edece190e5434e39862d2c) ---- - source3/modules/vfs_fruit.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 96a026acbf8..82c20dbea13 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -3218,11 +3218,11 @@ static uint64_t readdir_attr_rfork_size(struct vfs_handle_struct *handle, - - switch (config->rsrc) { - case FRUIT_RSRC_ADFILE: -- case FRUIT_RSRC_XATTR: - rfork_size = readdir_attr_rfork_size_adouble(handle, - smb_fname); - break; - -+ case FRUIT_RSRC_XATTR: - case FRUIT_RSRC_STREAM: - rfork_size = readdir_attr_rfork_size_stream(handle, - smb_fname); --- -2.21.0 - - -From 7e2a1d4771b73f2956005f70b588a6c37cc953a8 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 17 May 2019 14:31:15 +0200 -Subject: [PATCH 19/31] vfs_fruit: remove now unused AppleDouble code for - resource fork in xattr - -This was only needed to get the resourcefork size via the ad_* AppleDouble -function. This is now done with a fstat on the low level xattr fd (remember, -this is Solaris only code...), so we can remove the xattr special casing from -the AppleDouble functions. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit cb9dffa1c66294b6eed85e7576aa99c642d0b541) ---- - source3/modules/vfs_fruit.c | 70 ++----------------------------------- - 1 file changed, 3 insertions(+), 67 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 82c20dbea13..74b10a32449 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1591,20 +1591,6 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle, - return ealen; - } - --static int ad_open_rsrc_xattr(const struct smb_filename *smb_fname, -- int flags, -- mode_t mode) --{ --#ifdef HAVE_ATTROPEN -- /* FIXME: direct Solaris xattr syscall */ -- return attropen(smb_fname->base_name, -- AFPRESOURCE_EA_NETATALK, flags, mode); --#else -- errno = ENOSYS; -- return -1; --#endif --} -- - static int ad_open_rsrc_adouble(const struct smb_filename *smb_fname, - int flags, - mode_t mode) -@@ -1629,19 +1615,7 @@ static int ad_open_rsrc(vfs_handle_struct *handle, - int flags, - mode_t mode) - { -- struct fruit_config_data *config = NULL; -- int fd; -- -- SMB_VFS_HANDLE_GET_DATA(handle, config, -- struct fruit_config_data, return -1); -- -- if (config->rsrc == FRUIT_RSRC_XATTR) { -- fd = ad_open_rsrc_xattr(smb_fname, flags, mode); -- } else { -- fd = ad_open_rsrc_adouble(smb_fname, flags, mode); -- } -- -- return fd; -+ return ad_open_rsrc_adouble(smb_fname, flags, mode); - } - - /* -@@ -1685,24 +1659,6 @@ static int ad_open(vfs_handle_struct *handle, - return 0; - } - --static ssize_t ad_read_rsrc_xattr(vfs_handle_struct *handle, -- struct adouble *ad) --{ -- int ret; -- SMB_STRUCT_STAT st; -- -- /* FIXME: direct sys_fstat(), don't have an fsp */ -- ret = sys_fstat(ad->ad_fd, &st, -- lp_fake_directory_create_times( -- SNUM(handle->conn))); -- if (ret != 0) { -- return -1; -- } -- -- ad_setentrylen(ad, ADEID_RFORK, st.st_ex_size); -- return st.st_ex_size; --} -- - static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, - struct adouble *ad, - const struct smb_filename *smb_fname) -@@ -1776,19 +1732,7 @@ static ssize_t ad_read_rsrc(vfs_handle_struct *handle, - struct adouble *ad, - const struct smb_filename *smb_fname) - { -- struct fruit_config_data *config = NULL; -- ssize_t len; -- -- SMB_VFS_HANDLE_GET_DATA(handle, config, -- struct fruit_config_data, return -1); -- -- if (config->rsrc == FRUIT_RSRC_XATTR) { -- len = ad_read_rsrc_xattr(handle, ad); -- } else { -- len = ad_read_rsrc_adouble(handle, ad, smb_fname); -- } -- -- return len; -+ return ad_read_rsrc_adouble(handle, ad, smb_fname); - } - - /** -@@ -1896,22 +1840,14 @@ static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle, - int rc = 0; - const struct ad_entry_order *eid; - struct adouble *ad = NULL; -- struct fruit_config_data *config; - time_t t = time(NULL); - -- SMB_VFS_HANDLE_GET_DATA(handle, config, -- struct fruit_config_data, return NULL); -- - switch (type) { - case ADOUBLE_META: - eid = entry_order_meta_xattr; - break; - case ADOUBLE_RSRC: -- if (config->rsrc == FRUIT_RSRC_ADFILE) { -- eid = entry_order_dot_und; -- } else { -- eid = entry_order_rsrc_xattr; -- } -+ eid = entry_order_dot_und; - break; - default: - return NULL; --- -2.21.0 - - -From eb48ba0846b109a44b704241a6a57df3c9ad3216 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Wed, 22 May 2019 21:15:22 +0200 -Subject: [PATCH 20/31] vfs_fruit: remove xattr code from the AppleDouble - subsystem - -The subsystem consumers have been reworked in the previous commits, so this is -not used anymore. ad_init() doesn't need a handle argument anymore due to this, -remove it as well. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit e3cb1cb24f2a31d7fd03f3bdf417f4704fb4ac7c) ---- - source3/modules/vfs_fruit.c | 35 ++++++++--------------------------- - 1 file changed, 8 insertions(+), 27 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 74b10a32449..1e560bf07b5 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -449,18 +449,6 @@ struct ad_entry_order entry_order_dot_und[ADEID_NUM_DOT_UND + 1] = { - {0, 0, 0} - }; - --/* -- * Fake AppleDouble entry oder for resource fork xattr. The xattr -- * isn't an AppleDouble file, it simply contains the resource data, -- * but in order to be able to use some API calls like ad_getentryoff() -- * we build a fake/helper struct adouble with this entry order struct. -- */ --static const --struct ad_entry_order entry_order_rsrc_xattr[ADEID_NUM_RSRC_XATTR + 1] = { -- {ADEID_RFORK, 0, 0}, -- {0, 0, 0} --}; -- - /* Conversion from enumerated id to on-disk AppleDouble id */ - #define AD_EID_DISK(a) (set_eid[a]) - static const uint32_t set_eid[] = { -@@ -532,7 +520,7 @@ struct fio { - /* - * Forward declarations - */ --static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle, -+static struct adouble *ad_init(TALLOC_CTX *ctx, - adouble_type_t type); - static struct adouble *ad_get(TALLOC_CTX *ctx, - vfs_handle_struct *handle, -@@ -1773,25 +1761,19 @@ static int adouble_destructor(struct adouble *ad) - * - * @return adouble handle - **/ --static struct adouble *ad_alloc(TALLOC_CTX *ctx, vfs_handle_struct *handle, -+static struct adouble *ad_alloc(TALLOC_CTX *ctx, - adouble_type_t type) - { - int rc = 0; - size_t adsize = 0; - struct adouble *ad; -- struct fruit_config_data *config; -- -- SMB_VFS_HANDLE_GET_DATA(handle, config, -- struct fruit_config_data, return NULL); - - switch (type) { - case ADOUBLE_META: - adsize = AD_DATASZ_XATTR; - break; - case ADOUBLE_RSRC: -- if (config->rsrc == FRUIT_RSRC_ADFILE) { -- adsize = AD_DATASZ_DOT_UND; -- } -+ adsize = AD_DATASZ_DOT_UND; - break; - default: - return NULL; -@@ -1829,12 +1811,11 @@ static struct adouble *ad_alloc(TALLOC_CTX *ctx, vfs_handle_struct *handle, - * Allocate and initialize a new struct adouble - * - * @param[in] ctx talloc context -- * @param[in] handle vfs handle - * @param[in] type type of AppleDouble, ADOUBLE_META or ADOUBLE_RSRC - * - * @return adouble handle, initialized - **/ --static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle, -+static struct adouble *ad_init(TALLOC_CTX *ctx, - adouble_type_t type) - { - int rc = 0; -@@ -1853,7 +1834,7 @@ static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle, - return NULL; - } - -- ad = ad_alloc(ctx, handle, type); -+ ad = ad_alloc(ctx, type); - if (ad == NULL) { - return NULL; - } -@@ -1895,7 +1876,7 @@ static struct adouble *ad_get_internal(TALLOC_CTX *ctx, - type == ADOUBLE_META ? "meta" : "rsrc", - smb_fname->base_name)); - -- ad = ad_alloc(ctx, handle, type); -+ ad = ad_alloc(ctx, type); - if (ad == NULL) { - rc = -1; - goto exit; -@@ -3555,7 +3536,7 @@ static int fruit_open_rsrc_adouble(vfs_handle_struct *handle, - } - - if (flags & (O_CREAT | O_TRUNC)) { -- ad = ad_init(fsp, handle, ADOUBLE_RSRC); -+ ad = ad_init(fsp, ADOUBLE_RSRC); - if (ad == NULL) { - rc = -1; - goto exit; -@@ -4635,7 +4616,7 @@ static ssize_t fruit_pwrite_meta_netatalk(vfs_handle_struct *handle, - - ad = ad_fget(talloc_tos(), handle, fsp, ADOUBLE_META); - if (ad == NULL) { -- ad = ad_init(talloc_tos(), handle, ADOUBLE_META); -+ ad = ad_init(talloc_tos(), ADOUBLE_META); - if (ad == NULL) { - return -1; - } --- -2.21.0 - - -From 8598f79e210655549996a52bfc15888906208c4f Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Thu, 23 May 2019 08:14:18 +0200 -Subject: [PATCH 21/31] vfs_fruit: pass VFS handle to ad_convert_move_reso() - -Not used for now, that comes next. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 3919ea048fe3b763657e14cdfb5920184a900d27) ---- - source3/modules/vfs_fruit.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 1e560bf07b5..01f6fa821c0 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -992,7 +992,8 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries, - return true; - } - --static bool ad_convert_move_reso(struct adouble *ad, -+static bool ad_convert_move_reso(vfs_handle_struct *handle, -+ struct adouble *ad, - const struct smb_filename *smb_fname) - { - char *map = MAP_FAILED; -@@ -1194,7 +1195,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, - goto fail; - } - -- ok = ad_convert_move_reso(ad, smb_fname); -+ ok = ad_convert_move_reso(handle, ad, smb_fname); - if (!ok) { - goto fail; - } --- -2.21.0 - - -From 3c32a8da96b8d3233c47593be4b5de6de44d08f8 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Thu, 23 May 2019 08:27:37 +0200 -Subject: [PATCH 22/31] vfs_fruit: remove a layer of indirection - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 97d485ff2cda85edeba163ea01b6abfa705db20f) ---- - source3/modules/vfs_fruit.c | 15 ++++----------- - 1 file changed, 4 insertions(+), 11 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 01f6fa821c0..b927660db9c 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1580,9 +1580,10 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle, - return ealen; - } - --static int ad_open_rsrc_adouble(const struct smb_filename *smb_fname, -- int flags, -- mode_t mode) -+static int ad_open_rsrc(vfs_handle_struct *handle, -+ const struct smb_filename *smb_fname, -+ int flags, -+ mode_t mode) - { - int ret; - int fd; -@@ -1599,14 +1600,6 @@ static int ad_open_rsrc_adouble(const struct smb_filename *smb_fname, - return fd; - } - --static int ad_open_rsrc(vfs_handle_struct *handle, -- const struct smb_filename *smb_fname, -- int flags, -- mode_t mode) --{ -- return ad_open_rsrc_adouble(smb_fname, flags, mode); --} -- - /* - * Here's the deal: for ADOUBLE_META we can do without an fd as we can issue - * path based xattr calls. For ADOUBLE_RSRC however we need a full-fledged fd --- -2.21.0 - - -From 79fc20532535da8ceaa5d0348da46a422f4e9369 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Thu, 23 May 2019 16:22:39 +0200 -Subject: [PATCH 23/31] vfs_fruit: only do cross protocol locking on - non-internal opens - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit f5f7d1e9bf7e39933ccf7c874e682f9df80a6fec) ---- - source3/modules/vfs_fruit.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index b927660db9c..fc9e0c90606 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -6071,7 +6071,9 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle, - return status; - } - -- if (config->locking == FRUIT_LOCKING_NETATALK) { -+ if ((config->locking == FRUIT_LOCKING_NETATALK) && -+ (fsp->op != NULL)) -+ { - status = fruit_check_access( - handle, *result, - access_mask, --- -2.21.0 - - -From f381b0af9e9d3ca53ba742444cf4e58bb6cd8172 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Thu, 23 May 2019 16:42:52 +0200 -Subject: [PATCH 24/31] vfs_fruit: convert ad_open_rsrc() to open a proper fsp - with SMB_VFS_CREATE_FILE() - -A first step in converting all raw syscalls to use proper VFS functions. All -existing users of the raw system filedescriptor continue to use the fd from -fsp->fh for now. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 29418c726be74feb1d8c3ac9f7b8c983901a2aab) ---- - source3/modules/vfs_fruit.c | 103 +++++++++++++++++++++++++++--------- - 1 file changed, 77 insertions(+), 26 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index fc9e0c90606..d6d9fce7956 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -411,7 +411,7 @@ struct ad_entry { - }; - - struct adouble { -- int ad_fd; -+ files_struct *ad_fsp; - bool ad_opened; - adouble_type_t ad_type; - uint32_t ad_magic; -@@ -1011,7 +1011,7 @@ static bool ad_convert_move_reso(vfs_handle_struct *handle, - - /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ - map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, -- ad->ad_fd, 0); -+ ad->ad_fsp->fh->fd, 0); - if (map == MAP_FAILED) { - DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); - return false; -@@ -1036,7 +1036,7 @@ static bool ad_convert_move_reso(vfs_handle_struct *handle, - return false; - } - -- len = sys_pwrite(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); -+ len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); - if (len != AD_DATASZ_DOT_UND) { - DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len); - return false; -@@ -1083,7 +1083,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, - - /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ - map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, -- ad->ad_fd, 0); -+ ad->ad_fsp->fh->fd, 0); - if (map == MAP_FAILED) { - DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); - return false; -@@ -1188,7 +1188,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, - goto fail; - } - -- len = sys_pwrite(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); -+ len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); - if (len != AD_DATASZ_DOT_UND) { - DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len); - ok = false; -@@ -1325,7 +1325,7 @@ static bool ad_convert_truncate(struct adouble *ad, - * FIXME: direct ftruncate(), but we don't have a fsp for the - * VFS call - */ -- rc = ftruncate(ad->ad_fd, ADEDOFF_RFORK_DOT_UND + -+ rc = ftruncate(ad->ad_fsp->fh->fd, ADEDOFF_RFORK_DOT_UND + - ad_getentrylen(ad, ADEID_RFORK)); - if (rc != 0) { - return false; -@@ -1364,7 +1364,7 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle, - - /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ - map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, -- ad->ad_fd, 0); -+ ad->ad_fsp->fh->fd, 0); - if (map == MAP_FAILED) { - DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); - return false; -@@ -1390,7 +1390,7 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle, - return false; - } - -- len = sys_pwrite(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); -+ len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); - if (len != AD_DATASZ_DOT_UND) { - return false; - } -@@ -1583,21 +1583,64 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle, - static int ad_open_rsrc(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - int flags, -- mode_t mode) -+ mode_t mode, -+ files_struct **_fsp) - { - int ret; -- int fd; - struct smb_filename *adp_smb_fname = NULL; -+ files_struct *fsp = NULL; -+ uint32_t access_mask; -+ uint32_t share_access; -+ uint32_t create_disposition; -+ NTSTATUS status; - - ret = adouble_path(talloc_tos(), smb_fname, &adp_smb_fname); - if (ret != 0) { - return -1; - } - -- fd = open(adp_smb_fname->base_name, flags, mode); -+ ret = SMB_VFS_STAT(handle->conn, adp_smb_fname); -+ if (ret != 0) { -+ TALLOC_FREE(adp_smb_fname); -+ return -1; -+ } -+ -+ access_mask = FILE_GENERIC_READ; -+ share_access = FILE_SHARE_READ | FILE_SHARE_WRITE; -+ create_disposition = FILE_OPEN; -+ -+ if (flags & O_RDWR) { -+ access_mask |= FILE_GENERIC_WRITE; -+ share_access &= ~FILE_SHARE_WRITE; -+ } -+ -+ status = SMB_VFS_CREATE_FILE( -+ handle->conn, /* conn */ -+ NULL, /* req */ -+ 0, /* root_dir_fid */ -+ adp_smb_fname, -+ access_mask, -+ share_access, -+ create_disposition, -+ 0, /* create_options */ -+ 0, /* file_attributes */ -+ INTERNAL_OPEN_ONLY, /* oplock_request */ -+ NULL, /* lease */ -+ 0, /* allocation_size */ -+ 0, /* private_flags */ -+ NULL, /* sd */ -+ NULL, /* ea_list */ -+ &fsp, -+ NULL, /* psbuf */ -+ NULL, NULL); /* create context */ - TALLOC_FREE(adp_smb_fname); -+ if (!NT_STATUS_IS_OK(status)) { -+ DBG_ERR("SMB_VFS_CREATE_FILE failed\n"); -+ return -1; -+ } - -- return fd; -+ *_fsp = fsp; -+ return 0; - } - - /* -@@ -1612,7 +1655,7 @@ static int ad_open(vfs_handle_struct *handle, - int flags, - mode_t mode) - { -- int fd; -+ int ret; - - DBG_DEBUG("Path [%s] type [%s]\n", smb_fname->base_name, - ad->ad_type == ADOUBLE_META ? "meta" : "rsrc"); -@@ -1621,22 +1664,21 @@ static int ad_open(vfs_handle_struct *handle, - return 0; - } - -- if ((fsp != NULL) && (fsp->fh != NULL) && (fsp->fh->fd != -1)) { -- ad->ad_fd = fsp->fh->fd; -+ if (fsp != NULL) { -+ ad->ad_fsp = fsp; - ad->ad_opened = false; - return 0; - } - -- fd = ad_open_rsrc(handle, smb_fname, flags, mode); -- if (fd == -1) { -+ ret = ad_open_rsrc(handle, smb_fname, flags, mode, &ad->ad_fsp); -+ if (ret != 0) { - return -1; - } - ad->ad_opened = true; -- ad->ad_fd = fd; - -- DBG_DEBUG("Path [%s] type [%s] fd [%d]\n", -+ DBG_DEBUG("Path [%s] type [%s]\n", - smb_fname->base_name, -- ad->ad_type == ADOUBLE_META ? "meta" : "rsrc", fd); -+ ad->ad_type == ADOUBLE_META ? "meta" : "rsrc"); - - return 0; - } -@@ -1652,7 +1694,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, - int ret; - bool ok; - -- ret = sys_fstat(ad->ad_fd, &sbuf, lp_fake_directory_create_times( -+ ret = sys_fstat(ad->ad_fsp->fh->fd, &sbuf, lp_fake_directory_create_times( - SNUM(handle->conn))); - if (ret != 0) { - return -1; -@@ -1678,7 +1720,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, - ad->ad_data = p_ad; - } - -- len = sys_pread(ad->ad_fd, ad->ad_data, -+ len = sys_pread(ad->ad_fsp->fh->fd, ad->ad_data, - talloc_array_length(ad->ad_data), 0); - if (len != talloc_array_length(ad->ad_data)) { - DBG_NOTICE("%s %s: bad size: %zd\n", -@@ -1736,10 +1778,20 @@ static ssize_t ad_read(vfs_handle_struct *handle, - - static int adouble_destructor(struct adouble *ad) - { -- if ((ad->ad_fd != -1) && ad->ad_opened) { -- close(ad->ad_fd); -- ad->ad_fd = -1; -+ NTSTATUS status; -+ -+ if (!ad->ad_opened) { -+ return 0; - } -+ -+ SMB_ASSERT(ad->ad_fsp != NULL); -+ -+ status = close_file(NULL, ad->ad_fsp, NORMAL_CLOSE); -+ if (!NT_STATUS_IS_OK(status)) { -+ DBG_ERR("Closing [%s] failed: %s\n", -+ fsp_str_dbg(ad->ad_fsp), nt_errstr(status)); -+ } -+ - return 0; - } - -@@ -1790,7 +1842,6 @@ static struct adouble *ad_alloc(TALLOC_CTX *ctx, - ad->ad_type = type; - ad->ad_magic = AD_MAGIC; - ad->ad_version = AD_VERSION; -- ad->ad_fd = -1; - - talloc_set_destructor(ad, adouble_destructor); - --- -2.21.0 - - -From 6a1beb430229e4d2dbace960b6a0a6a82af30f54 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Thu, 23 May 2019 22:44:21 +0200 -Subject: [PATCH 25/31] vfs_fruit: remove use of mmap() from - ad_convert_move_reso() - -We now have an fsp that we can use, so we can get rid of mmap() and -sys_pread()/sys_pwrite(). - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 0041855af0b05d6c47558880d6eebd1970179272) ---- - source3/modules/vfs_fruit.c | 56 ++++++++++++++++++++++--------------- - 1 file changed, 33 insertions(+), 23 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index d6d9fce7956..426da55816b 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -996,49 +996,59 @@ static bool ad_convert_move_reso(vfs_handle_struct *handle, - struct adouble *ad, - const struct smb_filename *smb_fname) - { -- char *map = MAP_FAILED; -- size_t maplen; -- ssize_t len; -- int rc; -+ char *buf = NULL; -+ size_t rforklen; -+ size_t rforkoff; -+ ssize_t n; -+ int ret; - bool ok; - -- if (ad_getentrylen(ad, ADEID_RFORK) == 0) { -+ rforklen = ad_getentrylen(ad, ADEID_RFORK); -+ if (rforklen == 0) { - return true; - } - -- maplen = ad_getentryoff(ad, ADEID_RFORK) + -- ad_getentrylen(ad, ADEID_RFORK); -- -- /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ -- map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, -- ad->ad_fsp->fh->fd, 0); -- if (map == MAP_FAILED) { -- DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); -+ buf = talloc_size(ad, rforklen); -+ if (buf == NULL) { -+ /* -+ * This allocates a buffer for reading the resource fork data in -+ * one big swoop. Resource forks won't be larger then, say, 64 -+ * MB, I swear, so just doing the allocation with the talloc -+ * limit as safeguard seems safe. -+ */ -+ DBG_ERR("Failed to allocate %zu bytes for rfork\n", -+ rforklen); - return false; - } - -+ rforkoff = ad_getentryoff(ad, ADEID_RFORK); - -- memmove(map + ADEDOFF_RFORK_DOT_UND, -- map + ad_getentryoff(ad, ADEID_RFORK), -- ad_getentrylen(ad, ADEID_RFORK)); -+ n = SMB_VFS_PREAD(ad->ad_fsp, buf, rforklen, rforkoff); -+ if (n != rforklen) { -+ DBG_ERR("Reading %zu bytes from rfork [%s] failed: %s\n", -+ rforklen, fsp_str_dbg(ad->ad_fsp), strerror(errno)); -+ return false; -+ } - -- rc = munmap(map, maplen); -- if (rc != 0) { -- DBG_ERR("munmap failed: %s\n", strerror(errno)); -+ rforkoff = ADEDOFF_RFORK_DOT_UND; -+ -+ n = SMB_VFS_PWRITE(ad->ad_fsp, buf, rforklen, rforkoff); -+ if (n != rforklen) { -+ DBG_ERR("Writing %zu bytes to rfork [%s] failed: %s\n", -+ rforklen, fsp_str_dbg(ad->ad_fsp), strerror(errno)); - return false; - } - - ad_setentryoff(ad, ADEID_RFORK, ADEDOFF_RFORK_DOT_UND); -- - ok = ad_pack(ad); - if (!ok) { - DBG_WARNING("ad_pack [%s] failed\n", smb_fname->base_name); - return false; - } - -- len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); -- if (len != AD_DATASZ_DOT_UND) { -- DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len); -+ ret = ad_fset(handle, ad, ad->ad_fsp); -+ if (ret != 0) { -+ DBG_ERR("ad_fset on [%s] failed\n", fsp_str_dbg(ad->ad_fsp)); - return false; - } - --- -2.21.0 - - -From 2a680e4998febc492d33c275268d0a1b06d40386 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 24 May 2019 11:54:51 +0200 -Subject: [PATCH 26/31] vfs_fruit: use fsp and remove mmap in - ad_convert_xattr() - -No need to mmap() anyway, the xattr data is already available in ad->ad_data. - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 4ff7ea0e0312c737aefd350f7b8fbed4c8602325) ---- - source3/modules/vfs_fruit.c | 29 +++++------------------------ - 1 file changed, 5 insertions(+), 24 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 426da55816b..630d53afbe7 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1061,10 +1061,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, - bool *converted_xattr) - { - static struct char_mappings **string_replace_cmaps = NULL; -- char *map = MAP_FAILED; -- size_t maplen; - uint16_t i; -- ssize_t len; - int saved_errno = 0; - NTSTATUS status; - int rc; -@@ -1088,17 +1085,6 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, - TALLOC_FREE(mappings); - } - -- maplen = ad_getentryoff(ad, ADEID_RFORK) + -- ad_getentrylen(ad, ADEID_RFORK); -- -- /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ -- map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, -- ad->ad_fsp->fh->fd, 0); -- if (map == MAP_FAILED) { -- DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); -- return false; -- } -- - for (i = 0; i < ad->adx_header.adx_num_attrs; i++) { - struct ad_xattr_entry *e = &ad->adx_entries[i]; - char *mapped_name = NULL; -@@ -1170,7 +1156,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, - } - - nwritten = SMB_VFS_PWRITE(fsp, -- map + e->adx_offset, -+ ad->ad_data + e->adx_offset, - e->adx_length, - 0); - if (nwritten == -1) { -@@ -1198,9 +1184,10 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, - goto fail; - } - -- len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); -- if (len != AD_DATASZ_DOT_UND) { -- DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len); -+ rc = ad_fset(handle, ad, ad->ad_fsp); -+ if (rc != 0) { -+ DBG_ERR("ad_fset on [%s] failed: %s\n", -+ fsp_str_dbg(ad->ad_fsp), strerror(errno)); - ok = false; - goto fail; - } -@@ -1214,12 +1201,6 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, - ok = true; - - fail: -- rc = munmap(map, maplen); -- if (rc != 0) { -- DBG_ERR("munmap failed: %s\n", strerror(errno)); -- return false; -- } -- - return ok; - } - --- -2.21.0 - - -From 945f0734c2f37c6327361dc638133f57e81910e5 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 24 May 2019 12:05:51 +0200 -Subject: [PATCH 27/31] vfs_fruit: add VFS handle to ad_convert_truncate() - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 4e44b1da9357120f0ad74e24c650bc6386085c47) ---- - source3/modules/vfs_fruit.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 630d53afbe7..46355d2146e 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1307,7 +1307,8 @@ static bool ad_convert_finderinfo(vfs_handle_struct *handle, - return true; - } - --static bool ad_convert_truncate(struct adouble *ad, -+static bool ad_convert_truncate(vfs_handle_struct *handle, -+ struct adouble *ad, - const struct smb_filename *smb_fname) - { - int rc; -@@ -1464,7 +1465,7 @@ static int ad_convert(struct vfs_handle_struct *handle, - } - - if (converted_xattr || blank) { -- ok = ad_convert_truncate(ad, smb_fname); -+ ok = ad_convert_truncate(handle, ad, smb_fname); - if (!ok) { - ret = -1; - goto done; --- -2.21.0 - - -From 1fca33d6436923925ceae855388f81bdd6ba9a53 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 24 May 2019 12:07:55 +0200 -Subject: [PATCH 28/31] vfs_fruit: use VFS function in ad_convert_truncate() - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 3739ad90cf2bbaa2094a34197c894363d2e24a5a) ---- - source3/modules/vfs_fruit.c | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 46355d2146e..a11f390326d 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1312,13 +1312,11 @@ static bool ad_convert_truncate(vfs_handle_struct *handle, - const struct smb_filename *smb_fname) - { - int rc; -+ off_t newlen; - -- /* -- * FIXME: direct ftruncate(), but we don't have a fsp for the -- * VFS call -- */ -- rc = ftruncate(ad->ad_fsp->fh->fd, ADEDOFF_RFORK_DOT_UND + -- ad_getentrylen(ad, ADEID_RFORK)); -+ newlen = ADEDOFF_RFORK_DOT_UND + ad_getentrylen(ad, ADEID_RFORK); -+ -+ rc = SMB_VFS_FTRUNCATE(ad->ad_fsp, newlen); - if (rc != 0) { - return false; - } --- -2.21.0 - - -From 7dd37035e053775d7b392ebaaf0130f9af7acc3a Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 24 May 2019 12:51:15 +0200 -Subject: [PATCH 29/31] vfs_fruit: use fsp and remove syscalls from - ad_convert_blank_rfork() - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 70c4a8f0ac307009c26e857523192c95b42a92f5) ---- - source3/modules/vfs_fruit.c | 36 ++++++++++++------------------------ - 1 file changed, 12 insertions(+), 24 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index a11f390326d..2d34b70090e 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1329,10 +1329,10 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle, - bool *blank) - { - struct fruit_config_data *config = NULL; -- uint8_t *map = MAP_FAILED; -- size_t maplen; -+ size_t rforklen = sizeof(empty_resourcefork); -+ char buf[rforklen]; -+ ssize_t nread; - int cmp; -- ssize_t len; - int rc; - bool ok; - -@@ -1345,43 +1345,31 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle, - return true; - } - -- if (ad_getentrylen(ad, ADEID_RFORK) != sizeof(empty_resourcefork)) { -+ if (ad_getentrylen(ad, ADEID_RFORK) != rforklen) { - return true; - } - -- maplen = ad_getentryoff(ad, ADEID_RFORK) + -- ad_getentrylen(ad, ADEID_RFORK); -- -- /* FIXME: direct use of mmap(), vfs_aio_fork does it too */ -- map = mmap(NULL, maplen, PROT_READ|PROT_WRITE, MAP_SHARED, -- ad->ad_fsp->fh->fd, 0); -- if (map == MAP_FAILED) { -- DBG_ERR("mmap AppleDouble: %s\n", strerror(errno)); -- return false; -- } -- -- cmp = memcmp(map + ADEDOFF_RFORK_DOT_UND, -- empty_resourcefork, -- sizeof(empty_resourcefork)); -- rc = munmap(map, maplen); -- if (rc != 0) { -- DBG_ERR("munmap failed: %s\n", strerror(errno)); -+ nread = SMB_VFS_PREAD(ad->ad_fsp, buf, rforklen, ADEDOFF_RFORK_DOT_UND); -+ if (nread != rforklen) { -+ DBG_ERR("Reading %zu bytes from rfork [%s] failed: %s\n", -+ rforklen, fsp_str_dbg(ad->ad_fsp), strerror(errno)); - return false; - } - -+ cmp = memcmp(buf, empty_resourcefork, rforklen); - if (cmp != 0) { - return true; - } - - ad_setentrylen(ad, ADEID_RFORK, 0); -- - ok = ad_pack(ad); - if (!ok) { - return false; - } - -- len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data, AD_DATASZ_DOT_UND, 0); -- if (len != AD_DATASZ_DOT_UND) { -+ rc = ad_fset(handle, ad, ad->ad_fsp); -+ if (rc != 0) { -+ DBG_ERR("ad_fset on [%s] failed\n", fsp_str_dbg(ad->ad_fsp)); - return false; - } - --- -2.21.0 - - -From 602ba28322bd343a47c811f2d9e441a7886a2664 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 24 May 2019 14:51:17 +0200 -Subject: [PATCH 30/31] vfs_fruit: use VFS functions in ad_read_rsrc_adouble() - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison -(cherry picked from commit 9fe84a6345bf5d9fdb1df87a853db3380e6fb0f7) ---- - source3/modules/vfs_fruit.c | 13 ++++++------- - 1 file changed, 6 insertions(+), 7 deletions(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 2d34b70090e..38c201b38e0 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -1665,16 +1665,16 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, - struct adouble *ad, - const struct smb_filename *smb_fname) - { -- SMB_STRUCT_STAT sbuf; - char *p_ad = NULL; - size_t size; - ssize_t len; - int ret; - bool ok; - -- ret = sys_fstat(ad->ad_fsp->fh->fd, &sbuf, lp_fake_directory_create_times( -- SNUM(handle->conn))); -+ ret = SMB_VFS_NEXT_FSTAT(handle, ad->ad_fsp, &ad->ad_fsp->fsp_name->st); - if (ret != 0) { -+ DBG_ERR("fstat [%s] failed: %s\n", -+ fsp_str_dbg(ad->ad_fsp), strerror(errno)); - return -1; - } - -@@ -1686,7 +1686,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, - * - * Read as much as we can up to AD_XATTR_MAX_HDR_SIZE. - */ -- size = sbuf.st_ex_size; -+ size = ad->ad_fsp->fsp_name->st.st_ex_size; - if (size > talloc_array_length(ad->ad_data)) { - if (size > AD_XATTR_MAX_HDR_SIZE) { - size = AD_XATTR_MAX_HDR_SIZE; -@@ -1698,8 +1698,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, - ad->ad_data = p_ad; - } - -- len = sys_pread(ad->ad_fsp->fh->fd, ad->ad_data, -- talloc_array_length(ad->ad_data), 0); -+ len = SMB_VFS_NEXT_PREAD(handle, ad->ad_fsp, ad->ad_data, talloc_array_length(ad->ad_data), 0); - if (len != talloc_array_length(ad->ad_data)) { - DBG_NOTICE("%s %s: bad size: %zd\n", - smb_fname->base_name, strerror(errno), len); -@@ -1707,7 +1706,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle, - } - - /* Now parse entries */ -- ok = ad_unpack(ad, ADEID_NUM_DOT_UND, sbuf.st_ex_size); -+ ok = ad_unpack(ad, ADEID_NUM_DOT_UND, size); - if (!ok) { - DBG_ERR("invalid AppleDouble resource %s\n", - smb_fname->base_name); --- -2.21.0 - - -From 3f5303416f9189c5e81444e65aac98f2444183b1 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Fri, 24 May 2019 15:15:59 +0200 -Subject: [PATCH 31/31] vfs_fruit: remove a now unnecessary include - -Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968 - -Signed-off-by: Ralph Boehme -Reviewed-by: Jeremy Allison - -Autobuild-User(master): Jeremy Allison -Autobuild-Date(master): Thu May 30 22:12:50 UTC 2019 on sn-devel-184 - -(cherry picked from commit 9a2c9834cb1b77547b8b932c35870301afb9fc25) ---- - source3/modules/vfs_fruit.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c -index 38c201b38e0..20121818129 100644 ---- a/source3/modules/vfs_fruit.c -+++ b/source3/modules/vfs_fruit.c -@@ -29,7 +29,6 @@ - #include "messages.h" - #include "libcli/security/security.h" - #include "../libcli/smb/smb2_create_ctx.h" --#include "lib/util/sys_rw.h" - #include "lib/util/tevent_ntstatus.h" - #include "lib/util/tevent_unix.h" - #include "offload_token.h" --- -2.21.0 - diff --git a/samba-4.10.6-vfs_glusterfs.patch b/samba-4.10.6-vfs_glusterfs.patch deleted file mode 100644 index 3ac0b2f..0000000 --- a/samba-4.10.6-vfs_glusterfs.patch +++ /dev/null @@ -1,276 +0,0 @@ -From 1ea533bd5f7f6febeeb1a4261f2afbb19081e8eb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?G=C3=BCnther=20Deschner?= -Date: Mon, 3 Jun 2019 14:27:18 +0200 -Subject: [PATCH 1/4] Revert "s3/vfs_glusterfs: Dynamically determine NAME_MAX" - -This reverts commit 8e3a042eb9e502821b147f1bbb2d98d59f17a095. - -Signed-off-by: Guenther Deschner -Reviewed-by: Volker Lendecke ---- - source3/modules/vfs_glusterfs.c | 37 +++++++-------------------------- - 1 file changed, 8 insertions(+), 29 deletions(-) - -diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c -index 2b5385e44b0..ba8973fa6d3 100644 ---- a/source3/modules/vfs_glusterfs.c -+++ b/source3/modules/vfs_glusterfs.c -@@ -1454,36 +1454,20 @@ static int vfs_gluster_chflags(struct vfs_handle_struct *handle, - - static int vfs_gluster_get_real_filename(struct vfs_handle_struct *handle, - const char *path, const char *name, -- TALLOC_CTX *mem_ctx, char **_found_name) -+ TALLOC_CTX *mem_ctx, char **found_name) - { - int ret; -- char *key_buf = NULL, *val_buf = NULL; -- long name_max; -- char *found_name = NULL; -+ char key_buf[NAME_MAX + 64]; -+ char val_buf[NAME_MAX + 1]; - -- name_max = pathconf(path, _PC_NAME_MAX); -- if ((name_max + 1) < 1) { -- errno = EINVAL; -- return -1; -- } -- -- if (strlen(name) >= name_max) { -+ if (strlen(name) >= NAME_MAX) { - errno = ENAMETOOLONG; - return -1; - } - -- key_buf = talloc_asprintf(mem_ctx, "glusterfs.get_real_filename:%s", -- name); -- if (key_buf == NULL) { -- errno = ENOMEM; -- return -1; -- } -+ snprintf(key_buf, NAME_MAX + 64, -+ "glusterfs.get_real_filename:%s", name); - -- val_buf = talloc_zero_array(mem_ctx, char, name_max + 1); -- if (val_buf == NULL) { -- errno = ENOMEM; -- return -1; -- } - ret = glfs_getxattr(handle->data, path, key_buf, val_buf, NAME_MAX + 1); - if (ret == -1) { - if (errno == ENOATTR) { -@@ -1492,16 +1476,11 @@ static int vfs_gluster_get_real_filename(struct vfs_handle_struct *handle, - return -1; - } - -- found_name = talloc_strdup(mem_ctx, val_buf); -- if (found_name == NULL) { -+ *found_name = talloc_strdup(mem_ctx, val_buf); -+ if (found_name[0] == NULL) { - errno = ENOMEM; - return -1; - } -- *_found_name = found_name; -- -- TALLOC_FREE(key_buf); -- TALLOC_FREE(val_buf); -- - return 0; - } - --- -2.21.0 - - -From 01a569bec073ce45f412884d340ecfc50ce41fbe Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?G=C3=BCnther=20Deschner?= -Date: Mon, 3 Jun 2019 14:27:44 +0200 -Subject: [PATCH 2/4] Revert "s3/vfs_glusterfs_fuse: Dynamically determine - NAME_MAX" - -This reverts commit e28d172b00cadf492c22bd892e2dda3bf2fe2d70. - -Signed-off-by: Guenther Deschner -Reviewed-by: Volker Lendecke ---- - source3/modules/vfs_glusterfs_fuse.c | 32 ++++++---------------------- - 1 file changed, 6 insertions(+), 26 deletions(-) - -diff --git a/source3/modules/vfs_glusterfs_fuse.c b/source3/modules/vfs_glusterfs_fuse.c -index 0b1de9fcdb2..8855cd18d01 100644 ---- a/source3/modules/vfs_glusterfs_fuse.c -+++ b/source3/modules/vfs_glusterfs_fuse.c -@@ -28,35 +28,19 @@ static int vfs_gluster_fuse_get_real_filename(struct vfs_handle_struct *handle, - char **_found_name) - { - int ret; -- char *key_buf = NULL, *val_buf = NULL; -- long name_max; -+ char key_buf[NAME_MAX + 64]; -+ char val_buf[NAME_MAX + 1]; - char *found_name = NULL; - -- name_max = pathconf(path, _PC_NAME_MAX); -- if ((name_max + 1) < 1) { -- errno = EINVAL; -- return -1; -- } -- -- if (strlen(name) >= name_max) { -+ if (strlen(name) >= NAME_MAX) { - errno = ENAMETOOLONG; - return -1; - } - -- key_buf = talloc_asprintf(mem_ctx, "glusterfs.get_real_filename:%s", -- name); -- if (key_buf == NULL) { -- errno = ENOMEM; -- return -1; -- } -- -- val_buf = talloc_zero_array(mem_ctx, char, name_max + 1); -- if (val_buf == NULL) { -- errno = ENOMEM; -- return -1; -- } -+ snprintf(key_buf, NAME_MAX + 64, -+ "glusterfs.get_real_filename:%s", name); - -- ret = getxattr(path, key_buf, val_buf, name_max + 1); -+ ret = getxattr(path, key_buf, val_buf, NAME_MAX + 1); - if (ret == -1) { - if (errno == ENOATTR) { - errno = EOPNOTSUPP; -@@ -70,10 +54,6 @@ static int vfs_gluster_fuse_get_real_filename(struct vfs_handle_struct *handle, - return -1; - } - *_found_name = found_name; -- -- TALLOC_FREE(key_buf); -- TALLOC_FREE(val_buf); -- - return 0; - } - --- -2.21.0 - - -From e85bb58532fe82daac6e50e88d08bbab66cb1019 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?G=C3=BCnther=20Deschner?= -Date: Mon, 3 Jun 2019 16:25:46 +0200 -Subject: [PATCH 3/4] s3/vfs_glusterfs: Avoid using NAME_MAX directly - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13872 - -Guenther - -Signed-off-by: Guenther Deschner -Reviewed-by: Volker Lendecke ---- - source3/modules/vfs_glusterfs.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c -index ba8973fa6d3..a9415952b4e 100644 ---- a/source3/modules/vfs_glusterfs.c -+++ b/source3/modules/vfs_glusterfs.c -@@ -47,6 +47,7 @@ - #include "modules/posixacl_xattr.h" - - #define DEFAULT_VOLFILE_SERVER "localhost" -+#define GLUSTER_NAME_MAX 255 - - static int read_fd = -1; - static int write_fd = -1; -@@ -1457,18 +1458,19 @@ static int vfs_gluster_get_real_filename(struct vfs_handle_struct *handle, - TALLOC_CTX *mem_ctx, char **found_name) - { - int ret; -- char key_buf[NAME_MAX + 64]; -- char val_buf[NAME_MAX + 1]; -+ char key_buf[GLUSTER_NAME_MAX + 64]; -+ char val_buf[GLUSTER_NAME_MAX + 1]; - -- if (strlen(name) >= NAME_MAX) { -+ if (strlen(name) >= GLUSTER_NAME_MAX) { - errno = ENAMETOOLONG; - return -1; - } - -- snprintf(key_buf, NAME_MAX + 64, -+ snprintf(key_buf, GLUSTER_NAME_MAX + 64, - "glusterfs.get_real_filename:%s", name); - -- ret = glfs_getxattr(handle->data, path, key_buf, val_buf, NAME_MAX + 1); -+ ret = glfs_getxattr(handle->data, path, key_buf, val_buf, -+ GLUSTER_NAME_MAX + 1); - if (ret == -1) { - if (errno == ENOATTR) { - errno = EOPNOTSUPP; --- -2.21.0 - - -From 7cc9e3fe24dd476360837c04538345752048e6be Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?G=C3=BCnther=20Deschner?= -Date: Mon, 3 Jun 2019 16:28:36 +0200 -Subject: [PATCH 4/4] s3/vfs_glusterfs_fuse: Avoid using NAME_MAX directly -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13872 - -Guenther - -Signed-off-by: Guenther Deschner -Reviewed-by: Volker Lendecke - -Autobuild-User(master): Günther Deschner -Autobuild-Date(master): Tue Jun 11 00:29:19 UTC 2019 on sn-devel-184 ---- - source3/modules/vfs_glusterfs_fuse.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/source3/modules/vfs_glusterfs_fuse.c b/source3/modules/vfs_glusterfs_fuse.c -index 8855cd18d01..d92f5e2b08b 100644 ---- a/source3/modules/vfs_glusterfs_fuse.c -+++ b/source3/modules/vfs_glusterfs_fuse.c -@@ -21,6 +21,8 @@ - #include "smbd/smbd.h" - #include "system/filesys.h" - -+#define GLUSTER_NAME_MAX 255 -+ - static int vfs_gluster_fuse_get_real_filename(struct vfs_handle_struct *handle, - const char *path, - const char *name, -@@ -28,19 +30,19 @@ static int vfs_gluster_fuse_get_real_filename(struct vfs_handle_struct *handle, - char **_found_name) - { - int ret; -- char key_buf[NAME_MAX + 64]; -- char val_buf[NAME_MAX + 1]; -+ char key_buf[GLUSTER_NAME_MAX + 64]; -+ char val_buf[GLUSTER_NAME_MAX + 1]; - char *found_name = NULL; - -- if (strlen(name) >= NAME_MAX) { -+ if (strlen(name) >= GLUSTER_NAME_MAX) { - errno = ENAMETOOLONG; - return -1; - } - -- snprintf(key_buf, NAME_MAX + 64, -+ snprintf(key_buf, GLUSTER_NAME_MAX + 64, - "glusterfs.get_real_filename:%s", name); - -- ret = getxattr(path, key_buf, val_buf, NAME_MAX + 1); -+ ret = getxattr(path, key_buf, val_buf, GLUSTER_NAME_MAX + 1); - if (ret == -1) { - if (errno == ENOATTR) { - errno = EOPNOTSUPP; --- -2.21.0 - diff --git a/samba-4.10.x-waf_timer.patch b/samba-4.10.x-waf_timer.patch deleted file mode 100644 index 05cf52c..0000000 --- a/samba-4.10.x-waf_timer.patch +++ /dev/null @@ -1,115 +0,0 @@ -From bb253743e7e757c3ee063b12f79689f4f8355a71 Mon Sep 17 00:00:00 2001 -From: Lukas Slebodnik -Date: Wed, 12 Jun 2019 12:27:04 +0200 -Subject: [PATCH] wafsamba: Use native waf timer - - __main__:1: DeprecationWarning: time.clock has been deprecated in Python 3.3 - and will be removed from Python 3.8: use time.perf_counter - or time.process_time instead - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13998 - -Signed-off-by: Lukas Slebodnik -Reviewed-by: Andreas Schneider -Reviewed-by: Alexander Bokovoy -(cherry picked from commit 8f082904ce580f1a6b8a06ebcc323c99e892bd1f) ---- - buildtools/wafsamba/samba_deps.py | 25 ++++++++++++------------- - 1 file changed, 12 insertions(+), 13 deletions(-) - -diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py -index f8c38809bd2..03c37079a8c 100644 ---- a/buildtools/wafsamba/samba_deps.py -+++ b/buildtools/wafsamba/samba_deps.py -@@ -1,6 +1,6 @@ - # Samba automatic dependency handling and project rules - --import os, sys, re, time -+import os, sys, re - - from waflib import Build, Options, Logs, Utils, Errors - from waflib.Logs import debug -@@ -1102,8 +1102,7 @@ def check_project_rules(bld): - if not force_project_rules and load_samba_deps(bld, tgt_list): - return - -- global tstart -- tstart = time.clock() -+ timer = Utils.Timer() - - bld.new_rules = True - Logs.info("Checking project rules ...") -@@ -1112,26 +1111,26 @@ def check_project_rules(bld): - - expand_subsystem_deps(bld) - -- debug("deps: expand_subsystem_deps: %f" % (time.clock() - tstart)) -+ debug("deps: expand_subsystem_deps: %s" % str(timer)) - - replace_grouping_libraries(bld, tgt_list) - -- debug("deps: replace_grouping_libraries: %f" % (time.clock() - tstart)) -+ debug("deps: replace_grouping_libraries: %s" % str(timer)) - - build_direct_deps(bld, tgt_list) - -- debug("deps: build_direct_deps: %f" % (time.clock() - tstart)) -+ debug("deps: build_direct_deps: %s" % str(timer)) - - break_dependency_loops(bld, tgt_list) - -- debug("deps: break_dependency_loops: %f" % (time.clock() - tstart)) -+ debug("deps: break_dependency_loops: %s" % str(timer)) - - if Options.options.SHOWDEPS: - show_dependencies(bld, Options.options.SHOWDEPS, set()) - - calculate_final_deps(bld, tgt_list, loops) - -- debug("deps: calculate_final_deps: %f" % (time.clock() - tstart)) -+ debug("deps: calculate_final_deps: %s" % str(timer)) - - if Options.options.SHOW_DUPLICATES: - show_object_duplicates(bld, tgt_list) -@@ -1140,7 +1139,7 @@ def check_project_rules(bld): - for f in [ build_dependencies, build_includes, add_init_functions ]: - debug('deps: project rules checking %s', f) - for t in tgt_list: f(t) -- debug("deps: %s: %f" % (f, time.clock() - tstart)) -+ debug("deps: %s: %s" % (f, str(timer))) - - debug('deps: project rules stage1 completed') - -@@ -1148,17 +1147,17 @@ def check_project_rules(bld): - Logs.error("Duplicate sources present - aborting") - sys.exit(1) - -- debug("deps: check_duplicate_sources: %f" % (time.clock() - tstart)) -+ debug("deps: check_duplicate_sources: %s" % str(timer)) - - if not bld.check_group_ordering(tgt_list): - Logs.error("Bad group ordering - aborting") - sys.exit(1) - -- debug("deps: check_group_ordering: %f" % (time.clock() - tstart)) -+ debug("deps: check_group_ordering: %s" % str(timer)) - - show_final_deps(bld, tgt_list) - -- debug("deps: show_final_deps: %f" % (time.clock() - tstart)) -+ debug("deps: show_final_deps: %s" % str(timer)) - - debug('deps: project rules checking completed - %u targets checked', - len(tgt_list)) -@@ -1166,7 +1165,7 @@ def check_project_rules(bld): - if not bld.is_install: - save_samba_deps(bld, tgt_list) - -- debug("deps: save_samba_deps: %f" % (time.clock() - tstart)) -+ debug("deps: save_samba_deps: %s" % str(timer)) - - Logs.info("Project rules pass") - --- -2.21.0 - diff --git a/samba.spec b/samba.spec index 44efa8b..9c8d728 100644 --- a/samba.spec +++ b/samba.spec @@ -6,13 +6,13 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 2 +%define main_release 0 -%define samba_version 4.10.5 +%define samba_version 4.10.6 %define talloc_version 2.1.16 %define tdb_version 1.3.18 %define tevent_version 0.9.39 -%define ldb_version 1.5.4 +%define ldb_version 1.5.5 # This should be rc1 or nil %define pre_release %nil @@ -118,11 +118,7 @@ Source14: samba.pamd Source201: README.downgrade -Patch0: samba-4.10.6-vfs_fruit.patch -Patch1: samba-4.10.6-vfs_glusterfs.patch -Patch2: samba-4.10.6-smbspool.patch -Patch3: samba-4.10.x-waf_update.patch -Patch4: samba-4.10.x-waf_timer.patch +Patch0: samba-4.10.x-waf_update.patch Requires(pre): /usr/sbin/groupadd Requires(post): systemd @@ -3441,6 +3437,9 @@ fi %endif # with_clustering_support %changelog +* Mon Jul 08 2019 Guenther Deschner - 4.10.6-0 +- Update to Samba 4.10.6 + * Mon Jul 01 2019 Guenther Deschner - 4.10.5-2 - resolves: #1718113 - Avoid deprecated time.clock in wafsamba - resolves: #1711638 - Update to latest waf version 2.0.17 diff --git a/sources b/sources index 9957499..d8fd22b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.5.tar.xz) = 87aceccb5ff1ca3ce62b05aaf3827671a639693832faf56aee200b11ca6b1124e67f5880e4f1e73185278c5369225aad0cf3d3ef889f12fa690e73d2accfb410 -SHA512 (samba-4.10.5.tar.asc) = 599b1a2e19cd4362aeb3dfecba3523e9f3e18645b6e169516ea6825c81fdc7c7480e11235f977e1282cc769d0434a85ba567791ae9b1ad9b515b26277c87bc67 +SHA512 (samba-4.10.6.tar.xz) = 1189e25271d3f708efebe99e840028dd82f82de458771bf9e8373c6b21643e3968165963b4a9efb5eac356734a4b4c7857f6fb2a077f3c8ca463ebae5a889cfc +SHA512 (samba-4.10.6.tar.asc) = 21dc113313d98185ee97be1c59e791862d55dcd509b82f98d8fb5f2123b09c7be7265305734b0b17fb95aca729c1b7df48751cb6d6b645dbfbf092e174e07cbc From 30c73397584c0802f929fb8e7f2dd21f8f199397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Sat, 13 Jul 2019 19:14:15 +0200 Subject: [PATCH 65/76] Add missing samba tests in filelist Guenther --- samba.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samba.spec b/samba.spec index 9c8d728..f6406f5 100644 --- a/samba.spec +++ b/samba.spec @@ -2205,6 +2205,7 @@ fi %{python3_sitearch}/samba/tests/__pycache__/hostconfig.*.pyc %{python3_sitearch}/samba/tests/__pycache__/join.*.pyc %{python3_sitearch}/samba/tests/__pycache__/krb5_credentials.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/ldap_referrals.*.pyc %{python3_sitearch}/samba/tests/__pycache__/loadparm.*.pyc %{python3_sitearch}/samba/tests/__pycache__/libsmb.*.pyc %{python3_sitearch}/samba/tests/__pycache__/lsa_string.*.pyc @@ -2380,6 +2381,7 @@ fi %{python3_sitearch}/samba/tests/kcc/kcc_utils.py %{python3_sitearch}/samba/tests/kcc/ldif_import_export.py %{python3_sitearch}/samba/tests/krb5_credentials.py +%{python3_sitearch}/samba/tests/ldap_referrals.py %{python3_sitearch}/samba/tests/libsmb.py %{python3_sitearch}/samba/tests/loadparm.py %{python3_sitearch}/samba/tests/lsa_string.py From 83f40a53eba48d75f842fae4247b6effdc75bb83 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 26 Jul 2019 22:38:48 +0000 Subject: [PATCH 66/76] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- samba.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index f6406f5..3d59872 100644 --- a/samba.spec +++ b/samba.spec @@ -86,7 +86,7 @@ Name: samba Version: %{samba_version} -Release: %{samba_release}.1 +Release: %{samba_release}.2 %if 0%{?rhel} Epoch: 0 @@ -3439,6 +3439,9 @@ fi %endif # with_clustering_support %changelog +* Fri Jul 26 2019 Fedora Release Engineering - 2:4.10.6-0.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Mon Jul 08 2019 Guenther Deschner - 4.10.6-0 - Update to Samba 4.10.6 From d819c93793dc07535743c4e1b5393a5ac7167263 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Fri, 16 Aug 2019 11:15:00 +0300 Subject: [PATCH 67/76] Allow Windows to resolve IPA users and groups over LSA RPC Fixes: https://bugzilla.samba.org/show_bug.cgi?id=14091 (cherry picked from commit e9d6c3ff337143c3c8289d9ccaed7351e28529dd) --- samba-bz14091-v4.10-backport.patch | 650 +++++++++++++++++++++++++++++ samba.spec | 9 +- 2 files changed, 657 insertions(+), 2 deletions(-) create mode 100644 samba-bz14091-v4.10-backport.patch diff --git a/samba-bz14091-v4.10-backport.patch b/samba-bz14091-v4.10-backport.patch new file mode 100644 index 0000000..104e78e --- /dev/null +++ b/samba-bz14091-v4.10-backport.patch @@ -0,0 +1,650 @@ +From 536df2c1070d516ab95ad96b606fcc1f92c3668d Mon Sep 17 00:00:00 2001 +From: Alexander Bokovoy +Date: Thu, 1 Aug 2019 21:08:52 +0300 +Subject: [PATCH 1/3] torture/rpc/lsa: allow testing different lookup levels + +Convert torture/rpc/lsa LookupNames/LookupSids code to allow testing +different LSA_LOOKUP_NAMES_* levels. Keep existing level 1 +(LSA_LOOKUP_NAMES_ALL) for the current set of tests. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14091 + +Signed-off-by: Alexander Bokovoy +Reviewed-by: Andreas Schneider + +(cherry picked from commit 317bc6a7342edfa2c503f5932142bf5883485cc9) +--- + source4/torture/rpc/lsa.c | 118 ++++++++++++++++++--------------- + source4/torture/rpc/schannel.c | 2 +- + 2 files changed, 67 insertions(+), 53 deletions(-) + +diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c +index bc1e9553039..b7dd0dc8c91 100644 +--- a/source4/torture/rpc/lsa.c ++++ b/source4/torture/rpc/lsa.c +@@ -270,6 +270,7 @@ static bool test_OpenPolicy2_fail(struct dcerpc_binding_handle *b, + static bool test_LookupNames(struct dcerpc_binding_handle *b, + struct torture_context *tctx, + struct policy_handle *handle, ++ enum lsa_LookupNamesLevel level, + struct lsa_TransNameArray *tnames) + { + struct lsa_LookupNames r; +@@ -302,7 +303,7 @@ static bool test_LookupNames(struct dcerpc_binding_handle *b, + r.in.handle = handle; + r.in.names = names; + r.in.sids = &sids; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.out.count = &count; + r.out.sids = &sids; +@@ -358,7 +359,8 @@ static bool test_LookupNames(struct dcerpc_binding_handle *b, + + static bool test_LookupNames_bogus(struct dcerpc_binding_handle *b, + struct torture_context *tctx, +- struct policy_handle *handle) ++ struct policy_handle *handle, ++ enum lsa_LookupNamesLevel level) + { + struct lsa_LookupNames r; + struct lsa_TransSidArray sids; +@@ -377,7 +379,7 @@ static bool test_LookupNames_bogus(struct dcerpc_binding_handle *b, + r.in.num_names = 1; + r.in.names = names; + r.in.sids = &sids; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.out.count = &count; + r.out.sids = &sids; +@@ -398,7 +400,8 @@ static bool test_LookupNames_bogus(struct dcerpc_binding_handle *b, + + static bool test_LookupNames_NULL(struct dcerpc_binding_handle *b, + struct torture_context *tctx, +- struct policy_handle *handle) ++ struct policy_handle *handle, ++ enum lsa_LookupNamesLevel level) + { + struct lsa_LookupNames r; + struct lsa_TransSidArray sids; +@@ -417,7 +420,7 @@ static bool test_LookupNames_NULL(struct dcerpc_binding_handle *b, + r.in.num_names = 1; + r.in.names = names; + r.in.sids = &sids; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.out.count = &count; + r.out.sids = &sids; +@@ -442,7 +445,8 @@ static bool test_LookupNames_NULL(struct dcerpc_binding_handle *b, + + static bool test_LookupNames_wellknown(struct dcerpc_binding_handle *b, + struct torture_context *tctx, +- struct policy_handle *handle) ++ struct policy_handle *handle, ++ enum lsa_LookupNamesLevel level) + { + struct lsa_TranslatedName name; + struct lsa_TransNameArray tnames; +@@ -454,45 +458,46 @@ static bool test_LookupNames_wellknown(struct dcerpc_binding_handle *b, + tnames.count = 1; + name.name.string = "NT AUTHORITY\\SYSTEM"; + name.sid_type = SID_NAME_WKN_GRP; +- ret &= test_LookupNames(b, tctx, handle, &tnames); ++ ret &= test_LookupNames(b, tctx, handle, level, &tnames); + + name.name.string = "NT AUTHORITY\\ANONYMOUS LOGON"; + name.sid_type = SID_NAME_WKN_GRP; +- ret &= test_LookupNames(b, tctx, handle, &tnames); ++ ret &= test_LookupNames(b, tctx, handle, level, &tnames); + + name.name.string = "NT AUTHORITY\\Authenticated Users"; + name.sid_type = SID_NAME_WKN_GRP; +- ret &= test_LookupNames(b, tctx, handle, &tnames); ++ ret &= test_LookupNames(b, tctx, handle, level, &tnames); + + #if 0 + name.name.string = "NT AUTHORITY"; +- ret &= test_LookupNames(b, tctx, handle, &tnames); ++ ret &= test_LookupNames(b, tctx, handle, level, &tnames); + + name.name.string = "NT AUTHORITY\\"; +- ret &= test_LookupNames(b, tctx, handle, &tnames); ++ ret &= test_LookupNames(b, tctx, handle, level, &tnames); + #endif + + name.name.string = "BUILTIN\\"; + name.sid_type = SID_NAME_DOMAIN; +- ret &= test_LookupNames(b, tctx, handle, &tnames); ++ ret &= test_LookupNames(b, tctx, handle, level, &tnames); + + name.name.string = "BUILTIN\\Administrators"; + name.sid_type = SID_NAME_ALIAS; +- ret &= test_LookupNames(b, tctx, handle, &tnames); ++ ret &= test_LookupNames(b, tctx, handle, level, &tnames); + + name.name.string = "SYSTEM"; + name.sid_type = SID_NAME_WKN_GRP; +- ret &= test_LookupNames(b, tctx, handle, &tnames); ++ ret &= test_LookupNames(b, tctx, handle, level, &tnames); + + name.name.string = "Everyone"; + name.sid_type = SID_NAME_WKN_GRP; +- ret &= test_LookupNames(b, tctx, handle, &tnames); ++ ret &= test_LookupNames(b, tctx, handle, level, &tnames); + return ret; + } + + static bool test_LookupNames2(struct dcerpc_binding_handle *b, + struct torture_context *tctx, + struct policy_handle *handle, ++ enum lsa_LookupNamesLevel level, + struct lsa_TransNameArray2 *tnames, + bool check_result) + { +@@ -525,7 +530,7 @@ static bool test_LookupNames2(struct dcerpc_binding_handle *b, + r.in.handle = handle; + r.in.names = names; + r.in.sids = &sids; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.in.lookup_options = 0; + r.in.client_revision = 0; +@@ -554,6 +559,7 @@ static bool test_LookupNames2(struct dcerpc_binding_handle *b, + static bool test_LookupNames3(struct dcerpc_binding_handle *b, + struct torture_context *tctx, + struct policy_handle *handle, ++ enum lsa_LookupNamesLevel level, + struct lsa_TransNameArray2 *tnames, + bool check_result) + { +@@ -585,7 +591,7 @@ static bool test_LookupNames3(struct dcerpc_binding_handle *b, + r.in.handle = handle; + r.in.names = names; + r.in.sids = &sids; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.in.lookup_options = 0; + r.in.client_revision = 0; +@@ -613,6 +619,7 @@ static bool test_LookupNames3(struct dcerpc_binding_handle *b, + + static bool test_LookupNames4(struct dcerpc_binding_handle *b, + struct torture_context *tctx, ++ enum lsa_LookupNamesLevel level, + struct lsa_TransNameArray2 *tnames, + bool check_result) + { +@@ -644,7 +651,7 @@ static bool test_LookupNames4(struct dcerpc_binding_handle *b, + r.in.num_names = tnames->count; + r.in.names = names; + r.in.sids = &sids; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.in.lookup_options = 0; + r.in.client_revision = 0; +@@ -682,7 +689,8 @@ static bool test_LookupNames4(struct dcerpc_binding_handle *b, + } + + static bool test_LookupNames4_fail(struct dcerpc_binding_handle *b, +- struct torture_context *tctx) ++ struct torture_context *tctx, ++ enum lsa_LookupNamesLevel level) + { + struct lsa_LookupNames4 r; + struct lsa_TransSidArray3 sids; +@@ -701,7 +709,7 @@ static bool test_LookupNames4_fail(struct dcerpc_binding_handle *b, + r.in.num_names = count; + r.in.names = names; + r.in.sids = &sids; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.in.lookup_options = 0; + r.in.client_revision = 0; +@@ -749,6 +757,7 @@ static bool test_LookupNames4_fail(struct dcerpc_binding_handle *b, + static bool test_LookupSids(struct dcerpc_binding_handle *b, + struct torture_context *tctx, + struct policy_handle *handle, ++ enum lsa_LookupNamesLevel level, + struct lsa_SidArray *sids) + { + struct lsa_LookupSids r; +@@ -764,7 +773,7 @@ static bool test_LookupSids(struct dcerpc_binding_handle *b, + r.in.handle = handle; + r.in.sids = sids; + r.in.names = &names; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.out.count = &count; + r.out.names = &names; +@@ -779,7 +788,7 @@ static bool test_LookupSids(struct dcerpc_binding_handle *b, + + torture_comment(tctx, "\n"); + +- if (!test_LookupNames(b, tctx, handle, &names)) { ++ if (!test_LookupNames(b, tctx, handle, level, &names)) { + return false; + } + +@@ -790,6 +799,7 @@ static bool test_LookupSids(struct dcerpc_binding_handle *b, + static bool test_LookupSids2(struct dcerpc_binding_handle *b, + struct torture_context *tctx, + struct policy_handle *handle, ++ enum lsa_LookupNamesLevel level, + struct lsa_SidArray *sids) + { + struct lsa_LookupSids2 r; +@@ -805,7 +815,7 @@ static bool test_LookupSids2(struct dcerpc_binding_handle *b, + r.in.handle = handle; + r.in.sids = sids; + r.in.names = &names; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.in.lookup_options = 0; + r.in.client_revision = 0; +@@ -824,11 +834,11 @@ static bool test_LookupSids2(struct dcerpc_binding_handle *b, + + torture_comment(tctx, "\n"); + +- if (!test_LookupNames2(b, tctx, handle, &names, false)) { ++ if (!test_LookupNames2(b, tctx, handle, level, &names, false)) { + return false; + } + +- if (!test_LookupNames3(b, tctx, handle, &names, false)) { ++ if (!test_LookupNames3(b, tctx, handle, level, &names, false)) { + return false; + } + +@@ -837,6 +847,7 @@ static bool test_LookupSids2(struct dcerpc_binding_handle *b, + + static bool test_LookupSids3(struct dcerpc_binding_handle *b, + struct torture_context *tctx, ++ enum lsa_LookupNamesLevel level, + struct lsa_SidArray *sids) + { + struct lsa_LookupSids3 r; +@@ -851,7 +862,7 @@ static bool test_LookupSids3(struct dcerpc_binding_handle *b, + + r.in.sids = sids; + r.in.names = &names; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.in.lookup_options = 0; + r.in.client_revision = 0; +@@ -880,7 +891,7 @@ static bool test_LookupSids3(struct dcerpc_binding_handle *b, + + torture_comment(tctx, "\n"); + +- if (!test_LookupNames4(b, tctx, &names, true)) { ++ if (!test_LookupNames4(b, tctx, level, &names, true)) { + return false; + } + +@@ -889,6 +900,7 @@ static bool test_LookupSids3(struct dcerpc_binding_handle *b, + + static bool test_LookupSids3_fail(struct dcerpc_binding_handle *b, + struct torture_context *tctx, ++ enum lsa_LookupNamesLevel level, + struct lsa_SidArray *sids) + { + struct lsa_LookupSids3 r; +@@ -904,7 +916,7 @@ static bool test_LookupSids3_fail(struct dcerpc_binding_handle *b, + + r.in.sids = sids; + r.in.names = &names; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &count; + r.in.lookup_options = 0; + r.in.client_revision = 0; +@@ -948,7 +960,8 @@ static bool test_LookupSids3_fail(struct dcerpc_binding_handle *b, + + bool test_many_LookupSids(struct dcerpc_pipe *p, + struct torture_context *tctx, +- struct policy_handle *handle) ++ struct policy_handle *handle, ++ enum lsa_LookupNamesLevel level) + { + uint32_t count; + struct lsa_SidArray sids; +@@ -979,7 +992,7 @@ bool test_many_LookupSids(struct dcerpc_pipe *p, + r.in.handle = handle; + r.in.sids = &sids; + r.in.names = &names; +- r.in.level = 1; ++ r.in.level = level; + r.in.count = &names.count; + r.out.count = &count; + r.out.names = &names; +@@ -995,16 +1008,16 @@ bool test_many_LookupSids(struct dcerpc_pipe *p, + + torture_comment(tctx, "\n"); + +- if (!test_LookupNames(b, tctx, handle, &names)) { ++ if (!test_LookupNames(b, tctx, handle, level, &names)) { + return false; + } + } + + if (transport == NCACN_NP) { +- if (!test_LookupSids3_fail(b, tctx, &sids)) { ++ if (!test_LookupSids3_fail(b, tctx, level, &sids)) { + return false; + } +- if (!test_LookupNames4_fail(b, tctx)) { ++ if (!test_LookupNames4_fail(b, tctx, level)) { + return false; + } + } else if (transport == NCACN_IP_TCP) { +@@ -1020,10 +1033,10 @@ bool test_many_LookupSids(struct dcerpc_pipe *p, + + if (auth_type == DCERPC_AUTH_TYPE_SCHANNEL && + auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY) { +- if (!test_LookupSids3(b, tctx, &sids)) { ++ if (!test_LookupSids3(b, tctx, level, &sids)) { + return false; + } +- if (!test_LookupNames4(b, tctx, &names, true)) { ++ if (!test_LookupNames4(b, tctx, level, &names, true)) { + return false; + } + } else { +@@ -1031,10 +1044,10 @@ bool test_many_LookupSids(struct dcerpc_pipe *p, + * If we don't have a secure channel these tests must + * fail with ACCESS_DENIED. + */ +- if (!test_LookupSids3_fail(b, tctx, &sids)) { ++ if (!test_LookupSids3_fail(b, tctx, level, &sids)) { + return false; + } +- if (!test_LookupNames4_fail(b, tctx)) { ++ if (!test_LookupNames4_fail(b, tctx, level)) { + return false; + } + } +@@ -1066,7 +1079,8 @@ static void lookupsids_cb(struct tevent_req *subreq) + + static bool test_LookupSids_async(struct dcerpc_binding_handle *b, + struct torture_context *tctx, +- struct policy_handle *handle) ++ struct policy_handle *handle, ++ enum lsa_LookupNamesLevel level) + { + struct lsa_SidArray sids; + struct lsa_SidPtr sidptr; +@@ -1101,7 +1115,7 @@ static bool test_LookupSids_async(struct dcerpc_binding_handle *b, + r[i].in.handle = handle; + r[i].in.sids = &sids; + r[i].in.names = &names[i]; +- r[i].in.level = 1; ++ r[i].in.level = level; + r[i].in.count = &names[i].count; + r[i].out.count = &count[i]; + r[i].out.names = &names[i]; +@@ -1912,11 +1926,11 @@ static bool test_EnumAccounts(struct dcerpc_binding_handle *b, + torture_assert_ntstatus_ok(tctx, r.out.result, + "EnumAccounts failed"); + +- if (!test_LookupSids(b, tctx, handle, &sids1)) { ++ if (!test_LookupSids(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &sids1)) { + return false; + } + +- if (!test_LookupSids2(b, tctx, handle, &sids1)) { ++ if (!test_LookupSids2(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &sids1)) { + return false; + } + +@@ -4811,7 +4825,7 @@ static bool test_QueryInfoPolicyCalls( bool version2, + tnames.names[12].sid_type = SID_NAME_USER; + tnames.names[13].name.string = talloc_asprintf(tctx, TEST_MACHINENAME "$@%s", info->dns.dns_domain.string); + tnames.names[13].sid_type = SID_NAME_USER; +- ret &= test_LookupNames(b, tctx, handle, &tnames); ++ ret &= test_LookupNames(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames); + + } + } +@@ -4977,7 +4991,7 @@ bool torture_rpc_lsa(struct torture_context *tctx) + ret = false; + } + +- if (!test_many_LookupSids(p, tctx, handle)) { ++ if (!test_many_LookupSids(p, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { + ret = false; + } + +@@ -4998,7 +5012,7 @@ bool torture_rpc_lsa(struct torture_context *tctx) + ret = false; + } + +- if (!test_LookupSids_async(b, tctx, handle)) { ++ if (!test_LookupSids_async(b, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { + ret = false; + } + +@@ -5022,7 +5036,7 @@ bool torture_rpc_lsa(struct torture_context *tctx) + ret = false; + } + +- if (!test_many_LookupSids(p, tctx, handle)) { ++ if (!test_many_LookupSids(p, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { + ret = false; + } + +@@ -5033,7 +5047,7 @@ bool torture_rpc_lsa(struct torture_context *tctx) + torture_leave_domain(tctx, join); + + } else { +- if (!test_many_LookupSids(p, tctx, handle)) { ++ if (!test_many_LookupSids(p, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { + ret = false; + } + } +@@ -5108,7 +5122,7 @@ static bool testcase_LookupNames(struct torture_context *tctx, + tnames.names[0].name.string = "BUILTIN"; + tnames.names[0].sid_type = SID_NAME_DOMAIN; + +- if (!test_LookupNames(b, tctx, handle, &tnames)) { ++ if (!test_LookupNames(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames)) { + ret = false; + } + +@@ -5118,23 +5132,23 @@ static bool testcase_LookupNames(struct torture_context *tctx, + tnames2.names[0].name.string = "BUILTIN"; + tnames2.names[0].sid_type = SID_NAME_DOMAIN; + +- if (!test_LookupNames2(b, tctx, handle, &tnames2, true)) { ++ if (!test_LookupNames2(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames2, true)) { + ret = false; + } + +- if (!test_LookupNames3(b, tctx, handle, &tnames2, true)) { ++ if (!test_LookupNames3(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames2, true)) { + ret = false; + } + +- if (!test_LookupNames_wellknown(b, tctx, handle)) { ++ if (!test_LookupNames_wellknown(b, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { + ret = false; + } + +- if (!test_LookupNames_NULL(b, tctx, handle)) { ++ if (!test_LookupNames_NULL(b, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { + ret = false; + } + +- if (!test_LookupNames_bogus(b, tctx, handle)) { ++ if (!test_LookupNames_bogus(b, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { + ret = false; + } + +diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c +index de3a36eaa4f..c237c82bbe7 100644 +--- a/source4/torture/rpc/schannel.c ++++ b/source4/torture/rpc/schannel.c +@@ -471,7 +471,7 @@ static bool test_schannel(struct torture_context *tctx, + "failed to connect lsarpc with schannel"); + + torture_assert(tctx, +- test_many_LookupSids(p_lsa, tctx, NULL), ++ test_many_LookupSids(p_lsa, tctx, NULL, LSA_LOOKUP_NAMES_ALL), + "LsaLookupSids3 failed!\n"); + + status = dcerpc_binding_set_transport(b, transport); +-- +2.21.0 + + +From e76b56290c2be142c43a3fd68584d51b9dc0efb7 Mon Sep 17 00:00:00 2001 +From: Alexander Bokovoy +Date: Thu, 1 Aug 2019 15:48:58 +0300 +Subject: [PATCH 2/3] lookup_name: allow own domain lookup when flags == 0 + +In 2007, we've added support for multiple lookup levels for LSA +LookupNames family of calls. However, forest-wide lookups, as described +in MS-LSAT 2.2.16, never worked because flags passed to lookup_name() +were always set to zero, expecting at least default lookup on a DC to +apply. lookup_name() was instead treating zero flags as 'skip all +checks'. + +Allow at least own domain lookup in case domain name is the same. +This should allow FreeIPA DC to respond to LSA LookupNames3 calls from a +trusted AD DC side. + +For the reference, below is a request Windows Server 2016 domain +controller sends to FreeIPA domain controller when attempting to look up +a user from a trusted forest root domain that attemps to login to the +domain controller. Notice the level in the lsa_LookupNames3 call and +resulting flags in lookup_name(). + +[2019/08/03 07:14:24.156065, 1, pid=23639, effective(967001000, 967001000), real(967001000, 0), class=rpc_parse] ../../librpc/ndr/ndr.c:471(ndr_print_function_debug) + lsa_LookupNames3: struct lsa_LookupNames3 + in: struct lsa_LookupNames3 + handle : * + handle: struct policy_handle + handle_type : 0x00000000 (0) + uuid : 0000004c-0000-0000-455d-3018575c0000 + num_names : 0x00000001 (1) + names: ARRAY(1) + names: struct lsa_String + length : 0x000a (10) + size : 0x000c (12) + string : * + string : 'XS\ab' + sids : * + sids: struct lsa_TransSidArray3 + count : 0x00000000 (0) + sids : NULL + level : LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 (6) + count : * + count : 0x00000000 (0) + lookup_options : LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES (0) + client_revision : LSA_CLIENT_REVISION_2 (2) +[2019/08/03 07:14:24.156189, 6, pid=23639, effective(967001000, 967001000), real(967001000, 0), class=rpc_srv] ../../source3/rpc_server/rpc_handles.c:339(find_policy_by_hnd_internal) + Found policy hnd[0] [0000] 00 00 00 00 4C 00 00 00 00 00 00 00 45 5D 30 18 ....L... ....E]0. + [0010] 57 5C 00 00 W\.. +[2019/08/03 07:14:24.156228, 4, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/smbd/sec_ctx.c:215(push_sec_ctx) + push_sec_ctx(967001000, 967001000) : sec_ctx_stack_ndx = 2 +[2019/08/03 07:14:24.156246, 4, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/smbd/uid.c:552(push_conn_ctx) + push_conn_ctx(0) : conn_ctx_stack_ndx = 0 +[2019/08/03 07:14:24.156259, 4, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal) + setting sec ctx (0, 0) - sec_ctx_stack_ndx = 2 +[2019/08/03 07:14:24.156273, 5, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../libcli/security/security_token.c:53(security_token_debug) + Security token: (NULL) +[2019/08/03 07:14:24.156285, 5, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/auth/token_util.c:865(debug_unix_user_token) + UNIX token of user 0 + Primary group is 0 and contains 0 supplementary groups +[2019/08/03 07:14:24.156311, 5, pid=23639, effective(0, 0), real(0, 0), class=rpc_srv] ../../source3/rpc_server/lsa/srv_lsa_nt.c:244(lookup_lsa_sids) + lookup_lsa_sids: looking up name XS\ab +[2019/08/03 07:14:24.156327, 10, pid=23639, effective(0, 0), real(0, 0)] ../../source3/passdb/lookup_sid.c:112(lookup_name) + lookup_name: XS\ab => domain=[XS], name=[ab] +[2019/08/03 07:14:24.156340, 10, pid=23639, effective(0, 0), real(0, 0)] ../../source3/passdb/lookup_sid.c:114(lookup_name) + lookup_name: flags = 0x00 + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14091 + +Signed-off-by: Alexander Bokovoy +Reviewed-by: Andreas Schneider + +(cherry picked from commit 685bb03de6ab733590831d1df4f5fd60d2ac427d) +--- + source3/passdb/lookup_sid.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c +index 2281bd0b64d..1bb15ccb8b4 100644 +--- a/source3/passdb/lookup_sid.c ++++ b/source3/passdb/lookup_sid.c +@@ -113,7 +113,7 @@ bool lookup_name(TALLOC_CTX *mem_ctx, + full_name, domain, name)); + DEBUG(10, ("lookup_name: flags = 0x0%x\n", flags)); + +- if ((flags & LOOKUP_NAME_DOMAIN) && ++ if (((flags & LOOKUP_NAME_DOMAIN) || (flags == 0)) && + strequal(domain, get_global_sam_name())) + { + +-- +2.21.0 + + +From 03d1a9f4f07f6e06c125875fe454925f4c1f6c2b Mon Sep 17 00:00:00 2001 +From: Alexander Bokovoy +Date: Sat, 10 Aug 2019 11:53:12 +0300 +Subject: [PATCH 3/3] smbtorture: extend rpc.lsa to lookup machine over + forest-wide LookupNames + +Add a simple test to resolve DOMAIN\MACHINE$ via LSA LookupNames3 +using LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 level. This level would pass +zero lookup flags to lookup_name(). + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14091 + +Signed-off-by: Alexander Bokovoy +Reviewed-by: Andreas Schneider + +Autobuild-User(master): Alexander Bokovoy +Autobuild-Date(master): Wed Aug 14 13:07:42 UTC 2019 on sn-devel-184 + +(cherry picked from commit 4d276a93fc624dc04d880f5b4157f272d3555be6) +--- + source4/torture/rpc/lsa.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c +index b7dd0dc8c91..21cc16afbaf 100644 +--- a/source4/torture/rpc/lsa.c ++++ b/source4/torture/rpc/lsa.c +@@ -4794,7 +4794,7 @@ static bool test_QueryInfoPolicyCalls( bool version2, + || i == LSA_POLICY_INFO_DNS_INT)) { + /* Let's look up some of these names */ + +- struct lsa_TransNameArray tnames; ++ struct lsa_TransNameArray tnames, dnames; + tnames.count = 14; + tnames.names = talloc_zero_array(tctx, struct lsa_TranslatedName, tnames.count); + tnames.names[0].name.string = info->dns.name.string; +@@ -4827,6 +4827,12 @@ static bool test_QueryInfoPolicyCalls( bool version2, + tnames.names[13].sid_type = SID_NAME_USER; + ret &= test_LookupNames(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames); + ++ /* Try to use in-forest search for the test machine */ ++ dnames.count = 1; ++ dnames.names = talloc_zero_array(tctx, struct lsa_TranslatedName, dnames.count); ++ dnames.names[0].name.string = talloc_asprintf(tctx, "%s\\"TEST_MACHINENAME "$", info->dns.name.string); ++ dnames.names[0].sid_type = SID_NAME_USER; ++ ret &= test_LookupNames(b, tctx, handle, LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2, &dnames); + } + } + +-- +2.21.0 + diff --git a/samba.spec b/samba.spec index 3d59872..18e7c27 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 0 +%define main_release 1 %define samba_version 4.10.6 %define talloc_version 2.1.16 @@ -86,7 +86,7 @@ Name: samba Version: %{samba_version} -Release: %{samba_release}.2 +Release: %{samba_release} %if 0%{?rhel} Epoch: 0 @@ -119,6 +119,7 @@ Source14: samba.pamd Source201: README.downgrade Patch0: samba-4.10.x-waf_update.patch +Patch1: samba-bz14091-v4.10-backport.patch Requires(pre): /usr/sbin/groupadd Requires(post): systemd @@ -3439,6 +3440,10 @@ fi %endif # with_clustering_support %changelog +* Fri Aug 16 2019 Alexander Bokovoy - 2:4.10.6-1 +- Fix Samba bug https://bugzilla.samba.org/show_bug.cgi?id=14091 +- Fixes: Windows systems cannot resolve IPA users and groups over LSA RPC + * Fri Jul 26 2019 Fedora Release Engineering - 2:4.10.6-0.2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From ebd06bdd1a9d80a1d4d694804105497e7c7874e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Mon, 29 Jul 2019 11:24:31 +0200 Subject: [PATCH 68/76] Update to Samba 4.11.0rc1 Guenther --- .gitignore | 2 + samba-4.10.x-waf_update.patch | 3300 --------------------------------- samba.spec | 20 +- sources | 4 +- 4 files changed, 15 insertions(+), 3311 deletions(-) delete mode 100644 samba-4.10.x-waf_update.patch diff --git a/.gitignore b/.gitignore index c351ef4..3f7e875 100644 --- a/.gitignore +++ b/.gitignore @@ -169,3 +169,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.5.tar.asc /samba-4.10.6.tar.xz /samba-4.10.6.tar.asc +/samba-4.11.0rc1.tar.xz +/samba-4.11.0rc1.tar.asc diff --git a/samba-4.10.x-waf_update.patch b/samba-4.10.x-waf_update.patch deleted file mode 100644 index b0ca5a3..0000000 --- a/samba-4.10.x-waf_update.patch +++ /dev/null @@ -1,3300 +0,0 @@ -From f78df958cb0a636906890ac6c823eb72ca365de3 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 3 Jun 2019 10:40:55 +0200 -Subject: [PATCH] third_party: Update waf to version 2.0.17 - -This fixes building Samba, libtalloc, libtevent, libtdb and libldb with -Python 3.8. - - wget https://waf.io/waf-2.0.17.tar.bz2 - tar -xf waf-2.0.17.tar.bz2 - git rm third_party/waf/waflib/ -r - mkdir third_party/waf -p - rsync -a waf-2.0.17/waflib/ third_party/waf/waflib/ - git add third_party/waf/waflib/ - -(Then update version number in buildtools/bin/waf and -buildtools/wafsamba/wafsamba.py) - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13960 - -Signed-off-by: Andreas Schneider -Reviewed-by: Andrew Bartlett -Signed-off-by: Andrew Bartlett -(cherry picked from commit aabdcc91513e242c4f191e1bbbb70c890416d213) ---- - buildtools/bin/waf | 2 +- - buildtools/wafsamba/wafsamba.py | 2 +- - third_party/waf/waflib/Build.py | 62 ++++- - third_party/waf/waflib/ConfigSet.py | 4 +- - third_party/waf/waflib/Configure.py | 5 +- - third_party/waf/waflib/Context.py | 16 +- - third_party/waf/waflib/Logs.py | 9 +- - third_party/waf/waflib/Node.py | 3 +- - third_party/waf/waflib/Runner.py | 60 ++++- - third_party/waf/waflib/Scripting.py | 15 +- - third_party/waf/waflib/Task.py | 215 ++++++++++++++---- - third_party/waf/waflib/TaskGen.py | 6 +- - third_party/waf/waflib/Tools/c_config.py | 11 +- - third_party/waf/waflib/Tools/c_preproc.py | 8 +- - third_party/waf/waflib/Tools/ccroot.py | 22 +- - third_party/waf/waflib/Tools/d_scan.py | 8 +- - third_party/waf/waflib/Tools/fc.py | 24 +- - third_party/waf/waflib/Tools/fc_config.py | 6 +- - third_party/waf/waflib/Tools/fc_scan.py | 12 +- - third_party/waf/waflib/Tools/ifort.py | 2 +- - third_party/waf/waflib/Tools/javaw.py | 157 +++++++++++-- - third_party/waf/waflib/Tools/md5_tstamp.py | 6 +- - third_party/waf/waflib/Tools/msvc.py | 18 +- - third_party/waf/waflib/Tools/python.py | 18 +- - third_party/waf/waflib/Tools/qt5.py | 14 +- - third_party/waf/waflib/Tools/waf_unit_test.py | 4 +- - third_party/waf/waflib/Tools/winres.py | 4 +- - third_party/waf/waflib/Utils.py | 26 ++- - third_party/waf/waflib/ansiterm.py | 2 +- - third_party/waf/waflib/extras/buildcopy.py | 7 +- - third_party/waf/waflib/extras/clang_cross.py | 92 ++++++++ - .../waf/waflib/extras/clang_cross_common.py | 113 +++++++++ - .../waf/waflib/extras/clangxx_cross.py | 106 +++++++++ - third_party/waf/waflib/extras/color_msvc.py | 59 +++++ - third_party/waf/waflib/extras/cppcheck.py | 12 +- - third_party/waf/waflib/extras/cpplint.py | 77 +++---- - third_party/waf/waflib/extras/cython.py | 15 +- - third_party/waf/waflib/extras/distnet.py | 2 +- - third_party/waf/waflib/extras/doxygen.py | 13 +- - third_party/waf/waflib/extras/erlang.py | 2 +- - third_party/waf/waflib/extras/fast_partial.py | 3 +- - third_party/waf/waflib/extras/fc_cray.py | 2 +- - third_party/waf/waflib/extras/fc_nec.py | 2 +- - third_party/waf/waflib/extras/fc_nfort.py | 52 +++++ - third_party/waf/waflib/extras/gccdeps.py | 6 +- - third_party/waf/waflib/extras/kde4.py | 2 +- - third_party/waf/waflib/extras/msvcdeps.py | 73 +++--- - third_party/waf/waflib/extras/ocaml.py | 2 +- - .../waf/waflib/extras/parallel_debug.py | 9 +- - third_party/waf/waflib/extras/pgicc.py | 2 +- - third_party/waf/waflib/extras/protoc.py | 93 +++----- - third_party/waf/waflib/extras/pyqt5.py | 21 +- - third_party/waf/waflib/extras/qt4.py | 6 +- - third_party/waf/waflib/extras/remote.py | 2 +- - .../waf/waflib/extras/run_do_script.py | 2 +- - third_party/waf/waflib/extras/sphinx.py | 81 +++++++ - third_party/waf/waflib/extras/swig.py | 4 +- - third_party/waf/waflib/extras/syms.py | 2 +- - third_party/waf/waflib/extras/use_config.py | 2 +- - third_party/waf/waflib/extras/xcode6.py | 8 +- - third_party/waf/waflib/processor.py | 4 + - 61 files changed, 1259 insertions(+), 358 deletions(-) - create mode 100644 third_party/waf/waflib/extras/clang_cross.py - create mode 100644 third_party/waf/waflib/extras/clang_cross_common.py - create mode 100644 third_party/waf/waflib/extras/clangxx_cross.py - create mode 100644 third_party/waf/waflib/extras/color_msvc.py - create mode 100644 third_party/waf/waflib/extras/fc_nfort.py - create mode 100644 third_party/waf/waflib/extras/sphinx.py - -diff --git a/buildtools/bin/waf b/buildtools/bin/waf -index 3ee4d5bc4df..8413f2332b7 100755 ---- a/buildtools/bin/waf -+++ b/buildtools/bin/waf -@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. - - import os, sys, inspect - --VERSION="2.0.8" -+VERSION="2.0.17" - REVISION="x" - GIT="x" - INSTALL="x" -diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py -index a077026c690..760430460b8 100644 ---- a/buildtools/wafsamba/wafsamba.py -+++ b/buildtools/wafsamba/wafsamba.py -@@ -37,7 +37,7 @@ LIB_PATH="shared" - - os.environ['PYTHONUNBUFFERED'] = '1' - --if Context.HEXVERSION not in (0x2000800,): -+if Context.HEXVERSION not in (0x2001100,): - Logs.error(''' - Please use the version of waf that comes with Samba, not - a system installed version. See http://wiki.samba.org/index.php/Waf -diff --git a/third_party/waf/waflib/Build.py b/third_party/waf/waflib/Build.py -index 8347a287a81..39f0991918b 100644 ---- a/third_party/waf/waflib/Build.py -+++ b/third_party/waf/waflib/Build.py -@@ -104,7 +104,7 @@ class BuildContext(Context.Context): - """Amount of jobs to run in parallel""" - - self.targets = Options.options.targets -- """List of targets to build (default: \*)""" -+ """List of targets to build (default: \\*)""" - - self.keep = Options.options.keep - """Whether the build should continue past errors""" -@@ -758,14 +758,31 @@ class BuildContext(Context.Context): - elif not ln.is_child_of(self.srcnode): - Logs.warn('CWD %s is not under %s, forcing --targets=* (run distclean?)', ln.abspath(), self.srcnode.abspath()) - ln = self.srcnode -- for tg in self.groups[self.current_group]: -+ -+ def is_post(tg, ln): - try: - p = tg.path - except AttributeError: - pass - else: - if p.is_child_of(ln): -- tgpost(tg) -+ return True -+ -+ def is_post_group(): -+ for i, g in enumerate(self.groups): -+ if i > self.current_group: -+ for tg in g: -+ if is_post(tg, ln): -+ return True -+ -+ if self.post_mode == POST_LAZY and ln != self.srcnode: -+ # partial folder builds require all targets from a previous build group -+ if is_post_group(): -+ ln = self.srcnode -+ -+ for tg in self.groups[self.current_group]: -+ if is_post(tg, ln): -+ tgpost(tg) - - def get_tasks_group(self, idx): - """ -@@ -884,7 +901,7 @@ class BuildContext(Context.Context): - - :param dest: absolute path of the symlink - :type dest: :py:class:`waflib.Node.Node` or string (absolute path) -- :param src: link contents, which is a relative or abolute path which may exist or not -+ :param src: link contents, which is a relative or absolute path which may exist or not - :type src: string - :param env: configuration set for performing substitutions in dest - :type env: :py:class:`waflib.ConfigSet.ConfigSet` -@@ -1038,12 +1055,16 @@ class inst(Task.Task): - """ - Returns the destination path where files will be installed, pre-pending `destdir`. - -+ Relative paths will be interpreted relative to `PREFIX` if no `destdir` is given. -+ - :rtype: string - """ - if isinstance(self.install_to, Node.Node): - dest = self.install_to.abspath() - else: -- dest = Utils.subst_vars(self.install_to, self.env) -+ dest = os.path.normpath(Utils.subst_vars(self.install_to, self.env)) -+ if not os.path.isabs(dest): -+ dest = os.path.join(self.env.PREFIX, dest) - if destdir and Options.options.destdir: - dest = os.path.join(Options.options.destdir, os.path.splitdrive(dest)[1].lstrip(os.sep)) - return dest -@@ -1139,11 +1160,19 @@ class inst(Task.Task): - # same size and identical timestamps -> make no copy - if st1.st_mtime + 2 >= st2.st_mtime and st1.st_size == st2.st_size: - if not self.generator.bld.progress_bar: -- Logs.info('- install %s (from %s)', tgt, lbl) -+ -+ c1 = Logs.colors.NORMAL -+ c2 = Logs.colors.BLUE -+ -+ Logs.info('%s- install %s%s%s (from %s)', c1, c2, tgt, c1, lbl) - return False - - if not self.generator.bld.progress_bar: -- Logs.info('+ install %s (from %s)', tgt, lbl) -+ -+ c1 = Logs.colors.NORMAL -+ c2 = Logs.colors.BLUE -+ -+ Logs.info('%s+ install %s%s%s (from %s)', c1, c2, tgt, c1, lbl) - - # Give best attempt at making destination overwritable, - # like the 'install' utility used by 'make install' does. -@@ -1200,14 +1229,18 @@ class inst(Task.Task): - """ - if os.path.islink(tgt) and os.readlink(tgt) == src: - if not self.generator.bld.progress_bar: -- Logs.info('- symlink %s (to %s)', tgt, src) -+ c1 = Logs.colors.NORMAL -+ c2 = Logs.colors.BLUE -+ Logs.info('%s- symlink %s%s%s (to %s)', c1, c2, tgt, c1, src) - else: - try: - os.remove(tgt) - except OSError: - pass - if not self.generator.bld.progress_bar: -- Logs.info('+ symlink %s (to %s)', tgt, src) -+ c1 = Logs.colors.NORMAL -+ c2 = Logs.colors.BLUE -+ Logs.info('%s+ symlink %s%s%s (to %s)', c1, c2, tgt, c1, src) - os.symlink(src, tgt) - self.fix_perms(tgt) - -@@ -1216,7 +1249,9 @@ class inst(Task.Task): - See :py:meth:`waflib.Build.inst.do_install` - """ - if not self.generator.bld.progress_bar: -- Logs.info('- remove %s', tgt) -+ c1 = Logs.colors.NORMAL -+ c2 = Logs.colors.BLUE -+ Logs.info('%s- remove %s%s%s', c1, c2, tgt, c1) - - #self.uninstall.append(tgt) - try: -@@ -1236,7 +1271,9 @@ class inst(Task.Task): - """ - try: - if not self.generator.bld.progress_bar: -- Logs.info('- remove %s', tgt) -+ c1 = Logs.colors.NORMAL -+ c2 = Logs.colors.BLUE -+ Logs.info('%s- remove %s%s%s', c1, c2, tgt, c1) - os.remove(tgt) - except OSError: - pass -@@ -1297,7 +1334,8 @@ class CleanContext(BuildContext): - lst = [] - for env in self.all_envs.values(): - lst.extend(self.root.find_or_declare(f) for f in env[CFG_FILES]) -- for n in self.bldnode.ant_glob('**/*', excl='.lock* *conf_check_*/** config.log c4che/*', quiet=True): -+ excluded_dirs = '.lock* *conf_check_*/** config.log %s/*' % CACHE_DIR -+ for n in self.bldnode.ant_glob('**/*', excl=excluded_dirs, quiet=True): - if n in lst: - continue - n.delete() -diff --git a/third_party/waf/waflib/ConfigSet.py b/third_party/waf/waflib/ConfigSet.py -index b300bb56b7c..901fba6c067 100644 ---- a/third_party/waf/waflib/ConfigSet.py -+++ b/third_party/waf/waflib/ConfigSet.py -@@ -11,7 +11,7 @@ The values put in :py:class:`ConfigSet` must be serializable (dicts, lists, stri - - import copy, re, os - from waflib import Logs, Utils --re_imp = re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$', re.M) -+re_imp = re.compile(r'^(#)*?([^#=]*?)\ =\ (.*?)$', re.M) - - class ConfigSet(object): - """ -@@ -312,7 +312,7 @@ class ConfigSet(object): - :type filename: string - """ - tbl = self.table -- code = Utils.readf(filename, m='rU') -+ code = Utils.readf(filename, m='r') - for m in re_imp.finditer(code): - g = m.group - tbl[g(2)] = eval(g(3)) -diff --git a/third_party/waf/waflib/Configure.py b/third_party/waf/waflib/Configure.py -index 20ca705e696..db09c0e3a40 100644 ---- a/third_party/waf/waflib/Configure.py -+++ b/third_party/waf/waflib/Configure.py -@@ -125,7 +125,7 @@ class ConfigurationContext(Context.Context): - self.bldnode.mkdir() - - if not os.path.isdir(self.bldnode.abspath()): -- conf.fatal('Could not create the build directory %s' % self.bldnode.abspath()) -+ self.fatal('Could not create the build directory %s' % self.bldnode.abspath()) - - def execute(self): - """ -@@ -180,6 +180,7 @@ class ConfigurationContext(Context.Context): - env.hash = self.hash - env.files = self.files - env.environ = dict(self.environ) -+ env.launch_dir = Context.launch_dir - - if not (self.env.NO_LOCK_IN_RUN or env.environ.get('NO_LOCK_IN_RUN') or getattr(Options.options, 'no_lock_in_run')): - env.store(os.path.join(Context.run_dir, Options.lockfile)) -@@ -286,7 +287,7 @@ class ConfigurationContext(Context.Context): - - def eval_rules(self, rules): - """ -- Execute configuration tests provided as list of funcitons to run -+ Execute configuration tests provided as list of functions to run - - :param rules: list of configuration method names - :type rules: list of string -diff --git a/third_party/waf/waflib/Context.py b/third_party/waf/waflib/Context.py -index 3222fb1551c..d0759aada58 100644 ---- a/third_party/waf/waflib/Context.py -+++ b/third_party/waf/waflib/Context.py -@@ -11,13 +11,13 @@ from waflib import Utils, Errors, Logs - import waflib.Node - - # the following 3 constants are updated on each new release (do not touch) --HEXVERSION=0x2000800 -+HEXVERSION=0x2001100 - """Constant updated on new releases""" - --WAFVERSION="2.0.8" -+WAFVERSION="2.0.17" - """Constant updated on new releases""" - --WAFREVISION="f78fbc32bb355a3291c9b5f79bbe0c8dfe81282a" -+WAFREVISION="6bc6cb599c702e985780e9f705b291b812123693" - """Git revision when the waf version is updated""" - - ABI = 20 -@@ -266,7 +266,7 @@ class Context(ctx): - cache[node] = True - self.pre_recurse(node) - try: -- function_code = node.read('rU', encoding) -+ function_code = node.read('r', encoding) - exec(compile(function_code, node.abspath(), 'exec'), self.exec_dict) - finally: - self.post_recurse(node) -@@ -502,7 +502,7 @@ class Context(ctx): - def build(bld): - bld.to_log('starting the build') - -- Provide a logger on the context class or override this methid if necessary. -+ Provide a logger on the context class or override this method if necessary. - - :param msg: message - :type msg: string -@@ -613,7 +613,7 @@ class Context(ctx): - is typically called once for a programming language group, see for - example :py:mod:`waflib.Tools.compiler_c` - -- :param var: glob expression, for example 'cxx\_\*.py' -+ :param var: glob expression, for example 'cxx\\_\\*.py' - :type var: string - :param ban: list of exact file names to exclude - :type ban: list of string -@@ -662,7 +662,7 @@ def load_module(path, encoding=None): - - module = imp.new_module(WSCRIPT_FILE) - try: -- code = Utils.readf(path, m='rU', encoding=encoding) -+ code = Utils.readf(path, m='r', encoding=encoding) - except EnvironmentError: - raise Errors.WafError('Could not read the file %r' % path) - -@@ -678,7 +678,7 @@ def load_module(path, encoding=None): - - def load_tool(tool, tooldir=None, ctx=None, with_sys_path=True): - """ -- Importx a Waf tool as a python module, and stores it in the dict :py:const:`waflib.Context.Context.tools` -+ Imports a Waf tool as a python module, and stores it in the dict :py:const:`waflib.Context.Context.tools` - - :type tool: string - :param tool: Name of the tool -diff --git a/third_party/waf/waflib/Logs.py b/third_party/waf/waflib/Logs.py -index 2a475169b9b..298411db51e 100644 ---- a/third_party/waf/waflib/Logs.py -+++ b/third_party/waf/waflib/Logs.py -@@ -237,7 +237,10 @@ class formatter(logging.Formatter): - if rec.levelno >= logging.INFO: - # the goal of this is to format without the leading "Logs, hour" prefix - if rec.args: -- return msg % rec.args -+ try: -+ return msg % rec.args -+ except UnicodeDecodeError: -+ return msg.encode('utf-8') % rec.args - return msg - - rec.msg = msg -@@ -276,9 +279,9 @@ def error(*k, **kw): - - def warn(*k, **kw): - """ -- Wraps logging.warn -+ Wraps logging.warning - """ -- log.warn(*k, **kw) -+ log.warning(*k, **kw) - - def info(*k, **kw): - """ -diff --git a/third_party/waf/waflib/Node.py b/third_party/waf/waflib/Node.py -index 4ac1ea8a0b8..2ad18466970 100644 ---- a/third_party/waf/waflib/Node.py -+++ b/third_party/waf/waflib/Node.py -@@ -73,7 +73,7 @@ def ant_matcher(s, ignorecase): - if k == '**': - accu.append(k) - else: -- k = k.replace('.', '[.]').replace('*','.*').replace('?', '.').replace('+', '\\+') -+ k = k.replace('.', '[.]').replace('*', '.*').replace('?', '.').replace('+', '\\+') - k = '^%s$' % k - try: - exp = re.compile(k, flags=reflags) -@@ -595,7 +595,6 @@ class Node(object): - :rtype: iterator - """ - dircont = self.listdir() -- dircont.sort() - - try: - lst = set(self.children.keys()) -diff --git a/third_party/waf/waflib/Runner.py b/third_party/waf/waflib/Runner.py -index 7535c83de9e..91d55479e20 100644 ---- a/third_party/waf/waflib/Runner.py -+++ b/third_party/waf/waflib/Runner.py -@@ -37,6 +37,8 @@ class PriorityTasks(object): - return len(self.lst) - def __iter__(self): - return iter(self.lst) -+ def __str__(self): -+ return 'PriorityTasks: [%s]' % '\n '.join(str(x) for x in self.lst) - def clear(self): - self.lst = [] - def append(self, task): -@@ -181,10 +183,12 @@ class Parallel(object): - The reverse dependency graph of dependencies obtained from Task.run_after - """ - -- self.spawner = Spawner(self) -+ self.spawner = None - """ - Coordinating daemon thread that spawns thread consumers - """ -+ if self.numjobs > 1: -+ self.spawner = Spawner(self) - - def get_next_task(self): - """ -@@ -226,6 +230,10 @@ class Parallel(object): - pass - else: - if cond: -+ # The most common reason is conflicting build order declaration -+ # for example: "X run_after Y" and "Y run_after X" -+ # Another can be changing "run_after" dependencies while the build is running -+ # for example: updating "tsk.run_after" in the "runnable_status" method - lst = [] - for tsk in self.postponed: - deps = [id(x) for x in tsk.run_after if not x.hasrun] -@@ -250,6 +258,8 @@ class Parallel(object): - self.outstanding.append(x) - break - else: -+ if self.stop or self.error: -+ break - raise Errors.WafError('Broken revdeps detected on %r' % self.incomplete) - else: - tasks = next(self.biter) -@@ -298,6 +308,8 @@ class Parallel(object): - def mark_finished(self, tsk): - def try_unfreeze(x): - # DAG ancestors are likely to be in the incomplete set -+ # This assumes that the run_after contents have not changed -+ # after the build starts, else a deadlock may occur - if x in self.incomplete: - # TODO remove dependencies to free some memory? - # x.run_after.remove(tsk) -@@ -323,6 +335,19 @@ class Parallel(object): - try_unfreeze(x) - del self.revdeps[tsk] - -+ if hasattr(tsk, 'semaphore'): -+ sem = tsk.semaphore -+ try: -+ sem.release(tsk) -+ except KeyError: -+ # TODO -+ pass -+ else: -+ while sem.waiting and not sem.is_locked(): -+ # take a frozen task, make it ready to run -+ x = sem.waiting.pop() -+ self._add_task(x) -+ - def get_out(self): - """ - Waits for a Task that task consumers add to :py:attr:`waflib.Runner.Parallel.out` after execution. -@@ -346,8 +371,29 @@ class Parallel(object): - :param tsk: task instance - :type tsk: :py:attr:`waflib.Task.Task` - """ -+ # TODO change in waf 2.1 - self.ready.put(tsk) - -+ def _add_task(self, tsk): -+ if hasattr(tsk, 'semaphore'): -+ sem = tsk.semaphore -+ try: -+ sem.acquire(tsk) -+ except IndexError: -+ sem.waiting.add(tsk) -+ return -+ -+ self.count += 1 -+ self.processed += 1 -+ if self.numjobs == 1: -+ tsk.log_display(tsk.generator.bld) -+ try: -+ self.process_task(tsk) -+ finally: -+ self.out.put(tsk) -+ else: -+ self.add_task(tsk) -+ - def process_task(self, tsk): - """ - Processes a task and attempts to stop the build in case of errors -@@ -447,17 +493,7 @@ class Parallel(object): - - st = self.task_status(tsk) - if st == Task.RUN_ME: -- self.count += 1 -- self.processed += 1 -- -- if self.numjobs == 1: -- tsk.log_display(tsk.generator.bld) -- try: -- self.process_task(tsk) -- finally: -- self.out.put(tsk) -- else: -- self.add_task(tsk) -+ self._add_task(tsk) - elif st == Task.ASK_LATER: - self.postpone(tsk) - elif st == Task.SKIP_ME: -diff --git a/third_party/waf/waflib/Scripting.py b/third_party/waf/waflib/Scripting.py -index 18203d52701..ae17a8b4503 100644 ---- a/third_party/waf/waflib/Scripting.py -+++ b/third_party/waf/waflib/Scripting.py -@@ -122,7 +122,8 @@ def waf_entry_point(current_directory, version, wafdir): - if no_climb: - break - -- if not Context.run_dir: -+ wscript = os.path.normpath(os.path.join(Context.run_dir, Context.WSCRIPT_FILE)) -+ if not os.path.exists(wscript): - if options.whelp: - Logs.warn('These are the generic options (no wscript/project found)') - ctx.parser.print_help() -@@ -137,7 +138,7 @@ def waf_entry_point(current_directory, version, wafdir): - sys.exit(1) - - try: -- set_main_module(os.path.normpath(os.path.join(Context.run_dir, Context.WSCRIPT_FILE))) -+ set_main_module(wscript) - except Errors.WafError as e: - Logs.pprint('RED', e.verbose_msg) - Logs.error(str(e)) -@@ -215,7 +216,10 @@ def parse_options(): - ctx = Context.create_context('options') - ctx.execute() - if not Options.commands: -- Options.commands.append(default_cmd) -+ if isinstance(default_cmd, list): -+ Options.commands.extend(default_cmd) -+ else: -+ Options.commands.append(default_cmd) - if Options.options.whelp: - ctx.parser.print_help() - sys.exit(0) -@@ -279,7 +283,7 @@ def distclean_dir(dirname): - pass - - try: -- shutil.rmtree('c4che') -+ shutil.rmtree(Build.CACHE_DIR) - except OSError: - pass - -@@ -597,12 +601,15 @@ def autoconfigure(execute_method): - cmd = env.config_cmd or 'configure' - if Configure.autoconfig == 'clobber': - tmp = Options.options.__dict__ -+ launch_dir_tmp = Context.launch_dir - if env.options: - Options.options.__dict__ = env.options -+ Context.launch_dir = env.launch_dir - try: - run_command(cmd) - finally: - Options.options.__dict__ = tmp -+ Context.launch_dir = launch_dir_tmp - else: - run_command(cmd) - run_command(self.cmd) -diff --git a/third_party/waf/waflib/Task.py b/third_party/waf/waflib/Task.py -index c4642443f55..cb49a7394df 100644 ---- a/third_party/waf/waflib/Task.py -+++ b/third_party/waf/waflib/Task.py -@@ -50,6 +50,9 @@ def f(tsk): - bld = gen.bld - cwdx = tsk.get_cwd() - p = env.get_flat -+ def to_list(xx): -+ if isinstance(xx, str): return [xx] -+ return xx - tsk.last_cmd = cmd = \'\'\' %s \'\'\' % s - return tsk.exec_command(cmd, cwd=cwdx, env=env.env or None) - ''' -@@ -75,6 +78,20 @@ def f(tsk): - return tsk.exec_command(lst, cwd=cwdx, env=env.env or None) - ''' - -+COMPILE_TEMPLATE_SIG_VARS = ''' -+def f(tsk): -+ sig = tsk.generator.bld.hash_env_vars(tsk.env, tsk.vars) -+ tsk.m.update(sig) -+ env = tsk.env -+ gen = tsk.generator -+ bld = gen.bld -+ cwdx = tsk.get_cwd() -+ p = env.get_flat -+ buf = [] -+ %s -+ tsk.m.update(repr(buf).encode()) -+''' -+ - classes = {} - """ - The metaclass :py:class:`waflib.Task.store_task_type` stores all class tasks -@@ -101,8 +118,13 @@ class store_task_type(type): - # change the name of run_str or it is impossible to subclass with a function - cls.run_str = None - cls.run = f -+ # process variables - cls.vars = list(set(cls.vars + dvars)) - cls.vars.sort() -+ if cls.vars: -+ fun = compile_sig_vars(cls.vars) -+ if fun: -+ cls.sig_vars = fun - elif getattr(cls, 'run', None) and not 'hcode' in cls.__dict__: - # getattr(cls, 'hcode') would look in the upper classes - cls.hcode = Utils.h_cmd(cls.run) -@@ -115,10 +137,12 @@ evil = store_task_type('evil', (object,), {}) - - class Task(evil): - """ -- This class deals with the filesystem (:py:class:`waflib.Node.Node`). The method :py:class:`waflib.Task.Task.runnable_status` -- uses a hash value (from :py:class:`waflib.Task.Task.signature`) which is persistent from build to build. When the value changes, -- the task has to be executed. The method :py:class:`waflib.Task.Task.post_run` will assign the task signature to the output -- nodes (if present). -+ Task objects represents actions to perform such as commands to execute by calling the `run` method. -+ -+ Detecting when to execute a task occurs in the method :py:meth:`waflib.Task.Task.runnable_status`. -+ -+ Detecting which tasks to execute is performed through a hash value returned by -+ :py:meth:`waflib.Task.Task.signature`. The task signature is persistent from build to build. - """ - vars = [] - """ConfigSet variables that should trigger a rebuild (class attribute used for :py:meth:`waflib.Task.Task.sig_vars`)""" -@@ -139,10 +163,10 @@ class Task(evil): - """File extensions that objects of this task class may create""" - - before = [] -- """List of task class names to execute before instances of this class""" -+ """The instances of this class are executed before the instances of classes whose names are in this list""" - - after = [] -- """List of task class names to execute after instances of this class""" -+ """The instances of this class are executed after the instances of classes whose names are in this list""" - - hcode = Utils.SIG_NIL - """String representing an additional hash for the class representation""" -@@ -282,25 +306,31 @@ class Task(evil): - if hasattr(self, 'stderr'): - kw['stderr'] = self.stderr - -- # workaround for command line length limit: -- # http://support.microsoft.com/kb/830473 -- if not isinstance(cmd, str) and (len(repr(cmd)) >= 8192 if Utils.is_win32 else len(cmd) > 200000): -- cmd, args = self.split_argfile(cmd) -- try: -- (fd, tmp) = tempfile.mkstemp() -- os.write(fd, '\r\n'.join(args).encode()) -- os.close(fd) -- if Logs.verbose: -- Logs.debug('argfile: @%r -> %r', tmp, args) -- return self.generator.bld.exec_command(cmd + ['@' + tmp], **kw) -- finally: -+ if not isinstance(cmd, str): -+ if Utils.is_win32: -+ # win32 compares the resulting length http://support.microsoft.com/kb/830473 -+ too_long = sum([len(arg) for arg in cmd]) + len(cmd) > 8192 -+ else: -+ # non-win32 counts the amount of arguments (200k) -+ too_long = len(cmd) > 200000 -+ -+ if too_long and getattr(self, 'allow_argsfile', True): -+ # Shunt arguments to a temporary file if the command is too long. -+ cmd, args = self.split_argfile(cmd) - try: -- os.remove(tmp) -- except OSError: -- # anti-virus and indexers can keep files open -_- -- pass -- else: -- return self.generator.bld.exec_command(cmd, **kw) -+ (fd, tmp) = tempfile.mkstemp() -+ os.write(fd, '\r\n'.join(args).encode()) -+ os.close(fd) -+ if Logs.verbose: -+ Logs.debug('argfile: @%r -> %r', tmp, args) -+ return self.generator.bld.exec_command(cmd + ['@' + tmp], **kw) -+ finally: -+ try: -+ os.remove(tmp) -+ except OSError: -+ # anti-virus and indexers can keep files open -_- -+ pass -+ return self.generator.bld.exec_command(cmd, **kw) - - def process(self): - """ -@@ -572,6 +602,9 @@ class Task(evil): - """ - Run this task only after the given *task*. - -+ Calling this method from :py:meth:`waflib.Task.Task.runnable_status` may cause -+ build deadlocks; see :py:meth:`waflib.Tools.fc.fc.runnable_status` for details. -+ - :param task: task - :type task: :py:class:`waflib.Task.Task` - """ -@@ -751,6 +784,10 @@ class Task(evil): - def sig_vars(self): - """ - Used by :py:meth:`waflib.Task.Task.signature`; it hashes :py:attr:`waflib.Task.Task.env` variables/values -+ When overriding this method, and if scriptlet expressions are used, make sure to follow -+ the code in :py:meth:`waflib.Task.Task.compile_sig_vars` to enable dependencies on scriptlet results. -+ -+ This method may be replaced on subclasses by the metaclass to force dependencies on scriptlet code. - """ - sig = self.generator.bld.hash_env_vars(self.env, self.vars) - self.m.update(sig) -@@ -1013,7 +1050,7 @@ def funex(c): - exec(c, dc) - return dc['f'] - --re_cond = re.compile('(?P\w+)|(?P\|)|(?P&)') -+re_cond = re.compile(r'(?P\w+)|(?P\|)|(?P&)') - re_novar = re.compile(r'^(SRC|TGT)\W+.*?$') - reg_act = re.compile(r'(?P\\)|(?P\$\$)|(?P\$\{(?P\w+)(?P.*?)\})', re.M) - def compile_fun_shell(line): -@@ -1033,6 +1070,9 @@ def compile_fun_shell(line): - return None - line = reg_act.sub(repl, line) or line - dvars = [] -+ def add_dvar(x): -+ if x not in dvars: -+ dvars.append(x) - - def replc(m): - # performs substitutions and populates dvars -@@ -1042,8 +1082,7 @@ def compile_fun_shell(line): - return ' or ' - else: - x = m.group('var') -- if x not in dvars: -- dvars.append(x) -+ add_dvar(x) - return 'env[%r]' % x - - parm = [] -@@ -1061,8 +1100,7 @@ def compile_fun_shell(line): - app('" ".join([a.path_from(cwdx) for a in tsk.outputs])') - elif meth: - if meth.startswith(':'): -- if var not in dvars: -- dvars.append(var) -+ add_dvar(var) - m = meth[1:] - if m == 'SRC': - m = '[a.path_from(cwdx) for a in tsk.inputs]' -@@ -1072,19 +1110,21 @@ def compile_fun_shell(line): - m = '[tsk.inputs%s]' % m[3:] - elif re_novar.match(m): - m = '[tsk.outputs%s]' % m[3:] -- elif m[:3] not in ('tsk', 'gen', 'bld'): -- dvars.append(meth[1:]) -- m = '%r' % m -+ else: -+ add_dvar(m) -+ if m[:3] not in ('tsk', 'gen', 'bld'): -+ m = '%r' % m - app('" ".join(tsk.colon(%r, %s))' % (var, m)) - elif meth.startswith('?'): - # In A?B|C output env.A if one of env.B or env.C is non-empty - expr = re_cond.sub(replc, meth[1:]) - app('p(%r) if (%s) else ""' % (var, expr)) - else: -- app('%s%s' % (var, meth)) -+ call = '%s%s' % (var, meth) -+ add_dvar(call) -+ app(call) - else: -- if var not in dvars: -- dvars.append(var) -+ add_dvar(var) - app("p('%s')" % var) - if parm: - parm = "%% (%s) " % (',\n\t\t'.join(parm)) -@@ -1105,6 +1145,10 @@ def compile_fun_noshell(line): - merge = False - app = buf.append - -+ def add_dvar(x): -+ if x not in dvars: -+ dvars.append(x) -+ - def replc(m): - # performs substitutions and populates dvars - if m.group('and'): -@@ -1113,8 +1157,7 @@ def compile_fun_noshell(line): - return ' or ' - else: - x = m.group('var') -- if x not in dvars: -- dvars.append(x) -+ add_dvar(x) - return 'env[%r]' % x - - for m in reg_act_noshell.finditer(line): -@@ -1139,8 +1182,7 @@ def compile_fun_noshell(line): - elif code: - if code.startswith(':'): - # a composed variable ${FOO:OUT} -- if not var in dvars: -- dvars.append(var) -+ add_dvar(var) - m = code[1:] - if m == 'SRC': - m = '[a.path_from(cwdx) for a in tsk.inputs]' -@@ -1150,9 +1192,10 @@ def compile_fun_noshell(line): - m = '[tsk.inputs%s]' % m[3:] - elif re_novar.match(m): - m = '[tsk.outputs%s]' % m[3:] -- elif m[:3] not in ('tsk', 'gen', 'bld'): -- dvars.append(m) -- m = '%r' % m -+ else: -+ add_dvar(m) -+ if m[:3] not in ('tsk', 'gen', 'bld'): -+ m = '%r' % m - app('tsk.colon(%r, %s)' % (var, m)) - elif code.startswith('?'): - # In A?B|C output env.A if one of env.B or env.C is non-empty -@@ -1160,12 +1203,13 @@ def compile_fun_noshell(line): - app('to_list(env[%r] if (%s) else [])' % (var, expr)) - else: - # plain code such as ${tsk.inputs[0].abspath()} -- app('gen.to_list(%s%s)' % (var, code)) -+ call = '%s%s' % (var, code) -+ add_dvar(call) -+ app('to_list(%s)' % call) - else: - # a plain variable such as # a plain variable like ${AR} - app('to_list(env[%r])' % var) -- if not var in dvars: -- dvars.append(var) -+ add_dvar(var) - if merge: - tmp = 'merge(%s, %s)' % (buf[-2], buf[-1]) - del buf[-1] -@@ -1222,6 +1266,36 @@ def compile_fun(line, shell=False): - else: - return compile_fun_noshell(line) - -+def compile_sig_vars(vars): -+ """ -+ This method produces a sig_vars method suitable for subclasses that provide -+ scriptlet code in their run_str code. -+ If no such method can be created, this method returns None. -+ -+ The purpose of the sig_vars method returned is to ensures -+ that rebuilds occur whenever the contents of the expression changes. -+ This is the case B below:: -+ -+ import time -+ # case A: regular variables -+ tg = bld(rule='echo ${FOO}') -+ tg.env.FOO = '%s' % time.time() -+ # case B -+ bld(rule='echo ${gen.foo}', foo='%s' % time.time()) -+ -+ :param vars: env variables such as CXXFLAGS or gen.foo -+ :type vars: list of string -+ :return: A sig_vars method relevant for dependencies if adequate, else None -+ :rtype: A function, or None in most cases -+ """ -+ buf = [] -+ for x in sorted(vars): -+ if x[:3] in ('tsk', 'gen', 'bld'): -+ buf.append('buf.append(%s)' % x) -+ if buf: -+ return funex(COMPILE_TEMPLATE_SIG_VARS % '\n\t'.join(buf)) -+ return None -+ - def task_factory(name, func=None, vars=None, color='GREEN', ext_in=[], ext_out=[], before=[], after=[], shell=False, scan=None): - """ - Returns a new task subclass with the function ``run`` compiled from the line given. -@@ -1279,3 +1353,54 @@ def deep_inputs(cls): - TaskBase = Task - "Provided for compatibility reasons, TaskBase should not be used" - -+class TaskSemaphore(object): -+ """ -+ Task semaphores provide a simple and efficient way of throttling the amount of -+ a particular task to run concurrently. The throttling value is capped -+ by the amount of maximum jobs, so for example, a `TaskSemaphore(10)` -+ has no effect in a `-j2` build. -+ -+ Task semaphores are typically specified on the task class level:: -+ -+ class compile(waflib.Task.Task): -+ semaphore = waflib.Task.TaskSemaphore(2) -+ run_str = 'touch ${TGT}' -+ -+ Task semaphores are meant to be used by the build scheduler in the main -+ thread, so there are no guarantees of thread safety. -+ """ -+ def __init__(self, num): -+ """ -+ :param num: maximum value of concurrent tasks -+ :type num: int -+ """ -+ self.num = num -+ self.locking = set() -+ self.waiting = set() -+ -+ def is_locked(self): -+ """Returns True if this semaphore cannot be acquired by more tasks""" -+ return len(self.locking) >= self.num -+ -+ def acquire(self, tsk): -+ """ -+ Mark the semaphore as used by the given task (not re-entrant). -+ -+ :param tsk: task object -+ :type tsk: :py:class:`waflib.Task.Task` -+ :raises: :py:class:`IndexError` in case the resource is already acquired -+ """ -+ if self.is_locked(): -+ raise IndexError('Cannot lock more %r' % self.locking) -+ self.locking.add(tsk) -+ -+ def release(self, tsk): -+ """ -+ Mark the semaphore as unused by the given task. -+ -+ :param tsk: task object -+ :type tsk: :py:class:`waflib.Task.Task` -+ :raises: :py:class:`KeyError` in case the resource is not acquired by the task -+ """ -+ self.locking.remove(tsk) -+ -diff --git a/third_party/waf/waflib/TaskGen.py b/third_party/waf/waflib/TaskGen.py -index 40007b55ca7..532b7d5cdb4 100644 ---- a/third_party/waf/waflib/TaskGen.py -+++ b/third_party/waf/waflib/TaskGen.py -@@ -74,7 +74,7 @@ class task_gen(object): - else: - self.bld = kw['bld'] - self.env = self.bld.env.derive() -- self.path = self.bld.path # emulate chdir when reading scripts -+ self.path = kw.get('path', self.bld.path) # by default, emulate chdir when reading scripts - - # Provide a unique index per folder - # This is part of a measure to prevent output file name collisions -@@ -556,7 +556,7 @@ def process_rule(self): - * chmod: permissions for the resulting files (integer value such as Utils.O755) - * shell: set to False to execute the command directly (default is True to use a shell) - * scan: scanner function -- * vars: list of variables to trigger rebuilts, such as CFLAGS -+ * vars: list of variables to trigger rebuilds, such as CFLAGS - * cls_str: string to display when executing the task - * cls_keyword: label to display when executing the task - * cache_rule: by default, try to re-use similar classes, set to False to disable -@@ -727,7 +727,7 @@ def sequence_order(self): - self.bld.prev = self - - --re_m4 = re.compile('@(\w+)@', re.M) -+re_m4 = re.compile(r'@(\w+)@', re.M) - - class subst_pc(Task.Task): - """ -diff --git a/third_party/waf/waflib/Tools/c_config.py b/third_party/waf/waflib/Tools/c_config.py -index 76082152cd9..d546be95614 100644 ---- a/third_party/waf/waflib/Tools/c_config.py -+++ b/third_party/waf/waflib/Tools/c_config.py -@@ -250,9 +250,9 @@ def exec_cfg(self, kw): - :type atleast_pkgconfig_version: string - :param package: package name, for example *gtk+-2.0* - :type package: string -- :param uselib_store: if the test is successful, define HAVE\_*name*. It is also used to define *conf.env.FLAGS_name* variables. -+ :param uselib_store: if the test is successful, define HAVE\\_*name*. It is also used to define *conf.env.FLAGS_name* variables. - :type uselib_store: string -- :param modversion: if provided, return the version of the given module and define *name*\_VERSION -+ :param modversion: if provided, return the version of the given module and define *name*\\_VERSION - :type modversion: string - :param args: arguments to give to *package* when retrieving flags - :type args: list of string -@@ -358,13 +358,12 @@ def check_cfg(self, *k, **kw): - ret = None - try: - ret = self.exec_cfg(kw) -- except self.errors.WafError: -+ except self.errors.WafError as e: - if 'errmsg' in kw: - self.end_msg(kw['errmsg'], 'YELLOW', **kw) - if Logs.verbose > 1: -- raise -- else: -- self.fatal('The configuration failed') -+ self.to_log('Command failure: %s' % e) -+ self.fatal('The configuration failed') - else: - if not ret: - ret = True -diff --git a/third_party/waf/waflib/Tools/c_preproc.py b/third_party/waf/waflib/Tools/c_preproc.py -index c2c239baa26..68e5f5aea29 100644 ---- a/third_party/waf/waflib/Tools/c_preproc.py -+++ b/third_party/waf/waflib/Tools/c_preproc.py -@@ -75,13 +75,13 @@ re_lines = re.compile( - re.IGNORECASE | re.MULTILINE) - """Match #include lines""" - --re_mac = re.compile("^[a-zA-Z_]\w*") -+re_mac = re.compile(r"^[a-zA-Z_]\w*") - """Match macro definitions""" - - re_fun = re.compile('^[a-zA-Z_][a-zA-Z0-9_]*[(]') - """Match macro functions""" - --re_pragma_once = re.compile('^\s*once\s*', re.IGNORECASE) -+re_pragma_once = re.compile(r'^\s*once\s*', re.IGNORECASE) - """Match #pragma once statements""" - - re_nl = re.compile('\\\\\r*\n', re.MULTILINE) -@@ -146,7 +146,7 @@ def repl(m): - - prec = {} - """ --Operator precendence rules required for parsing expressions of the form:: -+Operator precedence rules required for parsing expressions of the form:: - - #if 1 && 2 != 0 - """ -@@ -660,7 +660,7 @@ def extract_macro(txt): - # empty define, assign an empty token - return (v, [[], [('T','')]]) - --re_include = re.compile('^\s*(<(?:.*)>|"(?:.*)")') -+re_include = re.compile(r'^\s*(<(?:.*)>|"(?:.*)")') - def extract_include(txt, defs): - """ - Process a line in the form:: -diff --git a/third_party/waf/waflib/Tools/ccroot.py b/third_party/waf/waflib/Tools/ccroot.py -index 394f36b8e12..579d5b2b72b 100644 ---- a/third_party/waf/waflib/Tools/ccroot.py -+++ b/third_party/waf/waflib/Tools/ccroot.py -@@ -111,7 +111,7 @@ def apply_incpaths(self): - tg = bld(features='includes', includes='.') - - The folders only need to be relative to the current directory, the equivalent build directory is -- added automatically (for headers created in the build directory). This enable using a build directory -+ added automatically (for headers created in the build directory). This enables using a build directory - or not (``top == out``). - - This method will add a list of nodes read by :py:func:`waflib.Tools.ccroot.to_incnodes` in ``tg.env.INCPATHS``, -@@ -161,7 +161,7 @@ class link_task(Task.Task): - nums = self.generator.vnum.split('.') - if self.env.DEST_BINFMT == 'pe': - # include the version in the dll file name, -- # the import lib file name stays unversionned. -+ # the import lib file name stays unversioned. - name = name + '-' + nums[0] - elif self.env.DEST_OS == 'openbsd': - pattern = '%s.%s' % (pattern, nums[0]) -@@ -238,6 +238,17 @@ def rm_tgt(cls): - setattr(cls, 'run', wrap) - rm_tgt(stlink_task) - -+@feature('skip_stlib_link_deps') -+@before_method('process_use') -+def apply_skip_stlib_link_deps(self): -+ """ -+ This enables an optimization in the :py:func:wafilb.Tools.ccroot.processes_use: method that skips dependency and -+ link flag optimizations for targets that generate static libraries (via the :py:class:Tools.ccroot.stlink_task task). -+ The actual behavior is implemented in :py:func:wafilb.Tools.ccroot.processes_use: method so this feature only tells waf -+ to enable the new behavior. -+ """ -+ self.env.SKIP_STLIB_LINK_DEPS = True -+ - @feature('c', 'cxx', 'd', 'fc', 'asm') - @after_method('process_source') - def apply_link(self): -@@ -386,7 +397,11 @@ def process_use(self): - y = self.bld.get_tgen_by_name(x) - var = y.tmp_use_var - if var and link_task: -- if var == 'LIB' or y.tmp_use_stlib or x in names: -+ if self.env.SKIP_STLIB_LINK_DEPS and isinstance(link_task, stlink_task): -+ # If the skip_stlib_link_deps feature is enabled then we should -+ # avoid adding lib deps to the stlink_task instance. -+ pass -+ elif var == 'LIB' or y.tmp_use_stlib or x in names: - self.env.append_value(var, [y.target[y.target.rfind(os.sep) + 1:]]) - self.link_task.dep_nodes.extend(y.link_task.outputs) - tmp_path = y.link_task.outputs[0].parent.path_from(self.get_cwd()) -@@ -600,6 +615,7 @@ def apply_vnum(self): - - if getattr(self, 'install_task', None): - self.install_task.hasrun = Task.SKIPPED -+ self.install_task.no_errcheck_out = True - path = self.install_task.install_to - if self.env.DEST_OS == 'openbsd': - libname = self.link_task.outputs[0].name -diff --git a/third_party/waf/waflib/Tools/d_scan.py b/third_party/waf/waflib/Tools/d_scan.py -index 14c6c313e9a..4e807a6b9fc 100644 ---- a/third_party/waf/waflib/Tools/d_scan.py -+++ b/third_party/waf/waflib/Tools/d_scan.py -@@ -93,8 +93,8 @@ class d_parser(object): - - self.allnames = [] - -- self.re_module = re.compile("module\s+([^;]+)") -- self.re_import = re.compile("import\s+([^;]+)") -+ self.re_module = re.compile(r"module\s+([^;]+)") -+ self.re_import = re.compile(r"import\s+([^;]+)") - self.re_import_bindings = re.compile("([^:]+):(.*)") - self.re_import_alias = re.compile("[^=]+=(.+)") - -@@ -138,7 +138,7 @@ class d_parser(object): - - mod_name = self.re_module.search(code) - if mod_name: -- self.module = re.sub('\s+', '', mod_name.group(1)) # strip all whitespaces -+ self.module = re.sub(r'\s+', '', mod_name.group(1)) # strip all whitespaces - - # go through the code, have a look at all import occurrences - -@@ -146,7 +146,7 @@ class d_parser(object): - import_iterator = self.re_import.finditer(code) - if import_iterator: - for import_match in import_iterator: -- import_match_str = re.sub('\s+', '', import_match.group(1)) # strip all whitespaces -+ import_match_str = re.sub(r'\s+', '', import_match.group(1)) # strip all whitespaces - - # does this end with an import bindings declaration? - # (import bindings always terminate the list of imports) -diff --git a/third_party/waf/waflib/Tools/fc.py b/third_party/waf/waflib/Tools/fc.py -index 621eb5029df..fd4d39c90ae 100644 ---- a/third_party/waf/waflib/Tools/fc.py -+++ b/third_party/waf/waflib/Tools/fc.py -@@ -28,10 +28,24 @@ def modfile(conf, name): - Turns a module name into the right module file name. - Defaults to all lower case. - """ -- return {'lower' :name.lower() + '.mod', -- 'lower.MOD' :name.lower() + '.MOD', -- 'UPPER.mod' :name.upper() + '.mod', -- 'UPPER' :name.upper() + '.MOD'}[conf.env.FC_MOD_CAPITALIZATION or 'lower'] -+ if name.find(':') >= 0: -+ # Depending on a submodule! -+ separator = conf.env.FC_SUBMOD_SEPARATOR or '@' -+ # Ancestors of the submodule will be prefixed to the -+ # submodule name, separated by a colon. -+ modpath = name.split(':') -+ # Only the ancestor (actual) module and the submodule name -+ # will be used for the filename. -+ modname = modpath[0] + separator + modpath[-1] -+ suffix = conf.env.FC_SUBMOD_SUFFIX or '.smod' -+ else: -+ modname = name -+ suffix = '.mod' -+ -+ return {'lower' :modname.lower() + suffix.lower(), -+ 'lower.MOD' :modname.lower() + suffix.upper(), -+ 'UPPER.mod' :modname.upper() + suffix.lower(), -+ 'UPPER' :modname.upper() + suffix.upper()}[conf.env.FC_MOD_CAPITALIZATION or 'lower'] - - def get_fortran_tasks(tsk): - """ -@@ -121,6 +135,8 @@ class fc(Task.Task): - for k in ins.keys(): - for a in ins[k]: - a.run_after.update(outs[k]) -+ for x in outs[k]: -+ self.generator.bld.producer.revdeps[x].add(a) - - # the scanner cannot output nodes, so we have to set them - # ourselves as task.dep_nodes (additional input nodes) -diff --git a/third_party/waf/waflib/Tools/fc_config.py b/third_party/waf/waflib/Tools/fc_config.py -index 0df460b5d1e..dc5e5c9e9a2 100644 ---- a/third_party/waf/waflib/Tools/fc_config.py -+++ b/third_party/waf/waflib/Tools/fc_config.py -@@ -178,8 +178,8 @@ def check_fortran_dummy_main(self, *k, **kw): - # ------------------------------------------------------------------------ - - GCC_DRIVER_LINE = re.compile('^Driving:') --POSIX_STATIC_EXT = re.compile('\S+\.a') --POSIX_LIB_FLAGS = re.compile('-l\S+') -+POSIX_STATIC_EXT = re.compile(r'\S+\.a') -+POSIX_LIB_FLAGS = re.compile(r'-l\S+') - - @conf - def is_link_verbose(self, txt): -@@ -281,7 +281,7 @@ def _parse_flink_token(lexer, token, tmp_flags): - elif POSIX_LIB_FLAGS.match(token): - tmp_flags.append(token) - else: -- # ignore anything not explicitely taken into account -+ # ignore anything not explicitly taken into account - pass - - t = lexer.get_token() -diff --git a/third_party/waf/waflib/Tools/fc_scan.py b/third_party/waf/waflib/Tools/fc_scan.py -index 12cb0fc041e..0824c92b7ee 100644 ---- a/third_party/waf/waflib/Tools/fc_scan.py -+++ b/third_party/waf/waflib/Tools/fc_scan.py -@@ -5,13 +5,15 @@ - - import re - --INC_REGEX = """(?:^|['">]\s*;)\s*(?:|#\s*)INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])""" --USE_REGEX = """(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)""" --MOD_REGEX = """(?:^|;)\s*MODULE(?!\s*PROCEDURE)(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)""" -+INC_REGEX = r"""(?:^|['">]\s*;)\s*(?:|#\s*)INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])""" -+USE_REGEX = r"""(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)""" -+MOD_REGEX = r"""(?:^|;)\s*MODULE(?!\s+(?:PROCEDURE|SUBROUTINE|FUNCTION))\s+(\w+)""" -+SMD_REGEX = r"""(?:^|;)\s*SUBMODULE\s*\(([\w:]+)\)\s*(\w+)""" - - re_inc = re.compile(INC_REGEX, re.I) - re_use = re.compile(USE_REGEX, re.I) - re_mod = re.compile(MOD_REGEX, re.I) -+re_smd = re.compile(SMD_REGEX, re.I) - - class fortran_parser(object): - """ -@@ -58,6 +60,10 @@ class fortran_parser(object): - m = re_mod.search(line) - if m: - mods.append(m.group(1)) -+ m = re_smd.search(line) -+ if m: -+ uses.append(m.group(1)) -+ mods.append('{0}:{1}'.format(m.group(1),m.group(2))) - return (incs, uses, mods) - - def start(self, node): -diff --git a/third_party/waf/waflib/Tools/ifort.py b/third_party/waf/waflib/Tools/ifort.py -index 74934f3f661..17d3052910f 100644 ---- a/third_party/waf/waflib/Tools/ifort.py -+++ b/third_party/waf/waflib/Tools/ifort.py -@@ -107,7 +107,7 @@ def gather_ifort_versions(conf, versions): - """ - List compiler versions by looking up registry keys - """ -- version_pattern = re.compile('^...?.?\....?.?') -+ version_pattern = re.compile(r'^...?.?\....?.?') - try: - all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Compilers\\Fortran') - except OSError: -diff --git a/third_party/waf/waflib/Tools/javaw.py b/third_party/waf/waflib/Tools/javaw.py -index f6fd20cc689..fd1cf469abf 100644 ---- a/third_party/waf/waflib/Tools/javaw.py -+++ b/third_party/waf/waflib/Tools/javaw.py -@@ -24,12 +24,95 @@ You would have to run:: - java -jar /path/to/jython.jar waf configure - - [1] http://www.jython.org/ -+ -+Usage -+===== -+ -+Load the "java" tool. -+ -+def configure(conf): -+ conf.load('java') -+ -+Java tools will be autodetected and eventually, if present, the quite -+standard JAVA_HOME environment variable will be used. The also standard -+CLASSPATH variable is used for library searching. -+ -+In configuration phase checks can be done on the system environment, for -+example to check if a class is known in the classpath:: -+ -+ conf.check_java_class('java.io.FileOutputStream') -+ -+or if the system supports JNI applications building:: -+ -+ conf.check_jni_headers() -+ -+ -+The java tool supports compiling java code, creating jar files and -+creating javadoc documentation. This can be either done separately or -+together in a single definition. For example to manage them separately:: -+ -+ bld(features = 'javac', -+ srcdir = 'src', -+ compat = '1.7', -+ use = 'animals', -+ name = 'cats-src', -+ ) -+ -+ bld(features = 'jar', -+ basedir = '.', -+ destfile = '../cats.jar', -+ name = 'cats', -+ use = 'cats-src' -+ ) -+ -+ -+Or together by defining all the needed attributes:: -+ -+ bld(features = 'javac jar javadoc', -+ srcdir = 'src/', # folder containing the sources to compile -+ outdir = 'src', # folder where to output the classes (in the build directory) -+ compat = '1.6', # java compatibility version number -+ classpath = ['.', '..'], -+ -+ # jar -+ basedir = 'src', # folder containing the classes and other files to package (must match outdir) -+ destfile = 'foo.jar', # do not put the destfile in the folder of the java classes! -+ use = 'NNN', -+ jaropts = ['-C', 'default/src/', '.'], # can be used to give files -+ manifest = 'src/Manifest.mf', # Manifest file to include -+ -+ # javadoc -+ javadoc_package = ['com.meow' , 'com.meow.truc.bar', 'com.meow.truc.foo'], -+ javadoc_output = 'javadoc', -+ ) -+ -+External jar dependencies can be mapped to a standard waf "use" dependency by -+setting an environment variable with a CLASSPATH prefix in the configuration, -+for example:: -+ -+ conf.env.CLASSPATH_NNN = ['aaaa.jar', 'bbbb.jar'] -+ -+and then NNN can be freely used in rules as:: -+ -+ use = 'NNN', -+ -+In the java tool the dependencies via use are not transitive by default, as -+this necessity depends on the code. To enable recursive dependency scanning -+use on a specific rule: -+ -+ recurse_use = True -+ -+Or build-wise by setting RECURSE_JAVA: -+ -+ bld.env.RECURSE_JAVA = True -+ -+Unit tests can be integrated in the waf unit test environment using the javatest extra. - """ - - import os, shutil - from waflib import Task, Utils, Errors, Node - from waflib.Configure import conf --from waflib.TaskGen import feature, before_method, after_method -+from waflib.TaskGen import feature, before_method, after_method, taskgen_method - - from waflib.Tools import ccroot - ccroot.USELIB_VARS['javac'] = set(['CLASSPATH', 'JAVACFLAGS']) -@@ -107,6 +190,37 @@ def apply_java(self): - if names: - tsk.env.append_value('JAVACFLAGS', ['-sourcepath', names]) - -+ -+@taskgen_method -+def java_use_rec(self, name, **kw): -+ """ -+ Processes recursively the *use* attribute for each referred java compilation -+ """ -+ if name in self.tmp_use_seen: -+ return -+ -+ self.tmp_use_seen.append(name) -+ -+ try: -+ y = self.bld.get_tgen_by_name(name) -+ except Errors.WafError: -+ self.uselib.append(name) -+ return -+ else: -+ y.post() -+ # Add generated JAR name for CLASSPATH. Task ordering (set_run_after) -+ # is already guaranteed by ordering done between the single tasks -+ if hasattr(y, 'jar_task'): -+ self.use_lst.append(y.jar_task.outputs[0].abspath()) -+ else: -+ if hasattr(y,'outdir'): -+ self.use_lst.append(y.outdir.abspath()) -+ else: -+ self.use_lst.append(y.path.get_bld().abspath()) -+ -+ for x in self.to_list(getattr(y, 'use', [])): -+ self.java_use_rec(x) -+ - @feature('javac') - @before_method('propagate_uselib_vars') - @after_method('apply_java') -@@ -114,24 +228,39 @@ def use_javac_files(self): - """ - Processes the *use* attribute referring to other java compilations - """ -- lst = [] -+ self.use_lst = [] -+ self.tmp_use_seen = [] - self.uselib = self.to_list(getattr(self, 'uselib', [])) - names = self.to_list(getattr(self, 'use', [])) - get = self.bld.get_tgen_by_name - for x in names: - try: -- y = get(x) -+ tg = get(x) - except Errors.WafError: - self.uselib.append(x) - else: -- y.post() -- if hasattr(y, 'jar_task'): -- lst.append(y.jar_task.outputs[0].abspath()) -- self.javac_task.set_run_after(y.jar_task) -+ tg.post() -+ if hasattr(tg, 'jar_task'): -+ self.use_lst.append(tg.jar_task.outputs[0].abspath()) -+ self.javac_task.set_run_after(tg.jar_task) -+ self.javac_task.dep_nodes.extend(tg.jar_task.outputs) - else: -- for tsk in y.tasks: -+ if hasattr(tg, 'outdir'): -+ base_node = tg.outdir.abspath() -+ else: -+ base_node = tg.path.get_bld() -+ -+ self.use_lst.append(base_node.abspath()) -+ self.javac_task.dep_nodes.extend([x for x in base_node.ant_glob(JAR_RE, remove=False, quiet=True)]) -+ -+ for tsk in tg.tasks: - self.javac_task.set_run_after(tsk) -- self.env.append_value('CLASSPATH', lst) -+ -+ # If recurse use scan is enabled recursively add use attribute for each used one -+ if getattr(self, 'recurse_use', False) or self.bld.env.RECURSE_JAVA: -+ self.java_use_rec(x) -+ -+ self.env.append_value('CLASSPATH', self.use_lst) - - @feature('javac') - @after_method('apply_java', 'propagate_uselib_vars', 'use_javac_files') -@@ -245,7 +374,7 @@ class jar_create(JTask): - return Task.ASK_LATER - if not self.inputs: - try: -- self.inputs = [x for x in self.basedir.ant_glob(JAR_RE, remove=False) if id(x) != id(self.outputs[0])] -+ self.inputs = [x for x in self.basedir.ant_glob(JAR_RE, remove=False, quiet=True) if id(x) != id(self.outputs[0])] - except Exception: - raise Errors.WafError('Could not find the basedir %r for %r' % (self.basedir, self)) - return super(jar_create, self).runnable_status() -@@ -279,14 +408,14 @@ class javac(JTask): - self.inputs = [] - for x in self.srcdir: - if x.exists(): -- self.inputs.extend(x.ant_glob(SOURCE_RE, remove=False)) -+ self.inputs.extend(x.ant_glob(SOURCE_RE, remove=False, quiet=True)) - return super(javac, self).runnable_status() - - def post_run(self): - """ - List class files created - """ -- for node in self.generator.outdir.ant_glob('**/*.class'): -+ for node in self.generator.outdir.ant_glob('**/*.class', quiet=True): - self.generator.bld.node_sigs[node] = self.uid() - self.generator.bld.task_sigs[self.uid()] = self.cache_sig - -@@ -338,7 +467,7 @@ class javadoc(Task.Task): - self.generator.bld.cmd_and_log(lst, cwd=wd, env=env.env or None, quiet=0) - - def post_run(self): -- nodes = self.generator.javadoc_output.ant_glob('**') -+ nodes = self.generator.javadoc_output.ant_glob('**', quiet=True) - for node in nodes: - self.generator.bld.node_sigs[node] = self.uid() - self.generator.bld.task_sigs[self.uid()] = self.cache_sig -@@ -356,7 +485,7 @@ def configure(self): - self.env.JAVA_HOME = [self.environ['JAVA_HOME']] - - for x in 'javac java jar javadoc'.split(): -- self.find_program(x, var=x.upper(), path_list=java_path) -+ self.find_program(x, var=x.upper(), path_list=java_path, mandatory=(x not in ('javadoc'))) - - if 'CLASSPATH' in self.environ: - v.CLASSPATH = self.environ['CLASSPATH'] -diff --git a/third_party/waf/waflib/Tools/md5_tstamp.py b/third_party/waf/waflib/Tools/md5_tstamp.py -index 6428e46024e..d1569fa9ec1 100644 ---- a/third_party/waf/waflib/Tools/md5_tstamp.py -+++ b/third_party/waf/waflib/Tools/md5_tstamp.py -@@ -2,8 +2,10 @@ - # encoding: utf-8 - - """ --Re-calculate md5 hashes of files only when the file times or the file --size have changed. -+Re-calculate md5 hashes of files only when the file time have changed:: -+ -+ def options(opt): -+ opt.load('md5_tstamp') - - The hashes can also reflect either the file contents (STRONGEST=True) or the - file time and file size. -diff --git a/third_party/waf/waflib/Tools/msvc.py b/third_party/waf/waflib/Tools/msvc.py -index 17b347d4583..f169c7f441b 100644 ---- a/third_party/waf/waflib/Tools/msvc.py -+++ b/third_party/waf/waflib/Tools/msvc.py -@@ -281,7 +281,7 @@ def gather_wince_supported_platforms(): - - def gather_msvc_detected_versions(): - #Detected MSVC versions! -- version_pattern = re.compile('^(\d\d?\.\d\d?)(Exp)?$') -+ version_pattern = re.compile(r'^(\d\d?\.\d\d?)(Exp)?$') - detected_versions = [] - for vcver,vcvar in (('VCExpress','Exp'), ('VisualStudio','')): - prefix = 'SOFTWARE\\Wow6432node\\Microsoft\\' + vcver -@@ -367,7 +367,7 @@ def gather_wsdk_versions(conf, versions): - :param versions: list to modify - :type versions: list - """ -- version_pattern = re.compile('^v..?.?\...?.?') -+ version_pattern = re.compile(r'^v..?.?\...?.?') - try: - all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Microsoft\\Microsoft SDKs\\Windows') - except OSError: -@@ -525,7 +525,7 @@ def gather_icl_versions(conf, versions): - :param versions: list to modify - :type versions: list - """ -- version_pattern = re.compile('^...?.?\....?.?') -+ version_pattern = re.compile(r'^...?.?\....?.?') - try: - all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Compilers\\C++') - except OSError: -@@ -579,7 +579,7 @@ def gather_intel_composer_versions(conf, versions): - :param versions: list to modify - :type versions: list - """ -- version_pattern = re.compile('^...?.?\...?.?.?') -+ version_pattern = re.compile(r'^...?.?\...?.?.?') - try: - all_versions = Utils.winreg.OpenKey(Utils.winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Wow6432node\\Intel\\Suites') - except OSError: -@@ -683,7 +683,7 @@ def find_lt_names_msvc(self, libname, is_static=False): - if not is_static and ltdict.get('library_names', ''): - dllnames=ltdict['library_names'].split() - dll=dllnames[0].lower() -- dll=re.sub('\.dll$', '', dll) -+ dll=re.sub(r'\.dll$', '', dll) - return (lt_libdir, dll, False) - elif ltdict.get('old_library', ''): - olib=ltdict['old_library'] -@@ -700,7 +700,7 @@ def find_lt_names_msvc(self, libname, is_static=False): - @conf - def libname_msvc(self, libname, is_static=False): - lib = libname.lower() -- lib = re.sub('\.lib$','',lib) -+ lib = re.sub(r'\.lib$','',lib) - - if lib in g_msvc_systemlibs: - return lib -@@ -747,11 +747,11 @@ def libname_msvc(self, libname, is_static=False): - for libn in libnames: - if os.path.exists(os.path.join(path, libn)): - Logs.debug('msvc: lib found: %s', os.path.join(path,libn)) -- return re.sub('\.lib$', '',libn) -+ return re.sub(r'\.lib$', '',libn) - - #if no lib can be found, just return the libname as msvc expects it - self.fatal('The library %r could not be found' % libname) -- return re.sub('\.lib$', '', libname) -+ return re.sub(r'\.lib$', '', libname) - - @conf - def check_lib_msvc(self, libname, is_static=False, uselib_store=None): -@@ -969,7 +969,7 @@ def apply_flags_msvc(self): - if not is_static: - for f in self.env.LINKFLAGS: - d = f.lower() -- if d[1:] == 'debug': -+ if d[1:] in ('debug', 'debug:full', 'debug:fastlink'): - pdbnode = self.link_task.outputs[0].change_ext('.pdb') - self.link_task.outputs.append(pdbnode) - -diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py -index 52a05c668e3..63a8917d7c1 100644 ---- a/third_party/waf/waflib/Tools/python.py -+++ b/third_party/waf/waflib/Tools/python.py -@@ -329,6 +329,10 @@ def check_python_headers(conf, features='pyembed pyext'): - conf.find_program([''.join(pybin) + '-config', 'python%s-config' % num, 'python-config-%s' % num, 'python%sm-config' % num], var='PYTHON_CONFIG', msg="python-config", mandatory=False) - - if env.PYTHON_CONFIG: -+ # check python-config output only once -+ if conf.env.HAVE_PYTHON_H: -+ return -+ - # python2.6-config requires 3 runs - all_flags = [['--cflags', '--libs', '--ldflags']] - if sys.hexversion < 0x2070000: -@@ -338,7 +342,13 @@ def check_python_headers(conf, features='pyembed pyext'): - - if 'pyembed' in features: - for flags in all_flags: -- conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(flags), path=env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=flags) -+ # Python 3.8 has different flags for pyembed, needs --embed -+ embedflags = flags + ['--embed'] -+ try: -+ conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(embedflags), path=env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=embedflags) -+ except conf.errors.ConfigurationError: -+ # However Python < 3.8 doesn't accept --embed, so we need a fallback -+ conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(flags), path=env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=flags) - - try: - conf.test_pyembed(xx) -@@ -446,9 +456,9 @@ def check_python_version(conf, minver=None): - Check if the python interpreter is found matching a given minimum version. - minver should be a tuple, eg. to check for python >= 2.4.2 pass (2,4,2) as minver. - -- If successful, PYTHON_VERSION is defined as 'MAJOR.MINOR' -- (eg. '2.4') of the actual python version found, and PYTHONDIR is -- defined, pointing to the site-packages directory appropriate for -+ If successful, PYTHON_VERSION is defined as 'MAJOR.MINOR' (eg. '2.4') -+ of the actual python version found, and PYTHONDIR and PYTHONARCHDIR -+ are defined, pointing to the site-packages directories appropriate for - this python version, where modules/packages/extensions should be - installed. - -diff --git a/third_party/waf/waflib/Tools/qt5.py b/third_party/waf/waflib/Tools/qt5.py -index 4f9c6908fc5..287c25374a4 100644 ---- a/third_party/waf/waflib/Tools/qt5.py -+++ b/third_party/waf/waflib/Tools/qt5.py -@@ -74,7 +74,7 @@ else: - - import os, sys, re - from waflib.Tools import cxx --from waflib import Task, Utils, Options, Errors, Context -+from waflib import Build, Task, Utils, Options, Errors, Context - from waflib.TaskGen import feature, after_method, extension, before_method - from waflib.Configure import conf - from waflib import Logs -@@ -167,6 +167,10 @@ class qxx(Task.classes['cxx']): - node = self.inputs[0] - bld = self.generator.bld - -+ # skip on uninstall due to generated files -+ if bld.is_install == Build.UNINSTALL: -+ return -+ - try: - # compute the signature once to know if there is a moc file to create - self.signature() -@@ -313,11 +317,11 @@ def apply_qt5(self): - - The additional parameters are: - -- :param lang: list of translation files (\*.ts) to process -+ :param lang: list of translation files (\\*.ts) to process - :type lang: list of :py:class:`waflib.Node.Node` or string without the .ts extension -- :param update: whether to process the C++ files to update the \*.ts files (use **waf --translate**) -+ :param update: whether to process the C++ files to update the \\*.ts files (use **waf --translate**) - :type update: bool -- :param langname: if given, transform the \*.ts files into a .qrc files to include in the binary file -+ :param langname: if given, transform the \\*.ts files into a .qrc files to include in the binary file - :type langname: :py:class:`waflib.Node.Node` or string without the .qrc extension - """ - if getattr(self, 'lang', None): -@@ -762,7 +766,7 @@ def set_qt5_libs_to_check(self): - if self.environ.get('QT5_FORCE_STATIC'): - pat = self.env.cxxstlib_PATTERN - if Utils.unversioned_sys_platform() == 'darwin': -- pat = "%s\.framework" -+ pat = r"%s\.framework" - re_qt = re.compile(pat%'Qt5?(?P.*)'+'$') - for x in dirlst: - m = re_qt.match(x) -diff --git a/third_party/waf/waflib/Tools/waf_unit_test.py b/third_party/waf/waflib/Tools/waf_unit_test.py -index a71ed1c0909..6ff6f72739f 100644 ---- a/third_party/waf/waflib/Tools/waf_unit_test.py -+++ b/third_party/waf/waflib/Tools/waf_unit_test.py -@@ -205,7 +205,7 @@ class utest(Task.Task): - return self.exec_command(self.ut_exec) - - def exec_command(self, cmd, **kw): -- Logs.debug('runner: %r', cmd) -+ self.generator.bld.log_command(cmd, kw) - if getattr(Options.options, 'dump_test_scripts', False): - script_code = SCRIPT_TEMPLATE % { - 'python': sys.executable, -@@ -214,7 +214,7 @@ class utest(Task.Task): - 'cmd': cmd - } - script_file = self.inputs[0].abspath() + '_run.py' -- Utils.writef(script_file, script_code) -+ Utils.writef(script_file, script_code, encoding='utf-8') - os.chmod(script_file, Utils.O755) - if Logs.verbose > 1: - Logs.info('Test debug file written as %r' % script_file) -diff --git a/third_party/waf/waflib/Tools/winres.py b/third_party/waf/waflib/Tools/winres.py -index 586c596cf93..9be1ed66009 100644 ---- a/third_party/waf/waflib/Tools/winres.py -+++ b/third_party/waf/waflib/Tools/winres.py -@@ -24,8 +24,8 @@ def rc_file(self, node): - self.compiled_tasks = [rctask] - - re_lines = re.compile( -- '(?:^[ \t]*(#|%:)[ \t]*(ifdef|ifndef|if|else|elif|endif|include|import|define|undef|pragma)[ \t]*(.*?)\s*$)|'\ -- '(?:^\w+[ \t]*(ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)[ \t]*(.*?)\s*$)', -+ r'(?:^[ \t]*(#|%:)[ \t]*(ifdef|ifndef|if|else|elif|endif|include|import|define|undef|pragma)[ \t]*(.*?)\s*$)|'\ -+ r'(?:^\w+[ \t]*(ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)[ \t]*(.*?)\s*$)', - re.IGNORECASE | re.MULTILINE) - - class rc_parser(c_preproc.c_parser): -diff --git a/third_party/waf/waflib/Utils.py b/third_party/waf/waflib/Utils.py -index b4665c4dc2b..7472226da58 100644 ---- a/third_party/waf/waflib/Utils.py -+++ b/third_party/waf/waflib/Utils.py -@@ -49,10 +49,16 @@ try: - from hashlib import md5 - except ImportError: - try: -- from md5 import md5 -+ from hashlib import sha1 as md5 - except ImportError: -- # never fail to enable fixes from another module -+ # never fail to enable potential fixes from another module - pass -+else: -+ try: -+ md5().digest() -+ except ValueError: -+ # Fips? #2213 -+ from hashlib import sha1 as md5 - - try: - import threading -@@ -202,7 +208,7 @@ class lazy_generator(object): - - next = __next__ - --is_win32 = os.sep == '\\' or sys.platform == 'win32' # msys2 -+is_win32 = os.sep == '\\' or sys.platform == 'win32' or os.name == 'nt' # msys2 - """ - Whether this system is a Windows series - """ -@@ -484,7 +490,9 @@ def split_path_msys(path): - if sys.platform == 'cygwin': - split_path = split_path_cygwin - elif is_win32: -- if os.environ.get('MSYSTEM'): -+ # Consider this an MSYSTEM environment if $MSYSTEM is set and python -+ # reports is executable from a unix like path on a windows host. -+ if os.environ.get('MSYSTEM') and sys.executable.startswith('/'): - split_path = split_path_msys - else: - split_path = split_path_win32 -@@ -596,6 +604,12 @@ def h_list(lst): - """ - return md5(repr(lst).encode()).digest() - -+if sys.hexversion < 0x3000000: -+ def h_list_python2(lst): -+ return md5(repr(lst)).digest() -+ h_list_python2.__doc__ = h_list.__doc__ -+ h_list = h_list_python2 -+ - def h_fun(fun): - """ - Hash functions -@@ -730,7 +744,7 @@ def unversioned_sys_platform(): - if s == 'cli' and os.name == 'nt': - # ironpython is only on windows as far as we know - return 'win32' -- return re.split('\d+$', s)[0] -+ return re.split(r'\d+$', s)[0] - - def nada(*k, **kw): - """ -@@ -871,7 +885,7 @@ def get_process(): - except IndexError: - filepath = os.path.dirname(os.path.abspath(__file__)) + os.sep + 'processor.py' - cmd = [sys.executable, '-c', readf(filepath)] -- return subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, bufsize=0) -+ return subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, bufsize=0, close_fds=not is_win32) - - def run_prefork_process(cmd, kwargs, cargs): - """ -diff --git a/third_party/waf/waflib/ansiterm.py b/third_party/waf/waflib/ansiterm.py -index 0d20c6374b7..027f0ad68a3 100644 ---- a/third_party/waf/waflib/ansiterm.py -+++ b/third_party/waf/waflib/ansiterm.py -@@ -264,7 +264,7 @@ else: - 'u': pop_cursor, - } - # Match either the escape sequence or text not containing escape sequence -- ansi_tokens = re.compile('(?:\x1b\[([0-9?;]*)([a-zA-Z])|([^\x1b]+))') -+ ansi_tokens = re.compile(r'(?:\x1b\[([0-9?;]*)([a-zA-Z])|([^\x1b]+))') - def write(self, text): - try: - wlock.acquire() -diff --git a/third_party/waf/waflib/extras/buildcopy.py b/third_party/waf/waflib/extras/buildcopy.py -index a6d9ac83114..eaff7e605a6 100644 ---- a/third_party/waf/waflib/extras/buildcopy.py -+++ b/third_party/waf/waflib/extras/buildcopy.py -@@ -22,7 +22,7 @@ Examples:: - - """ - import os, shutil --from waflib import Errors, Task, TaskGen, Utils, Node -+from waflib import Errors, Task, TaskGen, Utils, Node, Logs - - @TaskGen.before_method('process_source') - @TaskGen.feature('buildcopy') -@@ -58,10 +58,13 @@ def make_buildcopy(self): - raise Errors.WafError('buildcopy: File not found in src: %s'%os.path.join(*lst)) - - nodes = [ to_src_nodes(n) for n in getattr(self, 'buildcopy_source', getattr(self, 'source', [])) ] -+ if not nodes: -+ Logs.warn('buildcopy: No source files provided to buildcopy in %s (set `buildcopy_source` or `source`)', -+ self) -+ return - node_pairs = [(n, n.get_bld()) for n in nodes] - self.create_task('buildcopy', [n[0] for n in node_pairs], [n[1] for n in node_pairs], node_pairs=node_pairs) - -- - class buildcopy(Task.Task): - """ - Copy for each pair `n` in `node_pairs`: n[0] -> n[1]. -diff --git a/third_party/waf/waflib/extras/clang_cross.py b/third_party/waf/waflib/extras/clang_cross.py -new file mode 100644 -index 00000000000..1b51e2886cb ---- /dev/null -+++ b/third_party/waf/waflib/extras/clang_cross.py -@@ -0,0 +1,92 @@ -+#!/usr/bin/env python -+# encoding: utf-8 -+# Krzysztof Kosiński 2014 -+# DragoonX6 2018 -+ -+""" -+Detect the Clang C compiler -+This version is an attempt at supporting the -target and -sysroot flag of Clang. -+""" -+ -+from waflib.Tools import ccroot, ar, gcc -+from waflib.Configure import conf -+import waflib.Context -+import waflib.extras.clang_cross_common -+ -+def options(opt): -+ """ -+ Target triplet for clang:: -+ $ waf configure --clang-target-triple=x86_64-pc-linux-gnu -+ """ -+ cc_compiler_opts = opt.add_option_group('Configuration options') -+ cc_compiler_opts.add_option('--clang-target-triple', default=None, -+ help='Target triple for clang', -+ dest='clang_target_triple') -+ cc_compiler_opts.add_option('--clang-sysroot', default=None, -+ help='Sysroot for clang', -+ dest='clang_sysroot') -+ -+@conf -+def find_clang(conf): -+ """ -+ Finds the program clang and executes it to ensure it really is clang -+ """ -+ -+ import os -+ -+ cc = conf.find_program('clang', var='CC') -+ -+ if conf.options.clang_target_triple != None: -+ conf.env.append_value('CC', ['-target', conf.options.clang_target_triple]) -+ -+ if conf.options.clang_sysroot != None: -+ sysroot = str() -+ -+ if os.path.isabs(conf.options.clang_sysroot): -+ sysroot = conf.options.clang_sysroot -+ else: -+ sysroot = os.path.normpath(os.path.join(os.getcwd(), conf.options.clang_sysroot)) -+ -+ conf.env.append_value('CC', ['--sysroot', sysroot]) -+ -+ conf.get_cc_version(cc, clang=True) -+ conf.env.CC_NAME = 'clang' -+ -+@conf -+def clang_modifier_x86_64_w64_mingw32(conf): -+ conf.gcc_modifier_win32() -+ -+@conf -+def clang_modifier_i386_w64_mingw32(conf): -+ conf.gcc_modifier_win32() -+ -+@conf -+def clang_modifier_x86_64_windows_msvc(conf): -+ conf.clang_modifier_msvc() -+ -+ # Allow the user to override any flags if they so desire. -+ clang_modifier_user_func = getattr(conf, 'clang_modifier_x86_64_windows_msvc_user', None) -+ if clang_modifier_user_func: -+ clang_modifier_user_func() -+ -+@conf -+def clang_modifier_i386_windows_msvc(conf): -+ conf.clang_modifier_msvc() -+ -+ # Allow the user to override any flags if they so desire. -+ clang_modifier_user_func = getattr(conf, 'clang_modifier_i386_windows_msvc_user', None) -+ if clang_modifier_user_func: -+ clang_modifier_user_func() -+ -+def configure(conf): -+ conf.find_clang() -+ conf.find_program(['llvm-ar', 'ar'], var='AR') -+ conf.find_ar() -+ conf.gcc_common_flags() -+ # Allow the user to provide flags for the target platform. -+ conf.gcc_modifier_platform() -+ # And allow more fine grained control based on the compiler's triplet. -+ conf.clang_modifier_target_triple() -+ conf.cc_load_tools() -+ conf.cc_add_flags() -+ conf.link_add_flags() -diff --git a/third_party/waf/waflib/extras/clang_cross_common.py b/third_party/waf/waflib/extras/clang_cross_common.py -new file mode 100644 -index 00000000000..b76a070065c ---- /dev/null -+++ b/third_party/waf/waflib/extras/clang_cross_common.py -@@ -0,0 +1,113 @@ -+#!/usr/bin/env python -+# encoding: utf-8 -+# DragoonX6 2018 -+ -+""" -+Common routines for cross_clang.py and cross_clangxx.py -+""" -+ -+from waflib.Configure import conf -+import waflib.Context -+ -+def normalize_target_triple(target_triple): -+ target_triple = target_triple[:-1] -+ normalized_triple = target_triple.replace('--', '-unknown-') -+ -+ if normalized_triple.startswith('-'): -+ normalized_triple = 'unknown' + normalized_triple -+ -+ if normalized_triple.endswith('-'): -+ normalized_triple += 'unknown' -+ -+ # Normalize MinGW builds to *arch*-w64-mingw32 -+ if normalized_triple.endswith('windows-gnu'): -+ normalized_triple = normalized_triple[:normalized_triple.index('-')] + '-w64-mingw32' -+ -+ # Strip the vendor when doing msvc builds, since it's unused anyway. -+ if normalized_triple.endswith('windows-msvc'): -+ normalized_triple = normalized_triple[:normalized_triple.index('-')] + '-windows-msvc' -+ -+ return normalized_triple.replace('-', '_') -+ -+@conf -+def clang_modifier_msvc(conf): -+ import os -+ -+ """ -+ Really basic setup to use clang in msvc mode. -+ We actually don't really want to do a lot, even though clang is msvc compatible -+ in this mode, that doesn't mean we're actually using msvc. -+ It's probably the best to leave it to the user, we can assume msvc mode if the user -+ uses the clang-cl frontend, but this module only concerns itself with the gcc-like frontend. -+ """ -+ v = conf.env -+ v.cprogram_PATTERN = '%s.exe' -+ -+ v.cshlib_PATTERN = '%s.dll' -+ v.implib_PATTERN = '%s.lib' -+ v.IMPLIB_ST = '-Wl,-IMPLIB:%s' -+ v.SHLIB_MARKER = [] -+ -+ v.CFLAGS_cshlib = [] -+ v.LINKFLAGS_cshlib = ['-Wl,-DLL'] -+ v.cstlib_PATTERN = '%s.lib' -+ v.STLIB_MARKER = [] -+ -+ del(v.AR) -+ conf.find_program(['llvm-lib', 'lib'], var='AR') -+ v.ARFLAGS = ['-nologo'] -+ v.AR_TGT_F = ['-out:'] -+ -+ # Default to the linker supplied with llvm instead of link.exe or ld -+ v.LINK_CC = v.CC + ['-fuse-ld=lld', '-nostdlib'] -+ v.CCLNK_TGT_F = ['-o'] -+ v.def_PATTERN = '-Wl,-def:%s' -+ -+ v.LINKFLAGS = [] -+ -+ v.LIB_ST = '-l%s' -+ v.LIBPATH_ST = '-Wl,-LIBPATH:%s' -+ v.STLIB_ST = '-l%s' -+ v.STLIBPATH_ST = '-Wl,-LIBPATH:%s' -+ -+ CFLAGS_CRT_COMMON = [ -+ '-Xclang', '--dependent-lib=oldnames', -+ '-Xclang', '-fno-rtti-data', -+ '-D_MT' -+ ] -+ -+ v.CFLAGS_CRT_MULTITHREADED = CFLAGS_CRT_COMMON + [ -+ '-Xclang', '-flto-visibility-public-std', -+ '-Xclang', '--dependent-lib=libcmt', -+ ] -+ v.CXXFLAGS_CRT_MULTITHREADED = v.CFLAGS_CRT_MULTITHREADED -+ -+ v.CFLAGS_CRT_MULTITHREADED_DBG = CFLAGS_CRT_COMMON + [ -+ '-D_DEBUG', -+ '-Xclang', '-flto-visibility-public-std', -+ '-Xclang', '--dependent-lib=libcmtd', -+ ] -+ v.CXXFLAGS_CRT_MULTITHREADED_DBG = v.CFLAGS_CRT_MULTITHREADED_DBG -+ -+ v.CFLAGS_CRT_MULTITHREADED_DLL = CFLAGS_CRT_COMMON + [ -+ '-D_DLL', -+ '-Xclang', '--dependent-lib=msvcrt' -+ ] -+ v.CXXFLAGS_CRT_MULTITHREADED_DLL = v.CFLAGS_CRT_MULTITHREADED_DLL -+ -+ v.CFLAGS_CRT_MULTITHREADED_DLL_DBG = CFLAGS_CRT_COMMON + [ -+ '-D_DLL', -+ '-D_DEBUG', -+ '-Xclang', '--dependent-lib=msvcrtd', -+ ] -+ v.CXXFLAGS_CRT_MULTITHREADED_DLL_DBG = v.CFLAGS_CRT_MULTITHREADED_DLL_DBG -+ -+@conf -+def clang_modifier_target_triple(conf, cpp=False): -+ compiler = conf.env.CXX if cpp else conf.env.CC -+ output = conf.cmd_and_log(compiler + ['-dumpmachine'], output=waflib.Context.STDOUT) -+ -+ modifier = ('clangxx' if cpp else 'clang') + '_modifier_' -+ clang_modifier_func = getattr(conf, modifier + normalize_target_triple(output), None) -+ if clang_modifier_func: -+ clang_modifier_func() -diff --git a/third_party/waf/waflib/extras/clangxx_cross.py b/third_party/waf/waflib/extras/clangxx_cross.py -new file mode 100644 -index 00000000000..0ad38ad46c0 ---- /dev/null -+++ b/third_party/waf/waflib/extras/clangxx_cross.py -@@ -0,0 +1,106 @@ -+#!/usr/bin/env python -+# encoding: utf-8 -+# Thomas Nagy 2009-2018 (ita) -+# DragoonX6 2018 -+ -+""" -+Detect the Clang++ C++ compiler -+This version is an attempt at supporting the -target and -sysroot flag of Clang++. -+""" -+ -+from waflib.Tools import ccroot, ar, gxx -+from waflib.Configure import conf -+import waflib.extras.clang_cross_common -+ -+def options(opt): -+ """ -+ Target triplet for clang++:: -+ $ waf configure --clangxx-target-triple=x86_64-pc-linux-gnu -+ """ -+ cxx_compiler_opts = opt.add_option_group('Configuration options') -+ cxx_compiler_opts.add_option('--clangxx-target-triple', default=None, -+ help='Target triple for clang++', -+ dest='clangxx_target_triple') -+ cxx_compiler_opts.add_option('--clangxx-sysroot', default=None, -+ help='Sysroot for clang++', -+ dest='clangxx_sysroot') -+ -+@conf -+def find_clangxx(conf): -+ """ -+ Finds the program clang++, and executes it to ensure it really is clang++ -+ """ -+ -+ import os -+ -+ cxx = conf.find_program('clang++', var='CXX') -+ -+ if conf.options.clangxx_target_triple != None: -+ conf.env.append_value('CXX', ['-target', conf.options.clangxx_target_triple]) -+ -+ if conf.options.clangxx_sysroot != None: -+ sysroot = str() -+ -+ if os.path.isabs(conf.options.clangxx_sysroot): -+ sysroot = conf.options.clangxx_sysroot -+ else: -+ sysroot = os.path.normpath(os.path.join(os.getcwd(), conf.options.clangxx_sysroot)) -+ -+ conf.env.append_value('CXX', ['--sysroot', sysroot]) -+ -+ conf.get_cc_version(cxx, clang=True) -+ conf.env.CXX_NAME = 'clang' -+ -+@conf -+def clangxx_modifier_x86_64_w64_mingw32(conf): -+ conf.gcc_modifier_win32() -+ -+@conf -+def clangxx_modifier_i386_w64_mingw32(conf): -+ conf.gcc_modifier_win32() -+ -+@conf -+def clangxx_modifier_msvc(conf): -+ v = conf.env -+ v.cxxprogram_PATTERN = v.cprogram_PATTERN -+ v.cxxshlib_PATTERN = v.cshlib_PATTERN -+ -+ v.CXXFLAGS_cxxshlib = [] -+ v.LINKFLAGS_cxxshlib = v.LINKFLAGS_cshlib -+ v.cxxstlib_PATTERN = v.cstlib_PATTERN -+ -+ v.LINK_CXX = v.CXX + ['-fuse-ld=lld', '-nostdlib'] -+ v.CXXLNK_TGT_F = v.CCLNK_TGT_F -+ -+@conf -+def clangxx_modifier_x86_64_windows_msvc(conf): -+ conf.clang_modifier_msvc() -+ conf.clangxx_modifier_msvc() -+ -+ # Allow the user to override any flags if they so desire. -+ clang_modifier_user_func = getattr(conf, 'clangxx_modifier_x86_64_windows_msvc_user', None) -+ if clang_modifier_user_func: -+ clang_modifier_user_func() -+ -+@conf -+def clangxx_modifier_i386_windows_msvc(conf): -+ conf.clang_modifier_msvc() -+ conf.clangxx_modifier_msvc() -+ -+ # Allow the user to override any flags if they so desire. -+ clang_modifier_user_func = getattr(conf, 'clangxx_modifier_i386_windows_msvc_user', None) -+ if clang_modifier_user_func: -+ clang_modifier_user_func() -+ -+def configure(conf): -+ conf.find_clangxx() -+ conf.find_program(['llvm-ar', 'ar'], var='AR') -+ conf.find_ar() -+ conf.gxx_common_flags() -+ # Allow the user to provide flags for the target platform. -+ conf.gxx_modifier_platform() -+ # And allow more fine grained control based on the compiler's triplet. -+ conf.clang_modifier_target_triple(cpp=True) -+ conf.cxx_load_tools() -+ conf.cxx_add_flags() -+ conf.link_add_flags() -diff --git a/third_party/waf/waflib/extras/color_msvc.py b/third_party/waf/waflib/extras/color_msvc.py -new file mode 100644 -index 00000000000..60bacb7b240 ---- /dev/null -+++ b/third_party/waf/waflib/extras/color_msvc.py -@@ -0,0 +1,59 @@ -+#!/usr/bin/env python -+# encoding: utf-8 -+ -+# Replaces the default formatter by one which understands MSVC output and colorizes it. -+# Modified from color_gcc.py -+ -+__author__ = __maintainer__ = "Alibek Omarov " -+__copyright__ = "Alibek Omarov, 2019" -+ -+import sys -+from waflib import Logs -+ -+class ColorMSVCFormatter(Logs.formatter): -+ def __init__(self, colors): -+ self.colors = colors -+ Logs.formatter.__init__(self) -+ -+ def parseMessage(self, line, color): -+ # Split messaage from 'disk:filepath: type: message' -+ arr = line.split(':', 3) -+ if len(arr) < 4: -+ return line -+ -+ colored = self.colors.BOLD + arr[0] + ':' + arr[1] + ':' + self.colors.NORMAL -+ colored += color + arr[2] + ':' + self.colors.NORMAL -+ colored += arr[3] -+ return colored -+ -+ def format(self, rec): -+ frame = sys._getframe() -+ while frame: -+ func = frame.f_code.co_name -+ if func == 'exec_command': -+ cmd = frame.f_locals.get('cmd') -+ if isinstance(cmd, list): -+ # Fix file case, it may be CL.EXE or cl.exe -+ argv0 = cmd[0].lower() -+ if 'cl.exe' in argv0: -+ lines = [] -+ # This will not work with "localized" versions -+ # of MSVC -+ for line in rec.msg.splitlines(): -+ if ': warning ' in line: -+ lines.append(self.parseMessage(line, self.colors.YELLOW)) -+ elif ': error ' in line: -+ lines.append(self.parseMessage(line, self.colors.RED)) -+ elif ': fatal error ' in line: -+ lines.append(self.parseMessage(line, self.colors.RED + self.colors.BOLD)) -+ elif ': note: ' in line: -+ lines.append(self.parseMessage(line, self.colors.CYAN)) -+ else: -+ lines.append(line) -+ rec.msg = "\n".join(lines) -+ frame = frame.f_back -+ return Logs.formatter.format(self, rec) -+ -+def options(opt): -+ Logs.log.handlers[0].setFormatter(ColorMSVCFormatter(Logs.colors)) -+ -diff --git a/third_party/waf/waflib/extras/cppcheck.py b/third_party/waf/waflib/extras/cppcheck.py -index 43dc544df73..13ff42477fd 100644 ---- a/third_party/waf/waflib/extras/cppcheck.py -+++ b/third_party/waf/waflib/extras/cppcheck.py -@@ -205,11 +205,17 @@ def _tgen_create_cmd(self): - args.append('--enable=%s' % lib_enable) - - for src in self.to_list(getattr(self, 'source', [])): -- args.append('%r' % src) -+ if not isinstance(src, str): -+ src = repr(src) -+ args.append(src) - for inc in self.to_incnodes(self.to_list(getattr(self, 'includes', []))): -- args.append('-I%r' % inc) -+ if not isinstance(inc, str): -+ inc = repr(inc) -+ args.append('-I%s' % inc) - for inc in self.to_incnodes(self.to_list(self.env.INCLUDES)): -- args.append('-I%r' % inc) -+ if not isinstance(inc, str): -+ inc = repr(inc) -+ args.append('-I%s' % inc) - return cmd + args - - -diff --git a/third_party/waf/waflib/extras/cpplint.py b/third_party/waf/waflib/extras/cpplint.py -index fc914c2450b..8cdd6ddacb3 100644 ---- a/third_party/waf/waflib/extras/cpplint.py -+++ b/third_party/waf/waflib/extras/cpplint.py -@@ -38,26 +38,25 @@ When using this tool, the wscript will look like: - from __future__ import absolute_import - import sys, re - import logging --import threading --from waflib import Task, TaskGen, Logs, Options, Node --try: -- import cpplint.cpplint as cpplint_tool --except ImportError: -- try: -- import cpplint as cpplint_tool -- except ImportError: -- pass -+from waflib import Errors, Task, TaskGen, Logs, Options, Node, Utils - - - critical_errors = 0 - CPPLINT_FORMAT = '[CPPLINT] %(filename)s:\nline %(linenum)s, severity %(confidence)s, category: %(category)s\n%(message)s\n' --RE_EMACS = re.compile('(?P.*):(?P\d+): (?P.*) \[(?P.*)\] \[(?P\d+)\]') -+RE_EMACS = re.compile(r'(?P.*):(?P\d+): (?P.*) \[(?P.*)\] \[(?P\d+)\]') - CPPLINT_RE = { - 'waf': RE_EMACS, - 'emacs': RE_EMACS, -- 'vs7': re.compile('(?P.*)\((?P\d+)\): (?P.*) \[(?P.*)\] \[(?P\d+)\]'), -- 'eclipse': re.compile('(?P.*):(?P\d+): warning: (?P.*) \[(?P.*)\] \[(?P\d+)\]'), -+ 'vs7': re.compile(r'(?P.*)\((?P\d+)\): (?P.*) \[(?P.*)\] \[(?P\d+)\]'), -+ 'eclipse': re.compile(r'(?P.*):(?P\d+): warning: (?P.*) \[(?P.*)\] \[(?P\d+)\]'), - } -+CPPLINT_STR = ('${CPPLINT} ' -+ '--verbose=${CPPLINT_LEVEL} ' -+ '--output=${CPPLINT_OUTPUT} ' -+ '--filter=${CPPLINT_FILTERS} ' -+ '--root=${CPPLINT_ROOT} ' -+ '--linelength=${CPPLINT_LINE_LENGTH} ') -+ - - def options(opt): - opt.add_option('--cpplint-filters', type='string', -@@ -71,24 +70,21 @@ def options(opt): - opt.add_option('--cpplint-break', default=5, type='int', dest='CPPLINT_BREAK', - help='break the build if error >= level (default: 5)') - opt.add_option('--cpplint-root', type='string', -- default=None, dest='CPPLINT_ROOT', -+ default='', dest='CPPLINT_ROOT', - help='root directory used to derive header guard') - opt.add_option('--cpplint-skip', action='store_true', - default=False, dest='CPPLINT_SKIP', - help='skip cpplint during build') - opt.add_option('--cpplint-output', type='string', - default='waf', dest='CPPLINT_OUTPUT', -- help='select output format (waf, emacs, vs7)') -+ help='select output format (waf, emacs, vs7, eclipse)') - - - def configure(conf): -- conf.start_msg('Checking cpplint') - try: -- cpplint_tool._cpplint_state -- conf.end_msg('ok') -- except NameError: -+ conf.find_program('cpplint', var='CPPLINT') -+ except Errors.ConfigurationError: - conf.env.CPPLINT_SKIP = True -- conf.end_msg('not found, skipping it.') - - - class cpplint_formatter(Logs.formatter, object): -@@ -117,34 +113,22 @@ class cpplint_handler(Logs.log_handler, object): - - - class cpplint_wrapper(object): -- stream = None -- tasks_count = 0 -- lock = threading.RLock() -- - def __init__(self, logger, threshold, fmt): - self.logger = logger - self.threshold = threshold -- self.error_count = 0 - self.fmt = fmt - - def __enter__(self): -- with cpplint_wrapper.lock: -- cpplint_wrapper.tasks_count += 1 -- if cpplint_wrapper.tasks_count == 1: -- sys.stderr.flush() -- cpplint_wrapper.stream = sys.stderr -- sys.stderr = self -- return self -+ return self - - def __exit__(self, exc_type, exc_value, traceback): -- with cpplint_wrapper.lock: -- cpplint_wrapper.tasks_count -= 1 -- if cpplint_wrapper.tasks_count == 0: -- sys.stderr = cpplint_wrapper.stream -- sys.stderr.flush() -- -- def isatty(self): -- return True -+ if isinstance(exc_value, Utils.subprocess.CalledProcessError): -+ messages = [m for m in exc_value.output.splitlines() -+ if 'Done processing' not in m -+ and 'Total errors found' not in m] -+ for message in messages: -+ self.write(message) -+ return True - - def write(self, message): - global critical_errors -@@ -184,12 +168,15 @@ class cpplint(Task.Task): - def run(self): - global critical_errors - with cpplint_wrapper(get_cpplint_logger(self.env.CPPLINT_OUTPUT), self.env.CPPLINT_BREAK, self.env.CPPLINT_OUTPUT): -- if self.env.CPPLINT_OUTPUT != 'waf': -- cpplint_tool._SetOutputFormat(self.env.CPPLINT_OUTPUT) -- cpplint_tool._SetFilters(self.env.CPPLINT_FILTERS) -- cpplint_tool._line_length = self.env.CPPLINT_LINE_LENGTH -- cpplint_tool._root = self.env.CPPLINT_ROOT -- cpplint_tool.ProcessFile(self.inputs[0].abspath(), self.env.CPPLINT_LEVEL) -+ params = {key: str(self.env[key]) for key in self.env if 'CPPLINT_' in key} -+ if params['CPPLINT_OUTPUT'] is 'waf': -+ params['CPPLINT_OUTPUT'] = 'emacs' -+ params['CPPLINT'] = self.env.get_flat('CPPLINT') -+ cmd = Utils.subst_vars(CPPLINT_STR, params) -+ env = self.env.env or None -+ Utils.subprocess.check_output(cmd + self.inputs[0].abspath(), -+ stderr=Utils.subprocess.STDOUT, -+ env=env, shell=True) - return critical_errors - - @TaskGen.extension('.h', '.hh', '.hpp', '.hxx') -diff --git a/third_party/waf/waflib/extras/cython.py b/third_party/waf/waflib/extras/cython.py -index 2b2c7ccc265..591c274d950 100644 ---- a/third_party/waf/waflib/extras/cython.py -+++ b/third_party/waf/waflib/extras/cython.py -@@ -8,8 +8,9 @@ from waflib.TaskGen import extension - - cy_api_pat = re.compile(r'\s*?cdef\s*?(public|api)\w*') - re_cyt = re.compile(r""" -- (?:from\s+(\w+)\s+)? # optionally match "from foo" and capture foo -- c?import\s(\w+|[*]) # require "import bar" and capture bar -+ ^\s* # must begin with some whitespace characters -+ (?:from\s+(\w+)(?:\.\w+)*\s+)? # optionally match "from foo(.baz)" and capture foo -+ c?import\s(\w+|[*]) # require "import bar" and capture bar - """, re.M | re.VERBOSE) - - @extension('.pyx') -@@ -85,12 +86,12 @@ class cython(Task.Task): - node = self.inputs[0] - txt = node.read() - -- mods = [] -+ mods = set() - for m in re_cyt.finditer(txt): - if m.group(1): # matches "from foo import bar" -- mods.append(m.group(1)) -+ mods.add(m.group(1)) - else: -- mods.append(m.group(2)) -+ mods.add(m.group(2)) - - Logs.debug('cython: mods %r', mods) - incs = getattr(self.generator, 'cython_includes', []) -@@ -99,7 +100,7 @@ class cython(Task.Task): - - found = [] - missing = [] -- for x in mods: -+ for x in sorted(mods): - for y in incs: - k = y.find_resource(x + '.pxd') - if k: -@@ -141,6 +142,6 @@ def configure(ctx): - if not ctx.env.PYTHON: - ctx.fatal('Load the python tool first!') - ctx.find_program('cython', var='CYTHON') -- if ctx.options.cython_flags: -+ if hasattr(ctx.options, 'cython_flags'): - ctx.env.CYTHONFLAGS = ctx.options.cython_flags - -diff --git a/third_party/waf/waflib/extras/distnet.py b/third_party/waf/waflib/extras/distnet.py -index 09a31a6d437..ff3ed8e1146 100644 ---- a/third_party/waf/waflib/extras/distnet.py -+++ b/third_party/waf/waflib/extras/distnet.py -@@ -44,7 +44,7 @@ TARFORMAT = 'w:bz2' - TIMEOUT = 60 - REQUIRES = 'requires.txt' - --re_com = re.compile('\s*#.*', re.M) -+re_com = re.compile(r'\s*#.*', re.M) - - def total_version_order(num): - lst = num.split('.') -diff --git a/third_party/waf/waflib/extras/doxygen.py b/third_party/waf/waflib/extras/doxygen.py -index 3eae22fe179..423d8455025 100644 ---- a/third_party/waf/waflib/extras/doxygen.py -+++ b/third_party/waf/waflib/extras/doxygen.py -@@ -27,6 +27,7 @@ When using this tool, the wscript will look like: - """ - - import os, os.path, re -+from collections import OrderedDict - from waflib import Task, Utils, Node - from waflib.TaskGen import feature - -@@ -40,7 +41,13 @@ inc m mm py f90c cc cxx cpp c++ java ii ixx ipp i++ inl h hh hxx - re_rl = re.compile('\\\\\r*\n', re.MULTILINE) - re_nl = re.compile('\r*\n', re.M) - def parse_doxy(txt): -- tbl = {} -+ ''' -+ Parses a doxygen file. -+ Returns an ordered dictionary. We cannot return a default dictionary, as the -+ order in which the entries are reported does matter, especially for the -+ '@INCLUDE' lines. -+ ''' -+ tbl = OrderedDict() - txt = re_rl.sub('', txt) - lines = re_nl.split(txt) - for x in lines: -@@ -190,13 +197,13 @@ class tar(Task.Task): - @feature('doxygen') - def process_doxy(self): - if not getattr(self, 'doxyfile', None): -- self.generator.bld.fatal('no doxyfile??') -+ self.bld.fatal('no doxyfile variable specified??') - - node = self.doxyfile - if not isinstance(node, Node.Node): - node = self.path.find_resource(node) - if not node: -- raise ValueError('doxygen file not found') -+ self.bld.fatal('doxygen file %s not found' % self.doxyfile) - - # the task instance - dsk = self.create_task('doxygen', node) -diff --git a/third_party/waf/waflib/extras/erlang.py b/third_party/waf/waflib/extras/erlang.py -index 49f6d5b475b..0b93d9a4f46 100644 ---- a/third_party/waf/waflib/extras/erlang.py -+++ b/third_party/waf/waflib/extras/erlang.py -@@ -51,7 +51,7 @@ class erl(Task.Task): - if n.abspath() in scanned: - continue - -- for i in re.findall('-include\("(.*)"\)\.', n.read()): -+ for i in re.findall(r'-include\("(.*)"\)\.', n.read()): - for d in task.erlc_incnodes: - r = d.find_node(i) - if r: -diff --git a/third_party/waf/waflib/extras/fast_partial.py b/third_party/waf/waflib/extras/fast_partial.py -index b3af513b255..71b8318eecb 100644 ---- a/third_party/waf/waflib/extras/fast_partial.py -+++ b/third_party/waf/waflib/extras/fast_partial.py -@@ -17,8 +17,9 @@ Usage:: - def options(opt): - opt.load('fast_partial') - --Assuptions: -+Assumptions: - * Mostly for C/C++/Fortran targets with link tasks (object-only targets are not handled) -+ try it in the folder generated by utils/genbench.py - * For full project builds: no --targets and no pruning from subfolders - * The installation phase is ignored - * `use=` dependencies are specified up front even across build groups -diff --git a/third_party/waf/waflib/extras/fc_cray.py b/third_party/waf/waflib/extras/fc_cray.py -index ec2906742b4..da733fade3d 100644 ---- a/third_party/waf/waflib/extras/fc_cray.py -+++ b/third_party/waf/waflib/extras/fc_cray.py -@@ -20,7 +20,7 @@ def find_crayftn(conf): - @conf - def crayftn_flags(conf): - v = conf.env -- v['_FCMODOUTFLAGS'] = ['-em', '-J.'] # enable module files and put them in the current directoy -+ v['_FCMODOUTFLAGS'] = ['-em', '-J.'] # enable module files and put them in the current directory - v['FCFLAGS_DEBUG'] = ['-m1'] # more verbose compiler warnings - v['FCFLAGS_fcshlib'] = ['-h pic'] - v['LINKFLAGS_fcshlib'] = ['-h shared'] -diff --git a/third_party/waf/waflib/extras/fc_nec.py b/third_party/waf/waflib/extras/fc_nec.py -index 4b70f3dcccd..67c86808985 100644 ---- a/third_party/waf/waflib/extras/fc_nec.py -+++ b/third_party/waf/waflib/extras/fc_nec.py -@@ -20,7 +20,7 @@ def find_sxfc(conf): - @conf - def sxfc_flags(conf): - v = conf.env -- v['_FCMODOUTFLAGS'] = [] # enable module files and put them in the current directoy -+ v['_FCMODOUTFLAGS'] = [] # enable module files and put them in the current directory - v['FCFLAGS_DEBUG'] = [] # more verbose compiler warnings - v['FCFLAGS_fcshlib'] = [] - v['LINKFLAGS_fcshlib'] = [] -diff --git a/third_party/waf/waflib/extras/fc_nfort.py b/third_party/waf/waflib/extras/fc_nfort.py -new file mode 100644 -index 00000000000..c25886b8e70 ---- /dev/null -+++ b/third_party/waf/waflib/extras/fc_nfort.py -@@ -0,0 +1,52 @@ -+#! /usr/bin/env python -+# encoding: utf-8 -+# Detection of the NEC Fortran compiler for Aurora Tsubasa -+ -+import re -+from waflib.Tools import fc,fc_config,fc_scan -+from waflib.Configure import conf -+from waflib.Tools.compiler_fc import fc_compiler -+fc_compiler['linux'].append('fc_nfort') -+ -+@conf -+def find_nfort(conf): -+ fc=conf.find_program(['nfort'],var='FC') -+ conf.get_nfort_version(fc) -+ conf.env.FC_NAME='NFORT' -+ conf.env.FC_MOD_CAPITALIZATION='lower' -+ -+@conf -+def nfort_flags(conf): -+ v=conf.env -+ v['_FCMODOUTFLAGS']=[] -+ v['FCFLAGS_DEBUG']=[] -+ v['FCFLAGS_fcshlib']=[] -+ v['LINKFLAGS_fcshlib']=[] -+ v['FCSTLIB_MARKER']='' -+ v['FCSHLIB_MARKER']='' -+ -+@conf -+def get_nfort_version(conf,fc): -+ version_re=re.compile(r"nfort\s*\(NFORT\)\s*(?P\d+)\.(?P\d+)\.",re.I).search -+ cmd=fc+['--version'] -+ out,err=fc_config.getoutput(conf,cmd,stdin=False) -+ if out: -+ match=version_re(out) -+ else: -+ match=version_re(err) -+ if not match: -+ return(False) -+ conf.fatal('Could not determine the NEC NFORT Fortran compiler version.') -+ else: -+ k=match.groupdict() -+ conf.env['FC_VERSION']=(k['major'],k['minor']) -+ -+def configure(conf): -+ conf.find_nfort() -+ conf.find_program('nar',var='AR') -+ conf.add_os_flags('ARFLAGS') -+ if not conf.env.ARFLAGS: -+ conf.env.ARFLAGS=['rcs'] -+ conf.fc_flags() -+ conf.fc_add_flags() -+ conf.nfort_flags() -diff --git a/third_party/waf/waflib/extras/gccdeps.py b/third_party/waf/waflib/extras/gccdeps.py -index d9758ab34d5..bfabe72e6fd 100644 ---- a/third_party/waf/waflib/extras/gccdeps.py -+++ b/third_party/waf/waflib/extras/gccdeps.py -@@ -36,7 +36,7 @@ def scan(self): - names = [] - return (nodes, names) - --re_o = re.compile("\.o$") -+re_o = re.compile(r"\.o$") - re_splitter = re.compile(r'(? '2': -- m = re.search(r'^message\s+(\w*)\s*{*', line) -- if m: -- messages.append(m.groups()[0]) -- -- if javapkg: -- nodename = javapkg -- elif pkgname: -- nodename = pkgname -- else: -- raise Errors.WafError('Cannot derive java name from protoc file') -- -- nodename = nodename.replace('.',os.sep) + os.sep -- if javacn: -- nodename += javacn + '.java' -- else: -- if self.env.PROTOC_MAJOR > '2' and node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title() in messages: -- nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title().replace('_','') + 'OuterClass.java' -- else: -- nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title().replace('_','') + '.java' -- -- java_node = node.parent.find_or_declare(nodename) -- out_nodes.append(java_node) -- protoc_flags.append('--java_out=%s' % node.parent.get_bld().bldpath()) -- - # Make javac get also pick java code generated in build - if not node.parent.get_bld() in self.javac_task.srcdir: - self.javac_task.srcdir.append(node.parent.get_bld()) - -- if not out_nodes: -- raise Errors.WafError('Feature %r not supported by protoc extra' % self.features) -+ protoc_flags.append('--java_out=%s' % node.parent.get_bld().bldpath()) -+ node.parent.get_bld().mkdir() - - tsk = self.create_task('protoc', node, out_nodes) - tsk.env.append_value('PROTOC_FLAGS', protoc_flags) -@@ -219,9 +187,22 @@ def process_protoc(self, node): - # For C++ standard include files dirs are used, - # but this doesn't apply to Python for example - for incpath in getattr(self, 'protoc_includes', []): -- incdirs.append(self.path.find_node(incpath).bldpath()) -+ incpath_node = self.path.find_node(incpath) -+ if incpath_node: -+ incdirs.append(incpath_node.bldpath()) -+ else: -+ # Check if relative to top-level for extra tg dependencies -+ incpath_node = self.bld.path.find_node(incpath) -+ if incpath_node: -+ incdirs.append(incpath_node.bldpath()) -+ else: -+ raise Errors.WafError('protoc: include path %r does not exist' % incpath) -+ - tsk.env.PROTOC_INCPATHS = incdirs - -+ # Include paths external to the waf project (ie. shared pb repositories) -+ tsk.env.PROTOC_EXTINCPATHS = getattr(self, 'protoc_extincludes', []) -+ - # PR2115: protoc generates output of .proto files in nested - # directories by canonicalizing paths. To avoid this we have to pass - # as first include the full directory file of the .proto file -diff --git a/third_party/waf/waflib/extras/pyqt5.py b/third_party/waf/waflib/extras/pyqt5.py -index c21dfa72048..9c941764cc2 100644 ---- a/third_party/waf/waflib/extras/pyqt5.py -+++ b/third_party/waf/waflib/extras/pyqt5.py -@@ -1,6 +1,6 @@ - #!/usr/bin/env python - # encoding: utf-8 --# Federico Pellegrin, 2016-2018 (fedepell) adapted for Python -+# Federico Pellegrin, 2016-2019 (fedepell) adapted for Python - - """ - This tool helps with finding Python Qt5 tools and libraries, -@@ -30,7 +30,7 @@ Load the "pyqt5" tool. - - Add into the sources list also the qrc resources files or ui5 - definition files and they will be translated into python code --with the system tools (PyQt5, pyside2, PyQt4 are searched in this -+with the system tools (PyQt5, PySide2, PyQt4 are searched in this - order) and then compiled - """ - -@@ -111,9 +111,9 @@ def apply_pyqt5(self): - """ - The additional parameters are: - -- :param lang: list of translation files (\*.ts) to process -+ :param lang: list of translation files (\\*.ts) to process - :type lang: list of :py:class:`waflib.Node.Node` or string without the .ts extension -- :param langname: if given, transform the \*.ts files into a .qrc files to include in the binary file -+ :param langname: if given, transform the \\*.ts files into a .qrc files to include in the binary file - :type langname: :py:class:`waflib.Node.Node` or string without the .qrc extension - """ - if getattr(self, 'lang', None): -@@ -207,11 +207,15 @@ def configure(self): - @conf - def find_pyqt5_binaries(self): - """ -- Detects PyQt5 or pyside2 programs such as pyuic5/pyside2-uic, pyrcc5/pyside2-rcc -+ Detects PyQt5 or PySide2 programs such as pyuic5/pyside2-uic, pyrcc5/pyside2-rcc - """ - env = self.env - -- if getattr(Options.options, 'want_pyside2', True): -+ if getattr(Options.options, 'want_pyqt5', True): -+ self.find_program(['pyuic5'], var='QT_PYUIC') -+ self.find_program(['pyrcc5'], var='QT_PYRCC') -+ self.find_program(['pylupdate5'], var='QT_PYLUPDATE') -+ elif getattr(Options.options, 'want_pyside2', True): - self.find_program(['pyside2-uic'], var='QT_PYUIC') - self.find_program(['pyside2-rcc'], var='QT_PYRCC') - self.find_program(['pyside2-lupdate'], var='QT_PYLUPDATE') -@@ -227,7 +231,7 @@ def find_pyqt5_binaries(self): - if not env.QT_PYUIC: - self.fatal('cannot find the uic compiler for python for qt5') - -- if not env.QT_PYUIC: -+ if not env.QT_PYRCC: - self.fatal('cannot find the rcc compiler for python for qt5') - - self.find_program(['lrelease-qt5', 'lrelease'], var='QT_LRELEASE') -@@ -237,5 +241,6 @@ def options(opt): - Command-line options - """ - pyqt5opt=opt.add_option_group("Python QT5 Options") -- pyqt5opt.add_option('--pyqt5-pyside2', action='store_true', default=False, dest='want_pyside2', help='use pyside2 bindings as python QT5 bindings (default PyQt5 is searched first, PySide2 after)') -+ pyqt5opt.add_option('--pyqt5-pyqt5', action='store_true', default=False, dest='want_pyqt5', help='use PyQt5 bindings as python QT5 bindings (default PyQt5 is searched first, PySide2 after, PyQt4 last)') -+ pyqt5opt.add_option('--pyqt5-pyside2', action='store_true', default=False, dest='want_pyside2', help='use PySide2 bindings as python QT5 bindings (default PyQt5 is searched first, PySide2 after, PyQt4 last)') - pyqt5opt.add_option('--pyqt5-pyqt4', action='store_true', default=False, dest='want_pyqt4', help='use PyQt4 bindings as python QT5 bindings (default PyQt5 is searched first, PySide2 after, PyQt4 last)') -diff --git a/third_party/waf/waflib/extras/qt4.py b/third_party/waf/waflib/extras/qt4.py -index 90cae7e0ae5..d19a4ddac3f 100644 ---- a/third_party/waf/waflib/extras/qt4.py -+++ b/third_party/waf/waflib/extras/qt4.py -@@ -290,11 +290,11 @@ def apply_qt4(self): - - The additional parameters are: - -- :param lang: list of translation files (\*.ts) to process -+ :param lang: list of translation files (\\*.ts) to process - :type lang: list of :py:class:`waflib.Node.Node` or string without the .ts extension -- :param update: whether to process the C++ files to update the \*.ts files (use **waf --translate**) -+ :param update: whether to process the C++ files to update the \\*.ts files (use **waf --translate**) - :type update: bool -- :param langname: if given, transform the \*.ts files into a .qrc files to include in the binary file -+ :param langname: if given, transform the \\*.ts files into a .qrc files to include in the binary file - :type langname: :py:class:`waflib.Node.Node` or string without the .qrc extension - """ - if getattr(self, 'lang', None): -diff --git a/third_party/waf/waflib/extras/remote.py b/third_party/waf/waflib/extras/remote.py -index 3b038f772b5..f43b600f023 100644 ---- a/third_party/waf/waflib/extras/remote.py -+++ b/third_party/waf/waflib/extras/remote.py -@@ -203,7 +203,7 @@ class remote(BuildContext): - Options.commands.remove(k) - - def login_to_host(self, login): -- return re.sub('(\w+@)', '', login) -+ return re.sub(r'(\w+@)', '', login) - - def variant_to_login(self, variant): - """linux_32_debug -> search env.LINUX_32 and then env.LINUX""" -diff --git a/third_party/waf/waflib/extras/run_do_script.py b/third_party/waf/waflib/extras/run_do_script.py -index f3c58122c9b..07e3aa2591c 100644 ---- a/third_party/waf/waflib/extras/run_do_script.py -+++ b/third_party/waf/waflib/extras/run_do_script.py -@@ -101,7 +101,7 @@ class run_do_script(run_do_script_base): - with open(**kwargs) as log: - log_tail = log.readlines()[-10:] - for line in log_tail: -- error_found = re.match("r\(([0-9]+)\)", line) -+ error_found = re.match(r"r\(([0-9]+)\)", line) - if error_found: - return error_found.group(1), ''.join(log_tail) - else: -diff --git a/third_party/waf/waflib/extras/sphinx.py b/third_party/waf/waflib/extras/sphinx.py -new file mode 100644 -index 00000000000..ce11110e634 ---- /dev/null -+++ b/third_party/waf/waflib/extras/sphinx.py -@@ -0,0 +1,81 @@ -+"""Support for Sphinx documentation -+ -+This is a wrapper for sphinx-build program. Please note that sphinx-build supports only one output format which can -+passed to build via sphinx_output_format attribute. The default output format is html. -+ -+Example wscript: -+ -+def configure(cnf): -+ conf.load('sphinx') -+ -+def build(bld): -+ bld( -+ features='sphinx', -+ sphinx_source='sources', # path to source directory -+ sphinx_options='-a -v', # sphinx-build program additional options -+ sphinx_output_format='man' # output format of sphinx documentation -+ ) -+ -+""" -+ -+from waflib.Node import Node -+from waflib import Utils -+from waflib.Task import Task -+from waflib.TaskGen import feature, after_method -+ -+ -+def configure(cnf): -+ """Check if sphinx-build program is available and loads gnu_dirs tool.""" -+ cnf.find_program('sphinx-build', var='SPHINX_BUILD', mandatory=False) -+ cnf.load('gnu_dirs') -+ -+ -+@feature('sphinx') -+def build_sphinx(self): -+ """Builds sphinx sources. -+ """ -+ if not self.env.SPHINX_BUILD: -+ self.bld.fatal('Program SPHINX_BUILD not defined.') -+ if not getattr(self, 'sphinx_source', None): -+ self.bld.fatal('Attribute sphinx_source not defined.') -+ if not isinstance(self.sphinx_source, Node): -+ self.sphinx_source = self.path.find_node(self.sphinx_source) -+ if not self.sphinx_source: -+ self.bld.fatal('Can\'t find sphinx_source: %r' % self.sphinx_source) -+ -+ Utils.def_attrs(self, sphinx_output_format='html') -+ self.env.SPHINX_OUTPUT_FORMAT = self.sphinx_output_format -+ self.env.SPHINX_OPTIONS = getattr(self, 'sphinx_options', []) -+ -+ for source_file in self.sphinx_source.ant_glob('**/*'): -+ self.bld.add_manual_dependency(self.sphinx_source, source_file) -+ -+ sphinx_build_task = self.create_task('SphinxBuildingTask') -+ sphinx_build_task.set_inputs(self.sphinx_source) -+ sphinx_build_task.set_outputs(self.path.get_bld()) -+ -+ # the sphinx-build results are in directory -+ sphinx_output_directory = self.path.get_bld().make_node(self.env.SPHINX_OUTPUT_FORMAT) -+ sphinx_output_directory.mkdir() -+ Utils.def_attrs(self, install_path=get_install_path(self)) -+ self.add_install_files(install_to=self.install_path, -+ install_from=sphinx_output_directory.ant_glob('**/*'), -+ cwd=sphinx_output_directory, -+ relative_trick=True) -+ -+ -+def get_install_path(tg): -+ if tg.env.SPHINX_OUTPUT_FORMAT == 'man': -+ return tg.env.MANDIR -+ elif tg.env.SPHINX_OUTPUT_FORMAT == 'info': -+ return tg.env.INFODIR -+ else: -+ return tg.env.DOCDIR -+ -+ -+class SphinxBuildingTask(Task): -+ color = 'BOLD' -+ run_str = '${SPHINX_BUILD} -M ${SPHINX_OUTPUT_FORMAT} ${SRC} ${TGT} ${SPHINX_OPTIONS}' -+ -+ def keyword(self): -+ return 'Compiling (%s)' % self.env.SPHINX_OUTPUT_FORMAT -diff --git a/third_party/waf/waflib/extras/swig.py b/third_party/waf/waflib/extras/swig.py -index fd3d6d2c995..740ab46d963 100644 ---- a/third_party/waf/waflib/extras/swig.py -+++ b/third_party/waf/waflib/extras/swig.py -@@ -17,10 +17,10 @@ tasks have to be added dynamically: - - SWIG_EXTS = ['.swig', '.i'] - --re_module = re.compile('%module(?:\s*\(.*\))?\s+(.+)', re.M) -+re_module = re.compile(r'%module(?:\s*\(.*\))?\s+(.+)', re.M) - - re_1 = re.compile(r'^%module.*?\s+([\w]+)\s*?$', re.M) --re_2 = re.compile('[#%]include [<"](.*)[">]', re.M) -+re_2 = re.compile(r'[#%](?:include|import(?:\(module=".*"\))+|python(?:begin|code)) [<"](.*)[">]', re.M) - - class swig(Task.Task): - color = 'BLUE' -diff --git a/third_party/waf/waflib/extras/syms.py b/third_party/waf/waflib/extras/syms.py -index dfa005930e4..562f708e1ea 100644 ---- a/third_party/waf/waflib/extras/syms.py -+++ b/third_party/waf/waflib/extras/syms.py -@@ -31,7 +31,7 @@ class gen_sym(Task): - if self.env.DEST_BINFMT == 'pe': #gcc uses nm, and has a preceding _ on windows - re_nm = re.compile(r'(T|D)\s+_(?P%s)\b' % reg) - elif self.env.DEST_BINFMT=='mac-o': -- re_nm=re.compile(r'(T|D)\s+(?P_?%s)\b' % reg) -+ re_nm=re.compile(r'(T|D)\s+(?P_?(%s))\b' % reg) - else: - re_nm = re.compile(r'(T|D)\s+(?P%s)\b' % reg) - cmd = (self.env.NM or ['nm']) + ['-g', obj.abspath()] -diff --git a/third_party/waf/waflib/extras/use_config.py b/third_party/waf/waflib/extras/use_config.py -index 71df793a2a3..ef5129f219b 100644 ---- a/third_party/waf/waflib/extras/use_config.py -+++ b/third_party/waf/waflib/extras/use_config.py -@@ -52,7 +52,7 @@ import os - - local_repo = '' - """Local repository containing additional Waf tools (plugins)""" --remote_repo = 'https://raw.githubusercontent.com/waf-project/waf/master/' -+remote_repo = 'https://gitlab.com/ita1024/waf/raw/master/' - """ - Remote directory containing downloadable waf tools. The missing tools can be downloaded by using:: - -diff --git a/third_party/waf/waflib/extras/xcode6.py b/third_party/waf/waflib/extras/xcode6.py -index c062a74e4fc..91bbff181ec 100644 ---- a/third_party/waf/waflib/extras/xcode6.py -+++ b/third_party/waf/waflib/extras/xcode6.py -@@ -147,7 +147,7 @@ def newid(): - Represents a tree node in the XCode project plist file format. - When written to a file, all attributes of XCodeNode are stringified together with - its value. However, attributes starting with an underscore _ are ignored --during that process and allows you to store arbitray values that are not supposed -+during that process and allows you to store arbitrary values that are not supposed - to be written out. - """ - class XCodeNode(object): -@@ -247,7 +247,7 @@ class PBXBuildFile(XCodeNode): - # fileRef is a reference to a PBXFileReference object - self.fileRef = fileRef - -- # A map of key/value pairs for additionnal settings. -+ # A map of key/value pairs for additional settings. - self.settings = settings - - def __hash__(self): -@@ -435,8 +435,8 @@ class PBXProject(XCodeNode): - def create_target_dependency(self, target, name): - """ : param target : PXBNativeTarget """ - proxy = PBXContainerItemProxy(self, target, name) -- dependecy = PBXTargetDependency(target, proxy) -- return dependecy -+ dependency = PBXTargetDependency(target, proxy) -+ return dependency - - def write(self, file): - -diff --git a/third_party/waf/waflib/processor.py b/third_party/waf/waflib/processor.py -index 2eecf3bd93f..eff2e69adfb 100755 ---- a/third_party/waf/waflib/processor.py -+++ b/third_party/waf/waflib/processor.py -@@ -27,6 +27,10 @@ def run(): - [cmd, kwargs, cargs] = cPickle.loads(base64.b64decode(txt)) - cargs = cargs or {} - -+ if not 'close_fds' in kwargs: -+ # workers have no fds -+ kwargs['close_fds'] = False -+ - ret = 1 - out, err, ex, trace = (None, None, None, None) - try: --- -2.21.0 - diff --git a/samba.spec b/samba.spec index 18e7c27..8691f44 100644 --- a/samba.spec +++ b/samba.spec @@ -6,15 +6,15 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 1 +%define main_release 0 -%define samba_version 4.10.6 -%define talloc_version 2.1.16 -%define tdb_version 1.3.18 -%define tevent_version 0.9.39 -%define ldb_version 1.5.5 +%define samba_version 4.11.0 +%define talloc_version 2.2.0 +%define tdb_version 1.4.1 +%define tevent_version 0.10.0 +%define ldb_version 2.0.5 # This should be rc1 or nil -%define pre_release %nil +%define pre_release rc1 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -118,8 +118,7 @@ Source14: samba.pamd Source201: README.downgrade -Patch0: samba-4.10.x-waf_update.patch -Patch1: samba-bz14091-v4.10-backport.patch +Patch0: samba-bz14091-v4.10-backport.patch Requires(pre): /usr/sbin/groupadd Requires(post): systemd @@ -3440,6 +3439,9 @@ fi %endif # with_clustering_support %changelog +* Tue Aug 20 2019 Guenther Deschner - 4.11.0rc1-0 +- Update to Samba 4.11.0rc1 + * Fri Aug 16 2019 Alexander Bokovoy - 2:4.10.6-1 - Fix Samba bug https://bugzilla.samba.org/show_bug.cgi?id=14091 - Fixes: Windows systems cannot resolve IPA users and groups over LSA RPC diff --git a/sources b/sources index d8fd22b..1b19fc6 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.10.6.tar.xz) = 1189e25271d3f708efebe99e840028dd82f82de458771bf9e8373c6b21643e3968165963b4a9efb5eac356734a4b4c7857f6fb2a077f3c8ca463ebae5a889cfc -SHA512 (samba-4.10.6.tar.asc) = 21dc113313d98185ee97be1c59e791862d55dcd509b82f98d8fb5f2123b09c7be7265305734b0b17fb95aca729c1b7df48751cb6d6b645dbfbf092e174e07cbc +SHA512 (samba-4.11.0rc1.tar.xz) = 618e96d39eeada94675bde0c7ab287fdb59674bb5fe3ae75f62723f87554d3302c1afc00894fe8dea0e227c1e5db07f222307e0062dc0db4ffb885441facbc94 +SHA512 (samba-4.11.0rc1.tar.asc) = eb18a854b7145711ae0a3da32a6006e4bee36d13a74800748521432728f1ba6eca7bdcf94ce1ec3b17d6849527fcf37300a0b5f7ce2e0aa50009de66352cc72a From f297ac882f3cf8371138a1e5e0a2037ff6a6ab95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 21 Aug 2019 16:07:07 +0200 Subject: [PATCH 69/76] Update to Samba 4.11.0rc2 Thanks to Lukas Slebodnik Guenther --- .gitignore | 2 + samba-bz14091-v4.10-backport.patch | 650 ----------------------------- samba.spec | 104 ++--- sources | 4 +- 4 files changed, 40 insertions(+), 720 deletions(-) delete mode 100644 samba-bz14091-v4.10-backport.patch diff --git a/.gitignore b/.gitignore index 3f7e875..90e2be2 100644 --- a/.gitignore +++ b/.gitignore @@ -171,3 +171,5 @@ samba-3.6.0pre1.tar.gz /samba-4.10.6.tar.asc /samba-4.11.0rc1.tar.xz /samba-4.11.0rc1.tar.asc +/samba-4.11.0rc2.tar.xz +/samba-4.11.0rc2.tar.asc diff --git a/samba-bz14091-v4.10-backport.patch b/samba-bz14091-v4.10-backport.patch deleted file mode 100644 index 104e78e..0000000 --- a/samba-bz14091-v4.10-backport.patch +++ /dev/null @@ -1,650 +0,0 @@ -From 536df2c1070d516ab95ad96b606fcc1f92c3668d Mon Sep 17 00:00:00 2001 -From: Alexander Bokovoy -Date: Thu, 1 Aug 2019 21:08:52 +0300 -Subject: [PATCH 1/3] torture/rpc/lsa: allow testing different lookup levels - -Convert torture/rpc/lsa LookupNames/LookupSids code to allow testing -different LSA_LOOKUP_NAMES_* levels. Keep existing level 1 -(LSA_LOOKUP_NAMES_ALL) for the current set of tests. - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=14091 - -Signed-off-by: Alexander Bokovoy -Reviewed-by: Andreas Schneider - -(cherry picked from commit 317bc6a7342edfa2c503f5932142bf5883485cc9) ---- - source4/torture/rpc/lsa.c | 118 ++++++++++++++++++--------------- - source4/torture/rpc/schannel.c | 2 +- - 2 files changed, 67 insertions(+), 53 deletions(-) - -diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c -index bc1e9553039..b7dd0dc8c91 100644 ---- a/source4/torture/rpc/lsa.c -+++ b/source4/torture/rpc/lsa.c -@@ -270,6 +270,7 @@ static bool test_OpenPolicy2_fail(struct dcerpc_binding_handle *b, - static bool test_LookupNames(struct dcerpc_binding_handle *b, - struct torture_context *tctx, - struct policy_handle *handle, -+ enum lsa_LookupNamesLevel level, - struct lsa_TransNameArray *tnames) - { - struct lsa_LookupNames r; -@@ -302,7 +303,7 @@ static bool test_LookupNames(struct dcerpc_binding_handle *b, - r.in.handle = handle; - r.in.names = names; - r.in.sids = &sids; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.out.count = &count; - r.out.sids = &sids; -@@ -358,7 +359,8 @@ static bool test_LookupNames(struct dcerpc_binding_handle *b, - - static bool test_LookupNames_bogus(struct dcerpc_binding_handle *b, - struct torture_context *tctx, -- struct policy_handle *handle) -+ struct policy_handle *handle, -+ enum lsa_LookupNamesLevel level) - { - struct lsa_LookupNames r; - struct lsa_TransSidArray sids; -@@ -377,7 +379,7 @@ static bool test_LookupNames_bogus(struct dcerpc_binding_handle *b, - r.in.num_names = 1; - r.in.names = names; - r.in.sids = &sids; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.out.count = &count; - r.out.sids = &sids; -@@ -398,7 +400,8 @@ static bool test_LookupNames_bogus(struct dcerpc_binding_handle *b, - - static bool test_LookupNames_NULL(struct dcerpc_binding_handle *b, - struct torture_context *tctx, -- struct policy_handle *handle) -+ struct policy_handle *handle, -+ enum lsa_LookupNamesLevel level) - { - struct lsa_LookupNames r; - struct lsa_TransSidArray sids; -@@ -417,7 +420,7 @@ static bool test_LookupNames_NULL(struct dcerpc_binding_handle *b, - r.in.num_names = 1; - r.in.names = names; - r.in.sids = &sids; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.out.count = &count; - r.out.sids = &sids; -@@ -442,7 +445,8 @@ static bool test_LookupNames_NULL(struct dcerpc_binding_handle *b, - - static bool test_LookupNames_wellknown(struct dcerpc_binding_handle *b, - struct torture_context *tctx, -- struct policy_handle *handle) -+ struct policy_handle *handle, -+ enum lsa_LookupNamesLevel level) - { - struct lsa_TranslatedName name; - struct lsa_TransNameArray tnames; -@@ -454,45 +458,46 @@ static bool test_LookupNames_wellknown(struct dcerpc_binding_handle *b, - tnames.count = 1; - name.name.string = "NT AUTHORITY\\SYSTEM"; - name.sid_type = SID_NAME_WKN_GRP; -- ret &= test_LookupNames(b, tctx, handle, &tnames); -+ ret &= test_LookupNames(b, tctx, handle, level, &tnames); - - name.name.string = "NT AUTHORITY\\ANONYMOUS LOGON"; - name.sid_type = SID_NAME_WKN_GRP; -- ret &= test_LookupNames(b, tctx, handle, &tnames); -+ ret &= test_LookupNames(b, tctx, handle, level, &tnames); - - name.name.string = "NT AUTHORITY\\Authenticated Users"; - name.sid_type = SID_NAME_WKN_GRP; -- ret &= test_LookupNames(b, tctx, handle, &tnames); -+ ret &= test_LookupNames(b, tctx, handle, level, &tnames); - - #if 0 - name.name.string = "NT AUTHORITY"; -- ret &= test_LookupNames(b, tctx, handle, &tnames); -+ ret &= test_LookupNames(b, tctx, handle, level, &tnames); - - name.name.string = "NT AUTHORITY\\"; -- ret &= test_LookupNames(b, tctx, handle, &tnames); -+ ret &= test_LookupNames(b, tctx, handle, level, &tnames); - #endif - - name.name.string = "BUILTIN\\"; - name.sid_type = SID_NAME_DOMAIN; -- ret &= test_LookupNames(b, tctx, handle, &tnames); -+ ret &= test_LookupNames(b, tctx, handle, level, &tnames); - - name.name.string = "BUILTIN\\Administrators"; - name.sid_type = SID_NAME_ALIAS; -- ret &= test_LookupNames(b, tctx, handle, &tnames); -+ ret &= test_LookupNames(b, tctx, handle, level, &tnames); - - name.name.string = "SYSTEM"; - name.sid_type = SID_NAME_WKN_GRP; -- ret &= test_LookupNames(b, tctx, handle, &tnames); -+ ret &= test_LookupNames(b, tctx, handle, level, &tnames); - - name.name.string = "Everyone"; - name.sid_type = SID_NAME_WKN_GRP; -- ret &= test_LookupNames(b, tctx, handle, &tnames); -+ ret &= test_LookupNames(b, tctx, handle, level, &tnames); - return ret; - } - - static bool test_LookupNames2(struct dcerpc_binding_handle *b, - struct torture_context *tctx, - struct policy_handle *handle, -+ enum lsa_LookupNamesLevel level, - struct lsa_TransNameArray2 *tnames, - bool check_result) - { -@@ -525,7 +530,7 @@ static bool test_LookupNames2(struct dcerpc_binding_handle *b, - r.in.handle = handle; - r.in.names = names; - r.in.sids = &sids; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.in.lookup_options = 0; - r.in.client_revision = 0; -@@ -554,6 +559,7 @@ static bool test_LookupNames2(struct dcerpc_binding_handle *b, - static bool test_LookupNames3(struct dcerpc_binding_handle *b, - struct torture_context *tctx, - struct policy_handle *handle, -+ enum lsa_LookupNamesLevel level, - struct lsa_TransNameArray2 *tnames, - bool check_result) - { -@@ -585,7 +591,7 @@ static bool test_LookupNames3(struct dcerpc_binding_handle *b, - r.in.handle = handle; - r.in.names = names; - r.in.sids = &sids; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.in.lookup_options = 0; - r.in.client_revision = 0; -@@ -613,6 +619,7 @@ static bool test_LookupNames3(struct dcerpc_binding_handle *b, - - static bool test_LookupNames4(struct dcerpc_binding_handle *b, - struct torture_context *tctx, -+ enum lsa_LookupNamesLevel level, - struct lsa_TransNameArray2 *tnames, - bool check_result) - { -@@ -644,7 +651,7 @@ static bool test_LookupNames4(struct dcerpc_binding_handle *b, - r.in.num_names = tnames->count; - r.in.names = names; - r.in.sids = &sids; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.in.lookup_options = 0; - r.in.client_revision = 0; -@@ -682,7 +689,8 @@ static bool test_LookupNames4(struct dcerpc_binding_handle *b, - } - - static bool test_LookupNames4_fail(struct dcerpc_binding_handle *b, -- struct torture_context *tctx) -+ struct torture_context *tctx, -+ enum lsa_LookupNamesLevel level) - { - struct lsa_LookupNames4 r; - struct lsa_TransSidArray3 sids; -@@ -701,7 +709,7 @@ static bool test_LookupNames4_fail(struct dcerpc_binding_handle *b, - r.in.num_names = count; - r.in.names = names; - r.in.sids = &sids; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.in.lookup_options = 0; - r.in.client_revision = 0; -@@ -749,6 +757,7 @@ static bool test_LookupNames4_fail(struct dcerpc_binding_handle *b, - static bool test_LookupSids(struct dcerpc_binding_handle *b, - struct torture_context *tctx, - struct policy_handle *handle, -+ enum lsa_LookupNamesLevel level, - struct lsa_SidArray *sids) - { - struct lsa_LookupSids r; -@@ -764,7 +773,7 @@ static bool test_LookupSids(struct dcerpc_binding_handle *b, - r.in.handle = handle; - r.in.sids = sids; - r.in.names = &names; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.out.count = &count; - r.out.names = &names; -@@ -779,7 +788,7 @@ static bool test_LookupSids(struct dcerpc_binding_handle *b, - - torture_comment(tctx, "\n"); - -- if (!test_LookupNames(b, tctx, handle, &names)) { -+ if (!test_LookupNames(b, tctx, handle, level, &names)) { - return false; - } - -@@ -790,6 +799,7 @@ static bool test_LookupSids(struct dcerpc_binding_handle *b, - static bool test_LookupSids2(struct dcerpc_binding_handle *b, - struct torture_context *tctx, - struct policy_handle *handle, -+ enum lsa_LookupNamesLevel level, - struct lsa_SidArray *sids) - { - struct lsa_LookupSids2 r; -@@ -805,7 +815,7 @@ static bool test_LookupSids2(struct dcerpc_binding_handle *b, - r.in.handle = handle; - r.in.sids = sids; - r.in.names = &names; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.in.lookup_options = 0; - r.in.client_revision = 0; -@@ -824,11 +834,11 @@ static bool test_LookupSids2(struct dcerpc_binding_handle *b, - - torture_comment(tctx, "\n"); - -- if (!test_LookupNames2(b, tctx, handle, &names, false)) { -+ if (!test_LookupNames2(b, tctx, handle, level, &names, false)) { - return false; - } - -- if (!test_LookupNames3(b, tctx, handle, &names, false)) { -+ if (!test_LookupNames3(b, tctx, handle, level, &names, false)) { - return false; - } - -@@ -837,6 +847,7 @@ static bool test_LookupSids2(struct dcerpc_binding_handle *b, - - static bool test_LookupSids3(struct dcerpc_binding_handle *b, - struct torture_context *tctx, -+ enum lsa_LookupNamesLevel level, - struct lsa_SidArray *sids) - { - struct lsa_LookupSids3 r; -@@ -851,7 +862,7 @@ static bool test_LookupSids3(struct dcerpc_binding_handle *b, - - r.in.sids = sids; - r.in.names = &names; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.in.lookup_options = 0; - r.in.client_revision = 0; -@@ -880,7 +891,7 @@ static bool test_LookupSids3(struct dcerpc_binding_handle *b, - - torture_comment(tctx, "\n"); - -- if (!test_LookupNames4(b, tctx, &names, true)) { -+ if (!test_LookupNames4(b, tctx, level, &names, true)) { - return false; - } - -@@ -889,6 +900,7 @@ static bool test_LookupSids3(struct dcerpc_binding_handle *b, - - static bool test_LookupSids3_fail(struct dcerpc_binding_handle *b, - struct torture_context *tctx, -+ enum lsa_LookupNamesLevel level, - struct lsa_SidArray *sids) - { - struct lsa_LookupSids3 r; -@@ -904,7 +916,7 @@ static bool test_LookupSids3_fail(struct dcerpc_binding_handle *b, - - r.in.sids = sids; - r.in.names = &names; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &count; - r.in.lookup_options = 0; - r.in.client_revision = 0; -@@ -948,7 +960,8 @@ static bool test_LookupSids3_fail(struct dcerpc_binding_handle *b, - - bool test_many_LookupSids(struct dcerpc_pipe *p, - struct torture_context *tctx, -- struct policy_handle *handle) -+ struct policy_handle *handle, -+ enum lsa_LookupNamesLevel level) - { - uint32_t count; - struct lsa_SidArray sids; -@@ -979,7 +992,7 @@ bool test_many_LookupSids(struct dcerpc_pipe *p, - r.in.handle = handle; - r.in.sids = &sids; - r.in.names = &names; -- r.in.level = 1; -+ r.in.level = level; - r.in.count = &names.count; - r.out.count = &count; - r.out.names = &names; -@@ -995,16 +1008,16 @@ bool test_many_LookupSids(struct dcerpc_pipe *p, - - torture_comment(tctx, "\n"); - -- if (!test_LookupNames(b, tctx, handle, &names)) { -+ if (!test_LookupNames(b, tctx, handle, level, &names)) { - return false; - } - } - - if (transport == NCACN_NP) { -- if (!test_LookupSids3_fail(b, tctx, &sids)) { -+ if (!test_LookupSids3_fail(b, tctx, level, &sids)) { - return false; - } -- if (!test_LookupNames4_fail(b, tctx)) { -+ if (!test_LookupNames4_fail(b, tctx, level)) { - return false; - } - } else if (transport == NCACN_IP_TCP) { -@@ -1020,10 +1033,10 @@ bool test_many_LookupSids(struct dcerpc_pipe *p, - - if (auth_type == DCERPC_AUTH_TYPE_SCHANNEL && - auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY) { -- if (!test_LookupSids3(b, tctx, &sids)) { -+ if (!test_LookupSids3(b, tctx, level, &sids)) { - return false; - } -- if (!test_LookupNames4(b, tctx, &names, true)) { -+ if (!test_LookupNames4(b, tctx, level, &names, true)) { - return false; - } - } else { -@@ -1031,10 +1044,10 @@ bool test_many_LookupSids(struct dcerpc_pipe *p, - * If we don't have a secure channel these tests must - * fail with ACCESS_DENIED. - */ -- if (!test_LookupSids3_fail(b, tctx, &sids)) { -+ if (!test_LookupSids3_fail(b, tctx, level, &sids)) { - return false; - } -- if (!test_LookupNames4_fail(b, tctx)) { -+ if (!test_LookupNames4_fail(b, tctx, level)) { - return false; - } - } -@@ -1066,7 +1079,8 @@ static void lookupsids_cb(struct tevent_req *subreq) - - static bool test_LookupSids_async(struct dcerpc_binding_handle *b, - struct torture_context *tctx, -- struct policy_handle *handle) -+ struct policy_handle *handle, -+ enum lsa_LookupNamesLevel level) - { - struct lsa_SidArray sids; - struct lsa_SidPtr sidptr; -@@ -1101,7 +1115,7 @@ static bool test_LookupSids_async(struct dcerpc_binding_handle *b, - r[i].in.handle = handle; - r[i].in.sids = &sids; - r[i].in.names = &names[i]; -- r[i].in.level = 1; -+ r[i].in.level = level; - r[i].in.count = &names[i].count; - r[i].out.count = &count[i]; - r[i].out.names = &names[i]; -@@ -1912,11 +1926,11 @@ static bool test_EnumAccounts(struct dcerpc_binding_handle *b, - torture_assert_ntstatus_ok(tctx, r.out.result, - "EnumAccounts failed"); - -- if (!test_LookupSids(b, tctx, handle, &sids1)) { -+ if (!test_LookupSids(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &sids1)) { - return false; - } - -- if (!test_LookupSids2(b, tctx, handle, &sids1)) { -+ if (!test_LookupSids2(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &sids1)) { - return false; - } - -@@ -4811,7 +4825,7 @@ static bool test_QueryInfoPolicyCalls( bool version2, - tnames.names[12].sid_type = SID_NAME_USER; - tnames.names[13].name.string = talloc_asprintf(tctx, TEST_MACHINENAME "$@%s", info->dns.dns_domain.string); - tnames.names[13].sid_type = SID_NAME_USER; -- ret &= test_LookupNames(b, tctx, handle, &tnames); -+ ret &= test_LookupNames(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames); - - } - } -@@ -4977,7 +4991,7 @@ bool torture_rpc_lsa(struct torture_context *tctx) - ret = false; - } - -- if (!test_many_LookupSids(p, tctx, handle)) { -+ if (!test_many_LookupSids(p, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { - ret = false; - } - -@@ -4998,7 +5012,7 @@ bool torture_rpc_lsa(struct torture_context *tctx) - ret = false; - } - -- if (!test_LookupSids_async(b, tctx, handle)) { -+ if (!test_LookupSids_async(b, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { - ret = false; - } - -@@ -5022,7 +5036,7 @@ bool torture_rpc_lsa(struct torture_context *tctx) - ret = false; - } - -- if (!test_many_LookupSids(p, tctx, handle)) { -+ if (!test_many_LookupSids(p, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { - ret = false; - } - -@@ -5033,7 +5047,7 @@ bool torture_rpc_lsa(struct torture_context *tctx) - torture_leave_domain(tctx, join); - - } else { -- if (!test_many_LookupSids(p, tctx, handle)) { -+ if (!test_many_LookupSids(p, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { - ret = false; - } - } -@@ -5108,7 +5122,7 @@ static bool testcase_LookupNames(struct torture_context *tctx, - tnames.names[0].name.string = "BUILTIN"; - tnames.names[0].sid_type = SID_NAME_DOMAIN; - -- if (!test_LookupNames(b, tctx, handle, &tnames)) { -+ if (!test_LookupNames(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames)) { - ret = false; - } - -@@ -5118,23 +5132,23 @@ static bool testcase_LookupNames(struct torture_context *tctx, - tnames2.names[0].name.string = "BUILTIN"; - tnames2.names[0].sid_type = SID_NAME_DOMAIN; - -- if (!test_LookupNames2(b, tctx, handle, &tnames2, true)) { -+ if (!test_LookupNames2(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames2, true)) { - ret = false; - } - -- if (!test_LookupNames3(b, tctx, handle, &tnames2, true)) { -+ if (!test_LookupNames3(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames2, true)) { - ret = false; - } - -- if (!test_LookupNames_wellknown(b, tctx, handle)) { -+ if (!test_LookupNames_wellknown(b, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { - ret = false; - } - -- if (!test_LookupNames_NULL(b, tctx, handle)) { -+ if (!test_LookupNames_NULL(b, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { - ret = false; - } - -- if (!test_LookupNames_bogus(b, tctx, handle)) { -+ if (!test_LookupNames_bogus(b, tctx, handle, LSA_LOOKUP_NAMES_ALL)) { - ret = false; - } - -diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c -index de3a36eaa4f..c237c82bbe7 100644 ---- a/source4/torture/rpc/schannel.c -+++ b/source4/torture/rpc/schannel.c -@@ -471,7 +471,7 @@ static bool test_schannel(struct torture_context *tctx, - "failed to connect lsarpc with schannel"); - - torture_assert(tctx, -- test_many_LookupSids(p_lsa, tctx, NULL), -+ test_many_LookupSids(p_lsa, tctx, NULL, LSA_LOOKUP_NAMES_ALL), - "LsaLookupSids3 failed!\n"); - - status = dcerpc_binding_set_transport(b, transport); --- -2.21.0 - - -From e76b56290c2be142c43a3fd68584d51b9dc0efb7 Mon Sep 17 00:00:00 2001 -From: Alexander Bokovoy -Date: Thu, 1 Aug 2019 15:48:58 +0300 -Subject: [PATCH 2/3] lookup_name: allow own domain lookup when flags == 0 - -In 2007, we've added support for multiple lookup levels for LSA -LookupNames family of calls. However, forest-wide lookups, as described -in MS-LSAT 2.2.16, never worked because flags passed to lookup_name() -were always set to zero, expecting at least default lookup on a DC to -apply. lookup_name() was instead treating zero flags as 'skip all -checks'. - -Allow at least own domain lookup in case domain name is the same. -This should allow FreeIPA DC to respond to LSA LookupNames3 calls from a -trusted AD DC side. - -For the reference, below is a request Windows Server 2016 domain -controller sends to FreeIPA domain controller when attempting to look up -a user from a trusted forest root domain that attemps to login to the -domain controller. Notice the level in the lsa_LookupNames3 call and -resulting flags in lookup_name(). - -[2019/08/03 07:14:24.156065, 1, pid=23639, effective(967001000, 967001000), real(967001000, 0), class=rpc_parse] ../../librpc/ndr/ndr.c:471(ndr_print_function_debug) - lsa_LookupNames3: struct lsa_LookupNames3 - in: struct lsa_LookupNames3 - handle : * - handle: struct policy_handle - handle_type : 0x00000000 (0) - uuid : 0000004c-0000-0000-455d-3018575c0000 - num_names : 0x00000001 (1) - names: ARRAY(1) - names: struct lsa_String - length : 0x000a (10) - size : 0x000c (12) - string : * - string : 'XS\ab' - sids : * - sids: struct lsa_TransSidArray3 - count : 0x00000000 (0) - sids : NULL - level : LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 (6) - count : * - count : 0x00000000 (0) - lookup_options : LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES (0) - client_revision : LSA_CLIENT_REVISION_2 (2) -[2019/08/03 07:14:24.156189, 6, pid=23639, effective(967001000, 967001000), real(967001000, 0), class=rpc_srv] ../../source3/rpc_server/rpc_handles.c:339(find_policy_by_hnd_internal) - Found policy hnd[0] [0000] 00 00 00 00 4C 00 00 00 00 00 00 00 45 5D 30 18 ....L... ....E]0. - [0010] 57 5C 00 00 W\.. -[2019/08/03 07:14:24.156228, 4, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/smbd/sec_ctx.c:215(push_sec_ctx) - push_sec_ctx(967001000, 967001000) : sec_ctx_stack_ndx = 2 -[2019/08/03 07:14:24.156246, 4, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/smbd/uid.c:552(push_conn_ctx) - push_conn_ctx(0) : conn_ctx_stack_ndx = 0 -[2019/08/03 07:14:24.156259, 4, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal) - setting sec ctx (0, 0) - sec_ctx_stack_ndx = 2 -[2019/08/03 07:14:24.156273, 5, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../libcli/security/security_token.c:53(security_token_debug) - Security token: (NULL) -[2019/08/03 07:14:24.156285, 5, pid=23639, effective(967001000, 967001000), real(967001000, 0)] ../../source3/auth/token_util.c:865(debug_unix_user_token) - UNIX token of user 0 - Primary group is 0 and contains 0 supplementary groups -[2019/08/03 07:14:24.156311, 5, pid=23639, effective(0, 0), real(0, 0), class=rpc_srv] ../../source3/rpc_server/lsa/srv_lsa_nt.c:244(lookup_lsa_sids) - lookup_lsa_sids: looking up name XS\ab -[2019/08/03 07:14:24.156327, 10, pid=23639, effective(0, 0), real(0, 0)] ../../source3/passdb/lookup_sid.c:112(lookup_name) - lookup_name: XS\ab => domain=[XS], name=[ab] -[2019/08/03 07:14:24.156340, 10, pid=23639, effective(0, 0), real(0, 0)] ../../source3/passdb/lookup_sid.c:114(lookup_name) - lookup_name: flags = 0x00 - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=14091 - -Signed-off-by: Alexander Bokovoy -Reviewed-by: Andreas Schneider - -(cherry picked from commit 685bb03de6ab733590831d1df4f5fd60d2ac427d) ---- - source3/passdb/lookup_sid.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c -index 2281bd0b64d..1bb15ccb8b4 100644 ---- a/source3/passdb/lookup_sid.c -+++ b/source3/passdb/lookup_sid.c -@@ -113,7 +113,7 @@ bool lookup_name(TALLOC_CTX *mem_ctx, - full_name, domain, name)); - DEBUG(10, ("lookup_name: flags = 0x0%x\n", flags)); - -- if ((flags & LOOKUP_NAME_DOMAIN) && -+ if (((flags & LOOKUP_NAME_DOMAIN) || (flags == 0)) && - strequal(domain, get_global_sam_name())) - { - --- -2.21.0 - - -From 03d1a9f4f07f6e06c125875fe454925f4c1f6c2b Mon Sep 17 00:00:00 2001 -From: Alexander Bokovoy -Date: Sat, 10 Aug 2019 11:53:12 +0300 -Subject: [PATCH 3/3] smbtorture: extend rpc.lsa to lookup machine over - forest-wide LookupNames - -Add a simple test to resolve DOMAIN\MACHINE$ via LSA LookupNames3 -using LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 level. This level would pass -zero lookup flags to lookup_name(). - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=14091 - -Signed-off-by: Alexander Bokovoy -Reviewed-by: Andreas Schneider - -Autobuild-User(master): Alexander Bokovoy -Autobuild-Date(master): Wed Aug 14 13:07:42 UTC 2019 on sn-devel-184 - -(cherry picked from commit 4d276a93fc624dc04d880f5b4157f272d3555be6) ---- - source4/torture/rpc/lsa.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c -index b7dd0dc8c91..21cc16afbaf 100644 ---- a/source4/torture/rpc/lsa.c -+++ b/source4/torture/rpc/lsa.c -@@ -4794,7 +4794,7 @@ static bool test_QueryInfoPolicyCalls( bool version2, - || i == LSA_POLICY_INFO_DNS_INT)) { - /* Let's look up some of these names */ - -- struct lsa_TransNameArray tnames; -+ struct lsa_TransNameArray tnames, dnames; - tnames.count = 14; - tnames.names = talloc_zero_array(tctx, struct lsa_TranslatedName, tnames.count); - tnames.names[0].name.string = info->dns.name.string; -@@ -4827,6 +4827,12 @@ static bool test_QueryInfoPolicyCalls( bool version2, - tnames.names[13].sid_type = SID_NAME_USER; - ret &= test_LookupNames(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames); - -+ /* Try to use in-forest search for the test machine */ -+ dnames.count = 1; -+ dnames.names = talloc_zero_array(tctx, struct lsa_TranslatedName, dnames.count); -+ dnames.names[0].name.string = talloc_asprintf(tctx, "%s\\"TEST_MACHINENAME "$", info->dns.name.string); -+ dnames.names[0].sid_type = SID_NAME_USER; -+ ret &= test_LookupNames(b, tctx, handle, LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2, &dnames); - } - } - --- -2.21.0 - diff --git a/samba.spec b/samba.spec index 8691f44..97d8737 100644 --- a/samba.spec +++ b/samba.spec @@ -10,11 +10,11 @@ %define samba_version 4.11.0 %define talloc_version 2.2.0 -%define tdb_version 1.4.1 +%define tdb_version 1.4.2 %define tevent_version 0.10.0 %define ldb_version 2.0.5 # This should be rc1 or nil -%define pre_release rc1 +%define pre_release rc2 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -118,8 +118,6 @@ Source14: samba.pamd Source201: README.downgrade -Patch0: samba-bz14091-v4.10-backport.patch - Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -574,21 +572,6 @@ The python3-%{name}-dc package contains the Python libraries needed by programs to manage Samba AD. %endif -### PIDL -%package pidl -Summary: Perl IDL compiler -Requires: perl-interpreter -Requires: perl(Parse::Yapp) -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) -BuildArch: noarch - -Provides: samba4-pidl = %{samba_depver} -Obsoletes: samba4-pidl < %{samba_depver} - -%description pidl -The %{name}-pidl package contains the Perl IDL compiler used by Samba -and Wireshark to parse IDL and similar protocols - ### TEST %package test Summary: Testing tools for Samba servers and clients @@ -1232,6 +1215,7 @@ fi %{_libdir}/samba/vfs/fileid.so %{_libdir}/samba/vfs/fruit.so %{_libdir}/samba/vfs/full_audit.so +%{_libdir}/samba/vfs/gpfs.so %{_libdir}/samba/vfs/glusterfs_fuse.so %{_libdir}/samba/vfs/linux_xfs_sgid.so %{_libdir}/samba/vfs/media_harmony.so @@ -1281,6 +1265,7 @@ fi %{_mandir}/man8/vfs_fileid.8* %{_mandir}/man8/vfs_fruit.8* %{_mandir}/man8/vfs_full_audit.8* +%{_mandir}/man8/vfs_gpfs.8* %{_mandir}/man8/vfs_glusterfs_fuse.8* %{_mandir}/man8/vfs_linux_xfs_sgid.8* %{_mandir}/man8/vfs_media_harmony.8* @@ -1309,6 +1294,7 @@ fi %if ! %{with_vfs_cephfs} %exclude %{_mandir}/man8/vfs_ceph.8* +%exclude %{_mandir}/man8/vfs_ceph_snapshots.8* %endif %attr(775,root,printadmin) %dir /var/lib/samba/drivers @@ -1411,6 +1397,7 @@ fi %{_libdir}/samba/libgenrand-samba4.so %{_libdir}/samba/libgensec-samba4.so %{_libdir}/samba/libgpext-samba4.so +%{_libdir}/samba/libgpo-samba4.so %{_libdir}/samba/libgse-samba4.so %{_libdir}/samba/libhttp-samba4.so %{_libdir}/samba/libinterfaces-samba4.so @@ -1431,6 +1418,7 @@ fi %{_libdir}/samba/libnetif-samba4.so %{_libdir}/samba/libnpa-tstream-samba4.so %{_libdir}/samba/libposix-eadb-samba4.so +%{_libdir}/samba/libprinter-driver-samba4.so %{_libdir}/samba/libprinting-migrate-samba4.so %{_libdir}/samba/libreplace-samba4.so %{_libdir}/samba/libregistry-samba4.so @@ -1546,6 +1534,7 @@ fi %{_libdir}/samba/ldb/aclread.so %{_libdir}/samba/ldb/anr.so %{_libdir}/samba/ldb/audit_log.so +%{_libdir}/samba/ldb/count_attrs.so %{_libdir}/samba/ldb/descriptor.so %{_libdir}/samba/ldb/dirsync.so %{_libdir}/samba/ldb/dns_notify.so @@ -1618,7 +1607,6 @@ fi %{_libdir}/samba/service/nbtd.so %{_libdir}/samba/service/ntp_signd.so %{_libdir}/samba/service/s3fs.so -%{_libdir}/samba/service/web.so %{_libdir}/samba/service/winbindd.so %{_libdir}/samba/service/wrepl.so %{_libdir}/libdcerpc-server.so.* @@ -1769,7 +1757,9 @@ fi %if %{with_vfs_cephfs} %files vfs-cephfs %{_libdir}/samba/vfs/ceph.so +%{_libdir}/samba/vfs/ceph_snapshots.so %{_mandir}/man8/vfs_ceph.8* +%{_mandir}/man8/vfs_ceph_snapshots.8* %endif ### VFS-GLUSTERFS @@ -1793,7 +1783,6 @@ fi %{_libdir}/samba/libauth4-samba4.so %{_libdir}/samba/libauth-unix-token-samba4.so %{_libdir}/samba/libdcerpc-samba4.so -%{_libdir}/samba/libnon-posix-acls-samba4.so %{_libdir}/samba/libshares-samba4.so %{_libdir}/samba/libsmbpasswdparser-samba4.so %{_libdir}/samba/libxattr-tdb-samba4.so @@ -1824,44 +1813,6 @@ fi %{_libdir}/pkgconfig/wbclient.pc %endif # with_libwbclient -### PIDL -%files pidl -%attr(755,root,root) %{_bindir}/pidl -%dir %{perl_vendorlib}/Parse -%{perl_vendorlib}/Parse/Pidl.pm -%dir %{perl_vendorlib}/Parse/Pidl -%{perl_vendorlib}/Parse/Pidl/CUtil.pm -%{perl_vendorlib}/Parse/Pidl/Samba4.pm -%{perl_vendorlib}/Parse/Pidl/Expr.pm -%{perl_vendorlib}/Parse/Pidl/ODL.pm -%{perl_vendorlib}/Parse/Pidl/Typelist.pm -%{perl_vendorlib}/Parse/Pidl/IDL.pm -%{perl_vendorlib}/Parse/Pidl/Compat.pm -%dir %{perl_vendorlib}/Parse/Pidl/Wireshark -%{perl_vendorlib}/Parse/Pidl/Wireshark/Conformance.pm -%{perl_vendorlib}/Parse/Pidl/Wireshark/NDR.pm -%{perl_vendorlib}/Parse/Pidl/Dump.pm -%dir %{perl_vendorlib}/Parse/Pidl/Samba3 -%{perl_vendorlib}/Parse/Pidl/Samba3/ServerNDR.pm -%{perl_vendorlib}/Parse/Pidl/Samba3/ClientNDR.pm -%dir %{perl_vendorlib}/Parse/Pidl/Samba4 -%{perl_vendorlib}/Parse/Pidl/Samba4/Header.pm -%dir %{perl_vendorlib}/Parse/Pidl/Samba4/COM -%{perl_vendorlib}/Parse/Pidl/Samba4/COM/Header.pm -%{perl_vendorlib}/Parse/Pidl/Samba4/COM/Proxy.pm -%{perl_vendorlib}/Parse/Pidl/Samba4/COM/Stub.pm -%{perl_vendorlib}/Parse/Pidl/Samba4/Python.pm -%{perl_vendorlib}/Parse/Pidl/Samba4/Template.pm -%dir %{perl_vendorlib}/Parse/Pidl/Samba4/NDR -%{perl_vendorlib}/Parse/Pidl/Samba4/NDR/Server.pm -%{perl_vendorlib}/Parse/Pidl/Samba4/NDR/Client.pm -%{perl_vendorlib}/Parse/Pidl/Samba4/NDR/Parser.pm -%{perl_vendorlib}/Parse/Pidl/Samba4/TDR.pm -%{perl_vendorlib}/Parse/Pidl/NDR.pm -%{perl_vendorlib}/Parse/Pidl/Util.pm -%{_mandir}/man1/pidl* -%{_mandir}/man3/Parse::Pidl* - ### PYTHON3 %files -n python3-%{name} %dir %{python3_sitearch}/samba/ @@ -1996,6 +1947,7 @@ fi %{python3_sitearch}/samba/netcmd/__pycache__/__init__.*.pyc %{python3_sitearch}/samba/netcmd/__pycache__/common.*.pyc %{python3_sitearch}/samba/netcmd/__pycache__/computer.*.pyc +%{python3_sitearch}/samba/netcmd/__pycache__/contact.*.pyc %{python3_sitearch}/samba/netcmd/__pycache__/dbcheck.*.pyc %{python3_sitearch}/samba/netcmd/__pycache__/delegation.*.pyc %{python3_sitearch}/samba/netcmd/__pycache__/dns.*.pyc @@ -2023,6 +1975,7 @@ fi %{python3_sitearch}/samba/netcmd/__pycache__/visualize.*.pyc %{python3_sitearch}/samba/netcmd/common.py %{python3_sitearch}/samba/netcmd/computer.py +%{python3_sitearch}/samba/netcmd/contact.py %{python3_sitearch}/samba/netcmd/dbcheck.py %{python3_sitearch}/samba/netcmd/delegation.py %{python3_sitearch}/samba/netcmd/dns.py @@ -2063,7 +2016,6 @@ fi %{python3_sitearch}/samba/samba3/smbd.*.so %{python3_sitearch}/samba/sd_utils.py %{python3_sitearch}/samba/sites.py -%{python3_sitearch}/samba/smb.*.so %{python3_sitearch}/samba/subnets.py %dir %{python3_sitearch}/samba/subunit %{python3_sitearch}/samba/subunit/__init__.py @@ -2078,10 +2030,6 @@ fi %{python3_sitearch}/samba/third_party/__pycache__/__init__.*.pyc %{python3_sitearch}/samba/upgrade.py %{python3_sitearch}/samba/upgradehelpers.py -%dir %{python3_sitearch}/samba/web_server -%{python3_sitearch}/samba/web_server/__init__.py -%dir %{python3_sitearch}/samba/web_server/__pycache__ -%{python3_sitearch}/samba/web_server/__pycache__/__init__.*.pyc %{python3_sitearch}/samba/werror.*.so %{python3_sitearch}/samba/xattr.py %{python3_sitearch}/samba/xattr_native.*.so @@ -2177,6 +2125,7 @@ fi %{python3_sitearch}/samba/tests/__pycache__/auth_log_netlogon.*.pyc %{python3_sitearch}/samba/tests/__pycache__/auth_log_netlogon_bad_creds.*.pyc %{python3_sitearch}/samba/tests/__pycache__/auth_log_samlogon.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/auth_log_winbind.*.pyc %{python3_sitearch}/samba/tests/__pycache__/common.*.pyc %{python3_sitearch}/samba/tests/__pycache__/complex_expressions.*.pyc %{python3_sitearch}/samba/tests/__pycache__/core.*.pyc @@ -2249,6 +2198,7 @@ fi %{python3_sitearch}/samba/tests/__pycache__/samdb.*.pyc %{python3_sitearch}/samba/tests/__pycache__/samdb_api.*.pyc %{python3_sitearch}/samba/tests/__pycache__/security.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/segfault.*.pyc %{python3_sitearch}/samba/tests/__pycache__/smb.*.pyc %{python3_sitearch}/samba/tests/__pycache__/smbd_base.*.pyc %{python3_sitearch}/samba/tests/__pycache__/source.*.pyc @@ -2258,6 +2208,7 @@ fi %{python3_sitearch}/samba/tests/__pycache__/upgrade.*.pyc %{python3_sitearch}/samba/tests/__pycache__/upgradeprovision.*.pyc %{python3_sitearch}/samba/tests/__pycache__/upgradeprovisionneeddc.*.pyc +%{python3_sitearch}/samba/tests/__pycache__/usage.*.pyc %{python3_sitearch}/samba/tests/__pycache__/xattr.*.pyc %{python3_sitearch}/samba/tests/audit_log_base.py %{python3_sitearch}/samba/tests/audit_log_dsdb.py @@ -2270,12 +2221,14 @@ fi %{python3_sitearch}/samba/tests/auth_log_netlogon.py %{python3_sitearch}/samba/tests/auth_log_pass_change.py %{python3_sitearch}/samba/tests/auth_log_samlogon.py +%{python3_sitearch}/samba/tests/auth_log_winbind.py %dir %{python3_sitearch}/samba/tests/blackbox %{python3_sitearch}/samba/tests/blackbox/__init__.py %dir %{python3_sitearch}/samba/tests/blackbox/__pycache__ %{python3_sitearch}/samba/tests/blackbox/__pycache__/__init__.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/bug13653.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/check_output.*.pyc +%{python3_sitearch}/samba/tests/blackbox/__pycache__/downgradedatabase.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/ndrdump.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/netads_json.*.pyc %{python3_sitearch}/samba/tests/blackbox/__pycache__/samba_dnsupdate.*.pyc @@ -2286,6 +2239,7 @@ fi %{python3_sitearch}/samba/tests/blackbox/__pycache__/traffic_summary.*.pyc %{python3_sitearch}/samba/tests/blackbox/bug13653.py %{python3_sitearch}/samba/tests/blackbox/check_output.py +%{python3_sitearch}/samba/tests/blackbox/downgradedatabase.py %{python3_sitearch}/samba/tests/blackbox/ndrdump.py %{python3_sitearch}/samba/tests/blackbox/netads_json.py %{python3_sitearch}/samba/tests/blackbox/samba_dnsupdate.py @@ -2337,9 +2291,7 @@ fi %{python3_sitearch}/samba/tests/dns_base.py %{python3_sitearch}/samba/tests/dns_forwarder.py %dir %{python3_sitearch}/samba/tests/dns_forwarder_helpers -%{python3_sitearch}/samba/tests/dns_forwarder_helpers/__pycache__/dns_hub.*.pyc %{python3_sitearch}/samba/tests/dns_forwarder_helpers/__pycache__/server.*.pyc -%{python3_sitearch}/samba/tests/dns_forwarder_helpers/dns_hub.py %{python3_sitearch}/samba/tests/dns_forwarder_helpers/server.py %{python3_sitearch}/samba/tests/dns_invalid.py %{python3_sitearch}/samba/tests/dns_tkey.py @@ -2428,18 +2380,24 @@ fi %{python3_sitearch}/samba/tests/samba_tool/__pycache__/__init__.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/base.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/computer.*.pyc +%{python3_sitearch}/samba/tests/samba_tool/__pycache__/contact.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/demote.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/dnscmd.*.pyc +%{python3_sitearch}/samba/tests/samba_tool/__pycache__/drs_clone_dc_data_lmdb_size.*.pyc +%{python3_sitearch}/samba/tests/samba_tool/__pycache__/dsacl.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/forest.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/fsmo.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/gpo.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/group.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/help.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/join.*.pyc +%{python3_sitearch}/samba/tests/samba_tool/__pycache__/join_lmdb_size.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/ntacl.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/ou.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/passwordsettings.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/processes.*.pyc +%{python3_sitearch}/samba/tests/samba_tool/__pycache__/promote_dc_lmdb_size.*.pyc +%{python3_sitearch}/samba/tests/samba_tool/__pycache__/provision_lmdb_size.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/provision_password_check.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/rodc.*.pyc %{python3_sitearch}/samba/tests/samba_tool/__pycache__/schema.*.pyc @@ -2453,18 +2411,24 @@ fi %{python3_sitearch}/samba/tests/samba_tool/__pycache__/visualize_drs.*.pyc %{python3_sitearch}/samba/tests/samba_tool/base.py %{python3_sitearch}/samba/tests/samba_tool/computer.py +%{python3_sitearch}/samba/tests/samba_tool/contact.py %{python3_sitearch}/samba/tests/samba_tool/demote.py %{python3_sitearch}/samba/tests/samba_tool/dnscmd.py +%{python3_sitearch}/samba/tests/samba_tool/drs_clone_dc_data_lmdb_size.py +%{python3_sitearch}/samba/tests/samba_tool/dsacl.py %{python3_sitearch}/samba/tests/samba_tool/forest.py %{python3_sitearch}/samba/tests/samba_tool/fsmo.py %{python3_sitearch}/samba/tests/samba_tool/gpo.py %{python3_sitearch}/samba/tests/samba_tool/group.py %{python3_sitearch}/samba/tests/samba_tool/help.py %{python3_sitearch}/samba/tests/samba_tool/join.py +%{python3_sitearch}/samba/tests/samba_tool/join_lmdb_size.py %{python3_sitearch}/samba/tests/samba_tool/ntacl.py %{python3_sitearch}/samba/tests/samba_tool/ou.py %{python3_sitearch}/samba/tests/samba_tool/passwordsettings.py %{python3_sitearch}/samba/tests/samba_tool/processes.py +%{python3_sitearch}/samba/tests/samba_tool/promote_dc_lmdb_size.py +%{python3_sitearch}/samba/tests/samba_tool/provision_lmdb_size.py %{python3_sitearch}/samba/tests/samba_tool/provision_password_check.py %{python3_sitearch}/samba/tests/samba_tool/rodc.py %{python3_sitearch}/samba/tests/samba_tool/schema.py @@ -2479,6 +2443,7 @@ fi %{python3_sitearch}/samba/tests/samdb.py %{python3_sitearch}/samba/tests/samdb_api.py %{python3_sitearch}/samba/tests/security.py +%{python3_sitearch}/samba/tests/segfault.py %{python3_sitearch}/samba/tests/smb.py %{python3_sitearch}/samba/tests/smbd_base.py %{python3_sitearch}/samba/tests/source.py @@ -2488,6 +2453,7 @@ fi %{python3_sitearch}/samba/tests/upgrade.py %{python3_sitearch}/samba/tests/upgradeprovision.py %{python3_sitearch}/samba/tests/upgradeprovisionneeddc.py +%{python3_sitearch}/samba/tests/usage.py %{python3_sitearch}/samba/tests/xattr.py ### TEST @@ -2872,10 +2838,8 @@ fi %{_datadir}/ctdb/tests/eventscripts/05.system.monitor.007.sh %{_datadir}/ctdb/tests/eventscripts/05.system.monitor.011.sh %{_datadir}/ctdb/tests/eventscripts/05.system.monitor.012.sh -%{_datadir}/ctdb/tests/eventscripts/05.system.monitor.013.sh %{_datadir}/ctdb/tests/eventscripts/05.system.monitor.014.sh %{_datadir}/ctdb/tests/eventscripts/05.system.monitor.015.sh -%{_datadir}/ctdb/tests/eventscripts/05.system.monitor.016.sh %{_datadir}/ctdb/tests/eventscripts/05.system.monitor.017.sh %{_datadir}/ctdb/tests/eventscripts/05.system.monitor.018.sh %{_datadir}/ctdb/tests/eventscripts/06.nfs.releaseip.001.sh @@ -3211,6 +3175,7 @@ fi %{_datadir}/ctdb/tests/simple/80_ctdb_traverse.sh %{_datadir}/ctdb/tests/simple/81_tunnel_ring.sh %{_datadir}/ctdb/tests/simple/90_debug_hung_script.sh +%{_datadir}/ctdb/tests/simple/91_version_check.sh %dir %{_datadir}/ctdb/tests/simple/scripts @@ -3439,6 +3404,9 @@ fi %endif # with_clustering_support %changelog +* Wed Aug 21 2019 Guenther Deschner - 4.11.0rc2-0 +- Update to Samba 4.11.0rc2 + * Tue Aug 20 2019 Guenther Deschner - 4.11.0rc1-0 - Update to Samba 4.11.0rc1 diff --git a/sources b/sources index 1b19fc6..423a539 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.11.0rc1.tar.xz) = 618e96d39eeada94675bde0c7ab287fdb59674bb5fe3ae75f62723f87554d3302c1afc00894fe8dea0e227c1e5db07f222307e0062dc0db4ffb885441facbc94 -SHA512 (samba-4.11.0rc1.tar.asc) = eb18a854b7145711ae0a3da32a6006e4bee36d13a74800748521432728f1ba6eca7bdcf94ce1ec3b17d6849527fcf37300a0b5f7ce2e0aa50009de66352cc72a +SHA512 (samba-4.11.0rc2.tar.xz) = bc91fa6d6de0af44a3f8e8438281c7d9e74e7fed981e65f7cd4e9f1ebbc11d25b1cab3dd22fd375f81d620d0f128b0c879028448bdb6a918cd89682a3f828ed8 +SHA512 (samba-4.11.0rc2.tar.asc) = 0472840871106f89e3695098a064004bbcab5e0950252ac41c613f4610a0239471dfa34bae452abf417496eaa3025afc35a28f449f28ba97f4c731e2b4e3390b From 7b283dee16c4d18cb7b6248c4a54d581c1bcd154 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 22 Aug 2019 17:36:25 +0200 Subject: [PATCH 70/76] Move the NetworkManager dispatcher script out of /etc It's not user configuration and shouldn't ever have been there. Except for that it used to be the only location NetworkManager looked into. With NetworkManager 1.20 that is no longer the case and the dispatcher scripts can be moved to /usr/lib. --- samba.spec | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/samba.spec b/samba.spec index 97d8737..ad1cdcb 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 0 +%define main_release 1 %define samba_version 4.11.0 %define talloc_version 2.2.0 @@ -634,6 +634,9 @@ Requires: libwbclient = %{samba_depver} Provides: samba4-winbind = %{samba_depver} Obsoletes: samba4-winbind < %{samba_depver} +# Old NetworkManager expects the dispatcher scripts in a different place +Conflicts: NetworkManager < 1.20 + %description winbind The samba-winbind package provides the winbind NSS library, and some client tools. Winbind enables Linux to be a full member in Windows domains and to use @@ -930,9 +933,9 @@ install -m 0644 ctdb/config/ctdb.service %{buildroot}%{_unitdir} %endif # NetworkManager online/offline script -install -d -m 0755 %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/ +install -d -m 0755 %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d/ install -m 0755 packaging/NetworkManager/30-winbind-systemd \ - %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/30-winbind + %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d/30-winbind # winbind krb5 plugins install -d -m 0755 %{buildroot}%{_libdir}/krb5/plugins/libkrb5 @@ -2494,7 +2497,7 @@ fi %{_sbindir}/winbindd %attr(750,root,wbpriv) %dir /var/lib/samba/winbindd_privileged %{_unitdir}/winbind.service -%{_sysconfdir}/NetworkManager/dispatcher.d/30-winbind +%{_prefix}/lib/NetworkManager %{_mandir}/man8/winbindd.8* %{_mandir}/man8/idmap_*.8* @@ -3404,6 +3407,9 @@ fi %endif # with_clustering_support %changelog +* Mon Aug 26 2019 Lubomir Rintel - 2:4.11.0-0.1.rc2 +- Move the NetworkManager dispatcher script out of /etc + * Wed Aug 21 2019 Guenther Deschner - 4.11.0rc2-0 - Update to Samba 4.11.0rc2 From ddcbb021850cda13ac3cc3d75da71832f2bf36aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Thu, 29 Aug 2019 13:26:24 +0200 Subject: [PATCH 71/76] re-add pidl resolves: #1746014 Guenther --- pidl.patch | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++ samba.spec | 60 ++++++++++++++++++++++++++- 2 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 pidl.patch diff --git a/pidl.patch b/pidl.patch new file mode 100644 index 0000000..d61ca6a --- /dev/null +++ b/pidl.patch @@ -0,0 +1,119 @@ +From 838457ac4f9f3f6c1bb5936738566210a62cbdc5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?G=C3=BCnther=20Deschner?= +Date: Tue, 27 Aug 2019 15:25:13 +0200 +Subject: [PATCH] Revert "waf: install: Remove installation of PIDL and + manpages." + +This reverts commit e24e344d0da58013fd5fa404529fe1d25ef403bf. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14103 + +Guenther + +Signed-off-by: Guenther Deschner +--- + pidl/lib/wscript_build | 37 +++++++++++++++++++++++++++++++++++++ + pidl/wscript | 38 ++++++++++++++++++++++++++++++++++++++ + 2 files changed, 75 insertions(+) + create mode 100644 pidl/lib/wscript_build + +diff --git a/pidl/lib/wscript_build b/pidl/lib/wscript_build +new file mode 100644 +index 00000000000..54b3170c4e2 +--- /dev/null ++++ b/pidl/lib/wscript_build +@@ -0,0 +1,37 @@ ++#!/usr/bin/env python ++ ++# install the pidl modules ++bld.INSTALL_FILES(bld.env.PERL_LIB_INSTALL_DIR, ++ ''' ++ Parse/Pidl.pm ++ Parse/Pidl/Samba4.pm ++ Parse/Pidl/CUtil.pm ++ Parse/Pidl/Expr.pm ++ Parse/Pidl/Wireshark/Conformance.pm ++ Parse/Pidl/Wireshark/NDR.pm ++ Parse/Pidl/ODL.pm ++ Parse/Pidl/Dump.pm ++ Parse/Pidl/Util.pm ++ Parse/Pidl/Samba4/Header.pm ++ Parse/Pidl/Samba4/COM/Header.pm ++ Parse/Pidl/Samba4/COM/Proxy.pm ++ Parse/Pidl/Samba4/COM/Stub.pm ++ Parse/Pidl/Samba4/TDR.pm ++ Parse/Pidl/Samba4/NDR/Server.pm ++ Parse/Pidl/Samba4/NDR/Client.pm ++ Parse/Pidl/Samba4/NDR/Parser.pm ++ Parse/Pidl/Samba4/Python.pm ++ Parse/Pidl/Samba4/Template.pm ++ Parse/Pidl/IDL.pm ++ Parse/Pidl/Typelist.pm ++ Parse/Pidl/Samba3/ClientNDR.pm ++ Parse/Pidl/Samba3/ServerNDR.pm ++ Parse/Pidl/Compat.pm ++ Parse/Pidl/NDR.pm ++ ''', ++ flat=False) ++ ++if not bld.CONFIG_SET('USING_SYSTEM_PARSE_YAPP_DRIVER'): ++ bld.INSTALL_FILES(bld.env.PERL_LIB_INSTALL_DIR, ++ 'Parse/Yapp/Driver.pm', ++ flat=False) +diff --git a/pidl/wscript b/pidl/wscript +index 01b71bd8b27..a2a15d36851 100644 +--- a/pidl/wscript ++++ b/pidl/wscript +@@ -32,11 +32,49 @@ def configure(conf): + # Check if perl(Parse::Yapp::Driver) is available. + check_system_perl_module(conf, "Parse::Yapp::Driver", 1.05) + ++ # we need a recent version of MakeMaker to get the right man page names ++ if conf.CHECK_PERL_MANPAGE(): ++ conf.env.PERLMAN1EXT = conf.CHECK_PERL_MANPAGE(section='1') ++ conf.env.PERLMAN3EXT = conf.CHECK_PERL_MANPAGE(section='3') ++ conf.DEFINE('HAVE_PERL_MAKEMAKER', 1) ++ + # yapp is used for building the parser + conf.find_program('yapp', var='YAPP') + conf.find_program('pod2man', var='POD2MAN') + + def build(bld): ++ bld.INSTALL_FILES('${BINDIR}', 'pidl', chmod=MODE_755, perl_fixup=True) ++ ++ bld.RECURSE('lib') ++ ++ if not bld.CONFIG_SET('HAVE_PERL_MAKEMAKER'): ++ return ++ ++ pidl_manpages = { ++ 'pidl': 'man1/pidl.${PERLMAN1EXT}', ++ 'lib/Parse/Pidl/NDR.pm': 'man3/Parse::Pidl::NDR.${PERLMAN3EXT}', ++ 'lib/Parse/Pidl/Wireshark/Conformance.pm': 'man3/Parse::Pidl::Wireshark::Conformance.${PERLMAN3EXT}', ++ 'lib/Parse/Pidl/Dump.pm': 'man3/Parse::Pidl::Dump.${PERLMAN3EXT}', ++ 'lib/Parse/Pidl/Util.pm': 'man3/Parse::Pidl::Util.${PERLMAN3EXT}', ++ 'lib/Parse/Pidl/Wireshark/NDR.pm': 'man3/Parse::Pidl::Wireshark::NDR.${PERLMAN3EXT}' ++ } ++ ++ for k in pidl_manpages.keys(): ++ pidl_manpages[k] = bld.EXPAND_VARIABLES(pidl_manpages[k]) ++ ++ # use perl to build the manpages ++ bld.env.pidl_srcdir = os.path.join(bld.srcnode.abspath(), 'pidl') ++ ++ bld.SET_BUILD_GROUP('final') ++ if 'POD2MAN' in bld.env and bld.env['POD2MAN'] != '': ++ for src in pidl_manpages.keys(): ++ manpage = pidl_manpages[src] ++ section = manpage.rsplit( ".", 1)[1] ++ bld(rule='${POD2MAN} -c "Samba Documentation" -s %s ${SRC} ${TGT}' % section, ++ shell=True, ++ source=src, ++ install_path=os.path.dirname(bld.EXPAND_VARIABLES('${MANDIR}/'+manpage)), ++ target=os.path.basename(manpage)) + + # we want to prefer the git version of the parsers if we can. + # Only if the source has changed do we want to re-run yapp +-- +2.21.0 + diff --git a/samba.spec b/samba.spec index ad1cdcb..9a88518 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 1 +%define main_release 2 %define samba_version 4.11.0 %define talloc_version 2.2.0 @@ -118,6 +118,8 @@ Source14: samba.pamd Source201: README.downgrade +Patch0: pidl.patch + Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -572,6 +574,21 @@ The python3-%{name}-dc package contains the Python libraries needed by programs to manage Samba AD. %endif +### PIDL +%package pidl +Summary: Perl IDL compiler +Requires: perl-interpreter +Requires: perl(Parse::Yapp) +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +BuildArch: noarch + +Provides: samba4-pidl = %{samba_depver} +Obsoletes: samba4-pidl < %{samba_depver} + +%description pidl +The %{name}-pidl package contains the Perl IDL compiler used by Samba +and Wireshark to parse IDL and similar protocols + ### TEST %package test Summary: Testing tools for Samba servers and clients @@ -1816,6 +1833,44 @@ fi %{_libdir}/pkgconfig/wbclient.pc %endif # with_libwbclient +### PIDL +%files pidl +%attr(755,root,root) %{_bindir}/pidl +%dir %{perl_vendorlib}/Parse +%{perl_vendorlib}/Parse/Pidl.pm +%dir %{perl_vendorlib}/Parse/Pidl +%{perl_vendorlib}/Parse/Pidl/CUtil.pm +%{perl_vendorlib}/Parse/Pidl/Samba4.pm +%{perl_vendorlib}/Parse/Pidl/Expr.pm +%{perl_vendorlib}/Parse/Pidl/ODL.pm +%{perl_vendorlib}/Parse/Pidl/Typelist.pm +%{perl_vendorlib}/Parse/Pidl/IDL.pm +%{perl_vendorlib}/Parse/Pidl/Compat.pm +%dir %{perl_vendorlib}/Parse/Pidl/Wireshark +%{perl_vendorlib}/Parse/Pidl/Wireshark/Conformance.pm +%{perl_vendorlib}/Parse/Pidl/Wireshark/NDR.pm +%{perl_vendorlib}/Parse/Pidl/Dump.pm +%dir %{perl_vendorlib}/Parse/Pidl/Samba3 +%{perl_vendorlib}/Parse/Pidl/Samba3/ServerNDR.pm +%{perl_vendorlib}/Parse/Pidl/Samba3/ClientNDR.pm +%dir %{perl_vendorlib}/Parse/Pidl/Samba4 +%{perl_vendorlib}/Parse/Pidl/Samba4/Header.pm +%dir %{perl_vendorlib}/Parse/Pidl/Samba4/COM +%{perl_vendorlib}/Parse/Pidl/Samba4/COM/Header.pm +%{perl_vendorlib}/Parse/Pidl/Samba4/COM/Proxy.pm +%{perl_vendorlib}/Parse/Pidl/Samba4/COM/Stub.pm +%{perl_vendorlib}/Parse/Pidl/Samba4/Python.pm +%{perl_vendorlib}/Parse/Pidl/Samba4/Template.pm +%dir %{perl_vendorlib}/Parse/Pidl/Samba4/NDR +%{perl_vendorlib}/Parse/Pidl/Samba4/NDR/Server.pm +%{perl_vendorlib}/Parse/Pidl/Samba4/NDR/Client.pm +%{perl_vendorlib}/Parse/Pidl/Samba4/NDR/Parser.pm +%{perl_vendorlib}/Parse/Pidl/Samba4/TDR.pm +%{perl_vendorlib}/Parse/Pidl/NDR.pm +%{perl_vendorlib}/Parse/Pidl/Util.pm +%{_mandir}/man1/pidl* +%{_mandir}/man3/Parse::Pidl* + ### PYTHON3 %files -n python3-%{name} %dir %{python3_sitearch}/samba/ @@ -3407,6 +3462,9 @@ fi %endif # with_clustering_support %changelog +* Tue Aug 27 2019 Guenther Deschner - 4.11.0rc2-2 +- resolves: #1746014 - re-add pidl + * Mon Aug 26 2019 Lubomir Rintel - 2:4.11.0-0.1.rc2 - Move the NetworkManager dispatcher script out of /etc From 7e06ae540c408c063b7c750e2b59caf5db074306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 3 Sep 2019 14:31:58 +0200 Subject: [PATCH 72/76] Update to Samba 4.11.0rc3 resolves: #1746225, #1748308 - Security fixes for CVE-2019-10197 Guenther --- .gitignore | 2 ++ samba.spec | 6 +++++- sources | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 90e2be2..891f1df 100644 --- a/.gitignore +++ b/.gitignore @@ -173,3 +173,5 @@ samba-3.6.0pre1.tar.gz /samba-4.11.0rc1.tar.asc /samba-4.11.0rc2.tar.xz /samba-4.11.0rc2.tar.asc +/samba-4.11.0rc3.tar.xz +/samba-4.11.0rc3.tar.asc diff --git a/samba.spec b/samba.spec index 9a88518..c344b33 100644 --- a/samba.spec +++ b/samba.spec @@ -14,7 +14,7 @@ %define tevent_version 0.10.0 %define ldb_version 2.0.5 # This should be rc1 or nil -%define pre_release rc2 +%define pre_release rc3 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -3462,6 +3462,10 @@ fi %endif # with_clustering_support %changelog +* Tue Sep 03 2019 Guenther Deschner - 4.11.0rc3-2 +- Update to Samba 4.11.0rc3 +- resolves: #1746225, #1748308 - Security fixes for CVE-2019-10197 + * Tue Aug 27 2019 Guenther Deschner - 4.11.0rc2-2 - resolves: #1746014 - re-add pidl diff --git a/sources b/sources index 423a539..bcc26d1 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.11.0rc2.tar.xz) = bc91fa6d6de0af44a3f8e8438281c7d9e74e7fed981e65f7cd4e9f1ebbc11d25b1cab3dd22fd375f81d620d0f128b0c879028448bdb6a918cd89682a3f828ed8 -SHA512 (samba-4.11.0rc2.tar.asc) = 0472840871106f89e3695098a064004bbcab5e0950252ac41c613f4610a0239471dfa34bae452abf417496eaa3025afc35a28f449f28ba97f4c731e2b4e3390b +SHA512 (samba-4.11.0rc3.tar.xz) = 75a68eb8e800e67d926abb49da9beaaf99af7064d4731348f05b5857a6b5a2a03e5c8790267491f1f7baec129e22634a9b04cd5d97d2c59f6ec8cef455eecb60 +SHA512 (samba-4.11.0rc3.tar.asc) = acc56ff0acbb95592867201957c6c179e59a619a15b5345868de21ba3c79c5163f576bcdfce2531112db32d67caaf44a42583900fca768ad0a9fc6dbddc9658e From 068248bedae7479fff38f3f8a04b19d33e846354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 3 Sep 2019 14:44:38 +0200 Subject: [PATCH 73/76] Fix ldb version dependency Guenther --- samba.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index c344b33..b97765a 100644 --- a/samba.spec +++ b/samba.spec @@ -12,7 +12,7 @@ %define talloc_version 2.2.0 %define tdb_version 1.4.2 %define tevent_version 0.10.0 -%define ldb_version 2.0.5 +%define ldb_version 2.0.6 # This should be rc1 or nil %define pre_release rc3 From 5e86fbcc8ae717c49bf88a7229c1a6cfceb24f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 4 Sep 2019 09:13:29 +0200 Subject: [PATCH 74/76] Add missing files Guenther --- samba.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samba.spec b/samba.spec index b97765a..b67b732 100644 --- a/samba.spec +++ b/samba.spec @@ -1538,9 +1538,10 @@ fi %{_unitdir}/samba.service %{_bindir}/samba-tool %{_sbindir}/samba -%{_sbindir}/samba_kcc %{_sbindir}/samba_dnsupdate +%{_sbindir}/samba_downgrade_db %{_sbindir}/samba-gpupdate +%{_sbindir}/samba_kcc %{_sbindir}/samba_spnupdate %{_sbindir}/samba_upgradedns @@ -1604,6 +1605,7 @@ fi %dir /var/lib/samba/sysvol %{_datadir}/samba/setup %{_mandir}/man8/samba.8* +%{_mandir}/man8/samba_downgrade_db.8* %{_mandir}/man8/samba-gpupdate.8* %{_mandir}/man8/samba-tool.8* From 203ce796bb192410bbae7d37938cf19d5b1c05bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 11 Sep 2019 10:34:28 +0200 Subject: [PATCH 75/76] Update to Samba 4.11.0rc4 Guenther Signed-off-by: Guenther Deschner --- .gitignore | 2 ++ samba.spec | 8 +++++--- sources | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 891f1df..0974f8f 100644 --- a/.gitignore +++ b/.gitignore @@ -175,3 +175,5 @@ samba-3.6.0pre1.tar.gz /samba-4.11.0rc2.tar.asc /samba-4.11.0rc3.tar.xz /samba-4.11.0rc3.tar.asc +/samba-4.11.0rc4.tar.xz +/samba-4.11.0rc4.tar.asc diff --git a/samba.spec b/samba.spec index b67b732..be3ad90 100644 --- a/samba.spec +++ b/samba.spec @@ -12,9 +12,9 @@ %define talloc_version 2.2.0 %define tdb_version 1.4.2 %define tevent_version 0.10.0 -%define ldb_version 2.0.6 +%define ldb_version 2.0.7 # This should be rc1 or nil -%define pre_release rc3 +%define pre_release rc4 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -2736,7 +2736,6 @@ fi %{_libexecdir}/ctdb/tests/sock_io_test %{_libexecdir}/ctdb/tests/srvid_test %{_libexecdir}/ctdb/tests/system_socket_test -%{_libexecdir}/ctdb/tests/test_mutex_raw %{_libexecdir}/ctdb/tests/transaction_loop %{_libexecdir}/ctdb/tests/tunnel_cmd %{_libexecdir}/ctdb/tests/tunnel_test @@ -3464,6 +3463,9 @@ fi %endif # with_clustering_support %changelog +* Wed Sep 11 2019 Guenther Deschner - 4.11.0rc4-2 +- Update to Samba 4.11.0rc4 + * Tue Sep 03 2019 Guenther Deschner - 4.11.0rc3-2 - Update to Samba 4.11.0rc3 - resolves: #1746225, #1748308 - Security fixes for CVE-2019-10197 diff --git a/sources b/sources index bcc26d1..4860408 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.11.0rc3.tar.xz) = 75a68eb8e800e67d926abb49da9beaaf99af7064d4731348f05b5857a6b5a2a03e5c8790267491f1f7baec129e22634a9b04cd5d97d2c59f6ec8cef455eecb60 -SHA512 (samba-4.11.0rc3.tar.asc) = acc56ff0acbb95592867201957c6c179e59a619a15b5345868de21ba3c79c5163f576bcdfce2531112db32d67caaf44a42583900fca768ad0a9fc6dbddc9658e +SHA512 (samba-4.11.0rc4.tar.xz) = 630ac4f80cc385bd2a168cd0f97b923cf4d8dfb64c7e0540cdc98261b17b1ce6e754f8e6fcecc662c1baf2e2f0c70556ce5f7a2cc6f133199fee821be3210883 +SHA512 (samba-4.11.0rc4.tar.asc) = c1e9eb34ce44195b4e653a024b07d816180ef5a2e6165e41bafc0bfe6b9d9b30bd15813b841e8ea2a85e7432f83dc28501fb9b84fb9c19179071fff3df6a13e1 From 4c73b568ce7649ce722549652a15f3e387e6b2e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 17 Sep 2019 15:35:18 +0200 Subject: [PATCH 76/76] Update to Samba 4.11.0 Guenther --- .gitignore | 2 ++ samba.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0974f8f..3a6011f 100644 --- a/.gitignore +++ b/.gitignore @@ -177,3 +177,5 @@ samba-3.6.0pre1.tar.gz /samba-4.11.0rc3.tar.asc /samba-4.11.0rc4.tar.xz /samba-4.11.0rc4.tar.asc +/samba-4.11.0.tar.xz +/samba-4.11.0.tar.asc diff --git a/samba.spec b/samba.spec index be3ad90..3182702 100644 --- a/samba.spec +++ b/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 2 +%define main_release 3 %define samba_version 4.11.0 %define talloc_version 2.2.0 @@ -14,7 +14,7 @@ %define tevent_version 0.10.0 %define ldb_version 2.0.7 # This should be rc1 or nil -%define pre_release rc4 +%define pre_release %nil %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -3463,6 +3463,9 @@ fi %endif # with_clustering_support %changelog +* Tue Sep 17 2019 Guenther Deschner - 4.11.0-3 +- Update to Samba 4.11.0 + * Wed Sep 11 2019 Guenther Deschner - 4.11.0rc4-2 - Update to Samba 4.11.0rc4 diff --git a/sources b/sources index 4860408..549c831 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.11.0rc4.tar.xz) = 630ac4f80cc385bd2a168cd0f97b923cf4d8dfb64c7e0540cdc98261b17b1ce6e754f8e6fcecc662c1baf2e2f0c70556ce5f7a2cc6f133199fee821be3210883 -SHA512 (samba-4.11.0rc4.tar.asc) = c1e9eb34ce44195b4e653a024b07d816180ef5a2e6165e41bafc0bfe6b9d9b30bd15813b841e8ea2a85e7432f83dc28501fb9b84fb9c19179071fff3df6a13e1 +SHA512 (samba-4.11.0.tar.xz) = 7e044c761c342030930f7988f484657664aad269236cb9103aa029540417e34263e47b5910aff8ef3e913fd00bdd375d940b4d24d09ab9244b05ab79c0814ae2 +SHA512 (samba-4.11.0.tar.asc) = 09dfb708b691d3e4d460f8c08b353c6d511c60176b6ff29f4723ea905b05fdd6bcd2a68d62d52f6bcf9514ad6feaf75e1d08b76136852e6f1a944fe814ab763b