Remove obsolete patches

Guenther
This commit is contained in:
Günther Deschner 2020-11-03 13:49:44 +01:00
parent 5f0457d042
commit 19efd0180f
6 changed files with 0 additions and 1922 deletions

View File

@ -1,66 +0,0 @@
From e3629a3924107507be9ddb2c001f9843854ddf3b Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Tue, 25 Aug 2020 17:39:18 +0200
Subject: [PATCH] third_party: Update resolv_wrapper to version 1.1.7
This fixes some Samba tests which redirect stderr to stdout and then get
more messages than expected.
Signed-off-by: Andreas Schneider <asn@samba.org>
---
buildtools/wafsamba/samba_third_party.py | 2 +-
third_party/resolv_wrapper/resolv_wrapper.c | 4 ++--
third_party/resolv_wrapper/wscript | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/buildtools/wafsamba/samba_third_party.py b/buildtools/wafsamba/samba_third_party.py
index 318da4f4eff..bc2b21f2a55 100644
--- a/buildtools/wafsamba/samba_third_party.py
+++ b/buildtools/wafsamba/samba_third_party.py
@@ -34,7 +34,7 @@ Build.BuildContext.CHECK_NSS_WRAPPER = CHECK_NSS_WRAPPER
@conf
def CHECK_RESOLV_WRAPPER(conf):
- return conf.CHECK_BUNDLED_SYSTEM_PKG('resolv_wrapper', minversion='1.1.6')
+ return conf.CHECK_BUNDLED_SYSTEM_PKG('resolv_wrapper', minversion='1.1.7')
Build.BuildContext.CHECK_RESOLV_WRAPPER = CHECK_RESOLV_WRAPPER
@conf
diff --git a/third_party/resolv_wrapper/resolv_wrapper.c b/third_party/resolv_wrapper/resolv_wrapper.c
index 0d3f34ce591..b69a55a80e0 100644
--- a/third_party/resolv_wrapper/resolv_wrapper.c
+++ b/third_party/resolv_wrapper/resolv_wrapper.c
@@ -1844,7 +1844,7 @@ static int rwrap_parse_resolv_conf(struct __res_state *state,
fp = fopen(resolv_conf, "r");
if (fp == NULL) {
- RWRAP_LOG(RWRAP_LOG_ERROR,
+ RWRAP_LOG(RWRAP_LOG_WARN,
"Opening %s failed: %s",
resolv_conf, strerror(errno));
return -1;
@@ -1930,7 +1930,7 @@ static int rwrap_parse_resolv_conf(struct __res_state *state,
fclose(fp);
if (nserv == 0) {
- RWRAP_LOG(RWRAP_LOG_ERROR,
+ RWRAP_LOG(RWRAP_LOG_WARN,
"No usable nameservers found in %s",
resolv_conf);
errno = ESRCH;
diff --git a/third_party/resolv_wrapper/wscript b/third_party/resolv_wrapper/wscript
index ea3df498a6e..a7f18389b0f 100644
--- a/third_party/resolv_wrapper/wscript
+++ b/third_party/resolv_wrapper/wscript
@@ -2,7 +2,7 @@
import os
-VERSION="1.1.6"
+VERSION="1.1.7"
def configure(conf):
if conf.CHECK_RESOLV_WRAPPER():
--
GitLab

1389
1624.patch

File diff suppressed because it is too large Load Diff

View File

@ -1,197 +0,0 @@
From 0daa6a2bc688146f4e1d7b5604a6fe231f6d069e Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Thu, 22 Oct 2020 11:08:19 +0200
Subject: [PATCH 1/5] s3:script: Fix test_dfree_quota.sh
source3/script/tests/test_dfree_quota.sh: line 200: [: missing `]'
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14550
Signed-off-by: Andreas Schneider <asn@samba.org>
---
source3/script/tests/test_dfree_quota.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source3/script/tests/test_dfree_quota.sh b/source3/script/tests/test_dfree_quota.sh
index e86d431180a..a1403a8c4ba 100755
--- a/source3/script/tests/test_dfree_quota.sh
+++ b/source3/script/tests/test_dfree_quota.sh
@@ -197,7 +197,7 @@ test_smbcquotas() {
return $status
}
-if [ $protocol != "SMB3" -a $protocol != "NT1"]; then
+if [ $protocol != "SMB3" ] && [ $protocol != "NT1" ]; then
echo "unsupported protocol $protocol" | subunit_fail_test "Test dfree quota"
failed=`expr $failed + 1`
fi
--
GitLab
From 4867cafe766fa8aa69ce005dc5c4f05a4af676c8 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Thu, 22 Oct 2020 17:40:01 +0200
Subject: [PATCH 2/5] buildtools: Do not install binaries which are for
selftest
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14550
Signed-off-by: Andreas Schneider <asn@samba.org>
---
buildtools/wafsamba/wafsamba.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 9f6ee4f5c7f..9dd6d05b91b 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -365,8 +365,10 @@ def SAMBA_BINARY(bld, binname, source,
for_selftest=False):
'''define a Samba binary'''
- if for_selftest and not bld.CONFIG_GET('ENABLE_SELFTEST'):
- enabled=False
+ if for_selftest:
+ install=False
+ if not bld.CONFIG_GET('ENABLE_SELFTEST'):
+ enabled=False
if not enabled:
SET_TARGET_TYPE(bld, binname, 'DISABLED')
--
GitLab
From a4d5a21880b1cc8adfcbebd6940d06e2fdab3f14 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Thu, 22 Oct 2020 17:41:01 +0200
Subject: [PATCH 3/5] unittests: Mark test binaries for selftest
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14550
Signed-off-by: Andreas Schneider <asn@samba.org>
---
testsuite/unittests/wscript | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/testsuite/unittests/wscript b/testsuite/unittests/wscript
index 40fcb01ad57..2b4b37b92de 100644
--- a/testsuite/unittests/wscript
+++ b/testsuite/unittests/wscript
@@ -9,7 +9,7 @@ def build(bld):
bld.SAMBA_BINARY('test_krb5samba',
source='test_krb5_samba.c',
deps='krb5samba cmocka',
- install=False)
+ for_selftest=True)
bld.SAMBA_BINARY('test_sambafs_srv_pipe',
source='test_sambafs_srv_pipe.c',
@@ -18,7 +18,7 @@ def build(bld):
RPC_SAMR
cmocka
''',
- install=False)
+ for_selftest=True)
bld.SAMBA_BINARY('test_lib_util_modules',
source='test_lib_util_modules.c',
@@ -26,7 +26,7 @@ def build(bld):
samba-modules
cmocka
''',
- install=False)
+ for_selftest=True)
bld.SAMBA_MODULE('rpc_test_dummy_module',
source='rpc_test_dummy_module.c',
--
GitLab
From d399761e8261a4de5ce9449f97ade61388e8a1e2 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Fri, 23 Oct 2020 08:53:43 +0200
Subject: [PATCH 4/5] s3:modules: Do not install vfs modules only used for
testing
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14550
Signed-off-by: Andreas Schneider <asn@samba.org>
---
source3/modules/wscript_build | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/source3/modules/wscript_build b/source3/modules/wscript_build
index c4f3db22296..36b047ef79b 100644
--- a/source3/modules/wscript_build
+++ b/source3/modules/wscript_build
@@ -114,7 +114,8 @@ bld.SAMBA3_MODULE('vfs_fake_acls',
deps='samba-util',
init_function='',
internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_fake_acls'),
- enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_fake_acls'))
+ enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_fake_acls'),
+ install=False)
bld.SAMBA3_MODULE('vfs_recycle',
subsystem='vfs',
@@ -622,21 +623,24 @@ bld.SAMBA3_MODULE('vfs_fake_dfq',
source='vfs_fake_dfq.c',
init_function='',
internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_fake_dfq'),
- enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_fake_dfq'))
+ enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_fake_dfq'),
+ install=False)
bld.SAMBA3_MODULE('vfs_error_inject',
subsystem='vfs',
source='vfs_error_inject.c',
init_function='',
internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_error_inject'),
- enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_error_inject'))
+ enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_error_inject'),
+ install=False)
bld.SAMBA3_MODULE('vfs_delay_inject',
subsystem='vfs',
source='vfs_delay_inject.c',
init_function='',
internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_delay_inject'),
- enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_delay_inject'))
+ enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_delay_inject'),
+ install=False)
bld.SAMBA3_MODULE('vfs_widelinks',
subsystem='vfs',
--
GitLab
From 58e412ac6d9822aa65639d7c1171a2723ca3ee8a Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Fri, 23 Oct 2020 08:57:12 +0200
Subject: [PATCH 5/5] examples:auth: Do not install example plugin
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14550
Signed-off-by: Andreas Schneider <asn@samba.org>
---
examples/auth/wscript_build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/examples/auth/wscript_build b/examples/auth/wscript_build
index 91f5302918b..03221238e5f 100644
--- a/examples/auth/wscript_build
+++ b/examples/auth/wscript_build
@@ -6,4 +6,5 @@ bld.SAMBA3_MODULE('auth_skel',
deps='samba-util',
init_function='',
internal_module=bld.SAMBA3_IS_STATIC_MODULE('auth_skel'),
- enabled=bld.SAMBA3_IS_ENABLED_MODULE('auth_skel'))
+ enabled=bld.SAMBA3_IS_ENABLED_MODULE('auth_skel'),
+ install=False)
--
GitLab

View File

@ -1,143 +0,0 @@
From 12b51be8633689763080f2eb1e0b13487e3e71e1 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <ab@samba.org>
Date: Sat, 24 Oct 2020 12:17:44 +0300
Subject: [PATCH] DNS Resolver: support both dnspython before and after 2.0.0
`dnspython` 2.0.0 has many changes and several deprecations like:
```
> dns.resolver.resolve() has been added, allowing control of whether
search lists are used. dns.resolver.query() is retained for backwards
compatibility, but deprecated. The default for search list behavior can
be set at in the resolver object with the use_search_by_default
parameter. The default is False.
> dns.resolver.resolve_address() has been added, allowing easy
address-to-name lookups.
```
The new class `DNSResolver`:
- provides the compatibility layer
- defaults the previous behavior (the search list configured in the
system's resolver configuration is used for relative names)
- defaults lifetime to 15sec (determines the number of seconds
to spend trying to get an answer to the question)
The compatibility shim was developed by Stanislav Levin for FreeIPA and
adopted for Samba by Alexander Bokovoy.
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Signed-off-by: Alexander Bokovoy <ab@samba.org>
---
python/samba/dnsresolver.py | 68 +++++++++++++++++++++++++++
source4/scripting/bin/samba_dnsupdate | 5 +-
2 files changed, 71 insertions(+), 2 deletions(-)
create mode 100644 python/samba/dnsresolver.py
diff --git a/python/samba/dnsresolver.py b/python/samba/dnsresolver.py
new file mode 100644
index 00000000000..a627555a855
--- /dev/null
+++ b/python/samba/dnsresolver.py
@@ -0,0 +1,68 @@
+# Samba wrapper for DNS resolvers
+#
+# Copyright (C) Stanislav Levin <slev@altlinux.org>
+# Copyright (C) Alexander Bokovoy <ab@samba.org>
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+
+import dns.resolver
+import dns.rdatatype
+import dns.reversename
+
+class DNSResolver(dns.resolver.Resolver):
+ """DNS stub resolver compatible with both dnspython < 2.0.0
+ and dnspython >= 2.0.0.
+
+ Set `use_search_by_default` attribute to `True`, which
+ determines the default for whether the search list configured
+ in the system's resolver configuration is used for relative
+ names, and whether the resolver's domain may be added to relative
+ names.
+
+ Increase the default lifetime which determines the number of seconds
+ to spend trying to get an answer to the question. dnspython 2.0.0
+ changes this to 5sec, while the previous one was 30sec.
+ """
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.reset_defaults()
+ self.resolve = getattr(super(), "resolve", self.query)
+ self.resolve_address = getattr(
+ super(),
+ "resolve_address",
+ self._resolve_address
+ )
+
+ def reset_defaults(self):
+ self.use_search_by_default = True
+ # the default is 5sec
+ self.lifetime = 15
+
+ def reset(self):
+ super().reset()
+ self.reset_defaults()
+
+ def _resolve_address(self, ip_address, *args, **kwargs):
+ """Query nameservers for PTR records.
+
+ :param ip_address: IPv4 or IPv6 address
+ :type ip_address: str
+ """
+ return self.resolve(
+ dns.reversename.from_address(ip_address),
+ rdtype=dns.rdatatype.PTR,
+ *args,
+ **kwargs,
+ )
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index 44eb1cadd27..fe04ce71338 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -53,6 +53,7 @@ from samba.compat import get_string
from samba.compat import text_type
import ldb
+from samba.dnsresolver import DNSResolver
import dns.resolver
import dns.exception
@@ -259,7 +260,7 @@ def hostname_match(h1, h2):
def get_resolver(d=None):
resolv_conf = os.getenv('RESOLV_CONF', default='/etc/resolv.conf')
- resolver = dns.resolver.Resolver(filename=resolv_conf, configure=True)
+ resolver = DNSResolver(filename=resolv_conf, configure=True)
if d is not None and d.nameservers != []:
resolver.nameservers = d.nameservers
@@ -271,7 +272,7 @@ def check_one_dns_name(name, name_type, d=None):
if d and not d.nameservers:
d.nameservers = resolver.nameservers
# dns.resolver.Answer
- return resolver.query(name, name_type)
+ return resolver.resolve(name, name_type)
def check_dns_name(d):
"""check that a DNS entry exists."""
--
2.28.0

View File

@ -1,118 +0,0 @@
From 9dd1a4809b1b6d65bfb2258b443b0fe36e0a32f7 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <ab@samba.org>
Date: Sat, 24 Oct 2020 16:52:43 +0300
Subject: [PATCH] daemons: report status to systemd even when running in
foreground
When systemd launches samba services, the configuration we have in
systemd service files expects that the main process (/usr/sbin/*)
would use sd_notify() to report back its status. However, we only use
sd_notify() when running become_daemon().
As a result, samba/smbd/winbindd/nmbd processes never report back its
status and the status updates from other childs (smbd, winbindd, etc)
are not accepted as we now have implied NotifyAccess=main since commit
d1740fb3d5a72cb49e30b330bb0b01e7ef3e09cc
This leads to a timeout and killing samba process by systemd. Situation
is reproducible in Fedora 33, for example.
Make sure that we have required status updates for all daemons in case
we aren't runnning in interactive mode.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14552
Signed-off-by: Alexander Bokovoy <ab@samba.org>
---
source3/nmbd/nmbd.c | 4 +++-
source3/smbd/server.c | 4 +++-
source3/winbindd/winbindd.c | 5 ++++-
source4/smbd/server.c | 4 +++-
4 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index 0b881d13f7b..f6aeba1f714 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -1009,6 +1009,8 @@ static bool open_sockets(bool isdaemon, int port)
if (is_daemon && !opt_interactive) {
DEBUG(3, ("Becoming a daemon.\n"));
become_daemon(Fork, no_process_group, log_stdout);
+ } else if (!opt_interactive) {
+ daemon_status("nmbd", "Starting process...");
}
#ifdef HAVE_SETPGID
@@ -1135,7 +1137,7 @@ static bool open_sockets(bool isdaemon, int port)
exit_daemon( "NMBD failed to setup packet server.", EACCES);
}
- if (is_daemon && !opt_interactive) {
+ if (!opt_interactive) {
daemon_ready("nmbd");
}
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 153dd3c9323..3d9db5d8407 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1893,6 +1893,8 @@ extern void build_options(bool screen);
if (is_daemon && !interactive) {
DEBUG(3, ("Becoming a daemon.\n"));
become_daemon(Fork, no_process_group, log_stdout);
+ } else {
+ daemon_status("smbd", "Starting process ...");
}
#ifdef HAVE_SETPGID
@@ -2100,7 +2102,7 @@ extern void build_options(bool screen);
exit_daemon("Samba cannot setup ep pipe", EACCES);
}
- if (is_daemon && !interactive) {
+ if (!interactive) {
daemon_ready("smbd");
}
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 4397a1bc0d1..1e08237905a 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -1880,8 +1880,11 @@ int main(int argc, const char **argv)
BlockSignals(False, SIGHUP);
BlockSignals(False, SIGCHLD);
- if (!interactive)
+ if (!interactive) {
become_daemon(Fork, no_process_group, log_stdout);
+ } else {
+ daemon_status("winbindd", "Starting process ...");
+ }
pidfile_create(lp_pid_directory(), "winbindd");
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 95acb99b86c..ee2e7508bb3 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -648,6 +648,8 @@ static int binary_smbd_main(const char *binary_name,
if (opt_daemon) {
DBG_NOTICE("Becoming a daemon.\n");
become_daemon(opt_fork, opt_no_process_group, false);
+ } else if (!opt_interactive) {
+ daemon_status("samba", "Starting process...");
}
/* Create the memory context to hang everything off. */
@@ -931,7 +933,7 @@ static int binary_smbd_main(const char *binary_name,
}
}
- if (opt_daemon) {
+ if (!opt_interactive) {
daemon_ready("samba");
}
--
2.28.0

View File

@ -148,15 +148,6 @@ Source14: samba.pamd
Source201: README.downgrade
Patch1: samba-s4u.patch
Patch2: samba-gc-lookup_unix_user_name-allow-lookup-for-own-realm.patch
Patch3: samba-dnspython-2.0.0-v4.13.patch
Patch4: samba-systemd-notification.patch
# Fix `make test` in release tarballs
Patch5: https://gitlab.com/samba-team/samba/-/merge_requests/1624.patch
# Update resolv_wrapper to version 1.1.7
Patch6: https://gitlab.com/samba-team/samba/-/merge_requests/1528.patch
# Do not install test binaries for selftest
Patch7: https://gitlab.com/samba-team/samba/-/merge_requests/1635.patch
Requires(pre): /usr/sbin/groupadd
Requires(post): systemd