summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0001-Don-t-check-xsltproc-manpages.patch (renamed from meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch)24
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch30
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0001-nsswitch-nsstest.c-Avoid-nss-function-conflicts-with.patch96
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0001-waf-add-support-of-cross_compile.patch62
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0002-do-not-import-target-module-while-cross-compile.patch (renamed from meta-networking/recipes-connectivity/samba/samba/20-do-not-import-target-module-while-cross-compile.patch)8
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0002-util_sec.c-Move-__thread-variable-to-global-scope.patch58
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0003-Add-config-option-without-valgrind.patch (renamed from meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch)12
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0004-Add-options-to-configure-the-use-of-libbsd.patch (renamed from meta-networking/recipes-connectivity/samba/samba/0001-Add-options-to-configure-the-use-of-libbsd.patch)45
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0005-samba-build-dnsserver_common-code.patch (renamed from meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch)13
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0006-samba-defeat-iconv-test.patch (renamed from meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch)20
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0007-wscript_configure_system_gnutls-disable-check-gnutls.patch39
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0008-source3-wscript-disable-check-fcntl-F_OWNER_EX.patch79
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/CVE-2020-14318.patch142
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/CVE-2020-14383.patch112
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/glibc_only.patch28
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/samba-fix-musl-lib-without-innetgr.patch (renamed from meta-networking/recipes-connectivity/samba/samba/0001-samba-fix-musl-lib-without-innetgr.patch)0
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch28
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/source3-wscript-disable-check-fcntl-RW_HINTS.patch92
-rw-r--r--meta-networking/recipes-connectivity/samba/samba_4.14.4.bb (renamed from meta-networking/recipes-connectivity/samba/samba_4.10.18.bb)66
19 files changed, 307 insertions, 647 deletions
diff --git a/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch b/meta-networking/recipes-connectivity/samba/samba/0001-Don-t-check-xsltproc-manpages.patch
index 8ca7a52ed8..f4668dc6fd 100644
--- a/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch
+++ b/meta-networking/recipes-connectivity/samba/samba/0001-Don-t-check-xsltproc-manpages.patch
@@ -1,12 +1,14 @@
1From 2214c2d1e455a38c891d17e421b438e3f7c495d8 Mon Sep 17 00:00:00 2001 1From 3bc1ebc3d2758af4067b3aace7ddd0ea0cb0b57b Mon Sep 17 00:00:00 2001
2From: Bian Naimeng <biannm@cn.fujitsu.com> 2From: Bian Naimeng <biannm@cn.fujitsu.com>
3Date: Mon, 18 Apr 2016 17:00:53 -0400 3Date: Mon, 18 Apr 2016 17:00:53 -0400
4Subject: [PATCH] Don't check xsltproc manpages 4Subject: [PATCH] Don't check xsltproc manpages
5 5
6Upstream-Status: Pending 6Upstream-Status: Pending
7 7
8Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com> 8Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
9 9
10Rebase to 4.14.4
11Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
10--- 12---
11 lib/ldb/wscript | 2 +- 13 lib/ldb/wscript | 2 +-
12 lib/talloc/wscript | 2 +- 14 lib/talloc/wscript | 2 +-
@@ -14,10 +16,10 @@ Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
14 3 files changed, 3 insertions(+), 3 deletions(-) 16 3 files changed, 3 insertions(+), 3 deletions(-)
15 17
16diff --git a/lib/ldb/wscript b/lib/ldb/wscript 18diff --git a/lib/ldb/wscript b/lib/ldb/wscript
17index 5ea5231..d94086b 100644 19index bf6129b..c515deb 100644
18--- a/lib/ldb/wscript 20--- a/lib/ldb/wscript
19+++ b/lib/ldb/wscript 21+++ b/lib/ldb/wscript
20@@ -98,7 +98,7 @@ def configure(conf): 22@@ -143,7 +143,7 @@ def configure(conf):
21 conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_RELEASE', int(v[2])) 23 conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_RELEASE', int(v[2]))
22 24
23 if conf.env.standalone_ldb: 25 if conf.env.standalone_ldb:
@@ -27,10 +29,10 @@ index 5ea5231..d94086b 100644
27 # we need this for the ldap backend 29 # we need this for the ldap backend
28 if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'): 30 if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
29diff --git a/lib/talloc/wscript b/lib/talloc/wscript 31diff --git a/lib/talloc/wscript b/lib/talloc/wscript
30index df7e6be..b3305cf 100644 32index a767477..f754819 100644
31--- a/lib/talloc/wscript 33--- a/lib/talloc/wscript
32+++ b/lib/talloc/wscript 34+++ b/lib/talloc/wscript
33@@ -49,7 +49,7 @@ def configure(conf): 35@@ -48,7 +48,7 @@ def configure(conf):
34 conf.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig' 36 conf.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
35 conf.env.TALLOC_VERSION = VERSION 37 conf.env.TALLOC_VERSION = VERSION
36 38
@@ -40,18 +42,18 @@ index df7e6be..b3305cf 100644
40 conf.CHECK_HEADERS('sys/auxv.h') 42 conf.CHECK_HEADERS('sys/auxv.h')
41 conf.CHECK_FUNCS('getauxval') 43 conf.CHECK_FUNCS('getauxval')
42diff --git a/lib/tdb/wscript b/lib/tdb/wscript 44diff --git a/lib/tdb/wscript b/lib/tdb/wscript
43index 4782550..6bb3fa1 100644 45index e56ddd0..467dd65 100644
44--- a/lib/tdb/wscript 46--- a/lib/tdb/wscript
45+++ b/lib/tdb/wscript 47+++ b/lib/tdb/wscript
46@@ -89,7 +89,7 @@ def configure(conf): 48@@ -95,7 +95,7 @@ def configure(conf):
47 not conf.env.disable_tdb_mutex_locking): 49 not conf.env.disable_tdb_mutex_locking):
48 conf.define('USE_TDB_MUTEX_LOCKING', 1) 50 conf.define('USE_TDB_MUTEX_LOCKING', 1)
49 51
50- conf.CHECK_XSLTPROC_MANPAGES() 52- conf.CHECK_XSLTPROC_MANPAGES()
51+ #conf.CHECK_XSLTPROC_MANPAGES() 53+ #conf.CHECK_XSLTPROC_MANPAGES()
52 54
53 if not conf.env.disable_python: 55 conf.SAMBA_CHECK_PYTHON()
54 # also disable if we don't have the python libs installed 56 conf.SAMBA_CHECK_PYTHON_HEADERS()
55-- 57--
562.14.3 582.17.1
57 59
diff --git a/meta-networking/recipes-connectivity/samba/samba/0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch b/meta-networking/recipes-connectivity/samba/samba/0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch
deleted file mode 100644
index de7f311834..0000000000
--- a/meta-networking/recipes-connectivity/samba/samba/0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 3a935c638605bfb392ca7780d22c08c1a0a71e71 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 5 Sep 2019 21:37:33 -0700
4Subject: [PATCH 1/2] lib/replace/wscript: Avoid generating nested main
5 function
6
7clang is not happy when it sees another main nested inside the main
8function and fails the test for prctl syscall, therefore avoid adding
9implicit main() here
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 lib/replace/wscript | 1 +
14 1 file changed, 1 insertion(+)
15
16diff --git a/lib/replace/wscript b/lib/replace/wscript
17index a7fd25d..d6767fc 100644
18--- a/lib/replace/wscript
19+++ b/lib/replace/wscript
20@@ -137,6 +137,7 @@ def configure(conf):
21 }
22 ''',
23 'HAVE_PRCTL',
24+ addmain=False,
25 headers='sys/prctl.h',
26 msg='Checking for prctl syscall')
27
28--
292.23.0
30
diff --git a/meta-networking/recipes-connectivity/samba/samba/0001-nsswitch-nsstest.c-Avoid-nss-function-conflicts-with.patch b/meta-networking/recipes-connectivity/samba/samba/0001-nsswitch-nsstest.c-Avoid-nss-function-conflicts-with.patch
deleted file mode 100644
index 2dbabdaa47..0000000000
--- a/meta-networking/recipes-connectivity/samba/samba/0001-nsswitch-nsstest.c-Avoid-nss-function-conflicts-with.patch
+++ /dev/null
@@ -1,96 +0,0 @@
1From 9aba5ac17bb822f91f6b214f5b82dd1eb8c47616 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 22 Jul 2020 22:42:09 -0700
4Subject: [PATCH] nsswitch/nsstest.c: Avoid nss function conflicts with glibc nss.h
5
6glibc 2.32 will define these varibles [1] which results in conflicts
7with these static function names, therefore prefix these function names
8with samba_ to avoid it
9
10[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=499a92df8b9fc64a054cf3b7f728f8967fc1da7d
11
12Upstream-Status: Submitted [https://gitlab.com/samba-team/samba/-/merge_requests/1477]
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 nsswitch/nsstest.c | 16 ++++++++--------
17 1 file changed, 8 insertions(+), 8 deletions(-)
18
19diff --git a/nsswitch/nsstest.c b/nsswitch/nsstest.c
20index 6d92806..46f9679 100644
21--- a/nsswitch/nsstest.c
22+++ b/nsswitch/nsstest.c
23@@ -137,7 +137,7 @@ static struct passwd *nss_getpwuid(uid_t uid)
24 return &pwd;
25 }
26
27-static void nss_setpwent(void)
28+static void samba_nss_setpwent(void)
29 {
30 NSS_STATUS (*_nss_setpwent)(void) =
31 (NSS_STATUS(*)(void))find_fn("setpwent");
32@@ -152,7 +152,7 @@ static void nss_setpwent(void)
33 }
34 }
35
36-static void nss_endpwent(void)
37+static void samba_nss_endpwent(void)
38 {
39 NSS_STATUS (*_nss_endpwent)(void) =
40 (NSS_STATUS (*)(void))find_fn("endpwent");
41@@ -284,7 +284,7 @@ again:
42 return &grp;
43 }
44
45-static void nss_setgrent(void)
46+static void samba_nss_setgrent(void)
47 {
48 NSS_STATUS (*_nss_setgrent)(void) =
49 (NSS_STATUS (*)(void))find_fn("setgrent");
50@@ -299,7 +299,7 @@ static void nss_setgrent(void)
51 }
52 }
53
54-static void nss_endgrent(void)
55+static void samba_nss_endgrent(void)
56 {
57 NSS_STATUS (*_nss_endgrent)(void) =
58 (NSS_STATUS (*)(void))find_fn("endgrent");
59@@ -396,7 +396,7 @@ static void nss_test_users(void)
60 {
61 struct passwd *pwd;
62
63- nss_setpwent();
64+ samba_nss_setpwent();
65 /* loop over all users */
66 while ((pwd = nss_getpwent())) {
67 printf("Testing user %s\n", pwd->pw_name);
68@@ -418,14 +418,14 @@ static void nss_test_users(void)
69 printf("initgroups: "); nss_test_initgroups(pwd->pw_name, pwd->pw_gid);
70 printf("\n");
71 }
72- nss_endpwent();
73+ samba_nss_endpwent();
74 }
75
76 static void nss_test_groups(void)
77 {
78 struct group *grp;
79
80- nss_setgrent();
81+ samba_nss_setgrent();
82 /* loop over all groups */
83 while ((grp = nss_getgrent())) {
84 printf("Testing group %s\n", grp->gr_name);
85@@ -446,7 +446,7 @@ static void nss_test_groups(void)
86 printf("getgrgid: "); print_group(grp);
87 printf("\n");
88 }
89- nss_endgrent();
90+ samba_nss_endgrent();
91 }
92
93 static void nss_test_errors(void)
94--
952.27.0
96
diff --git a/meta-networking/recipes-connectivity/samba/samba/0001-waf-add-support-of-cross_compile.patch b/meta-networking/recipes-connectivity/samba/samba/0001-waf-add-support-of-cross_compile.patch
deleted file mode 100644
index 23b35a8145..0000000000
--- a/meta-networking/recipes-connectivity/samba/samba/0001-waf-add-support-of-cross_compile.patch
+++ /dev/null
@@ -1,62 +0,0 @@
1From 4b8463ff43f8983a706b181c5292491f9f954be1 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Fri, 25 Jan 2019 15:00:59 +0800
4Subject: [PATCH] waf: add support of cross_compile
5
6After upgrade, waf also upgraded
7
8on 1.5.19, for cross_compile, subprocess.Popen is set to be
9samba_cross.cross_Popen, which will not execute testprog on
10host, but only read result from cross-answers.txt which is
11passed by option --cross-answer
12
13part of old code:
14 args = Utils.to_list(kw.get('exec_args', []))
15 proc = Utils.pproc.Popen([lastprog] + args, stdout=Utils.pproc.PIPE, stderr=Utils.pproc.PIPE)
16
17but on new version, exec_args is not used and cause do_configure
18failed with Exec format error
19
20fixed by append cross anser related args to cmd
21
22Upstream-Status: Submitted [https://gitlab.com/samba-team/samba/merge_requests/211]
23
24Signed-off-by: Changqing Li <changqing.li@windriver.com>
25---
26 third_party/waf/waflib/Tools/c_config.py | 11 ++++++-----
27 1 file changed, 6 insertions(+), 5 deletions(-)
28
29diff --git a/third_party/waf/waflib/Tools/c_config.py b/third_party/waf/waflib/Tools/c_config.py
30index 7608215..767cf33 100644
31--- a/third_party/waf/waflib/Tools/c_config.py
32+++ b/third_party/waf/waflib/Tools/c_config.py
33@@ -660,20 +660,21 @@ class test_exec(Task.Task):
34 """
35 color = 'PINK'
36 def run(self):
37+ args = self.generator.bld.kw.get('exec_args', [])
38 if getattr(self.generator, 'rpath', None):
39 if getattr(self.generator, 'define_ret', False):
40- self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()])
41- else:
42- self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()])
43+ self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()] + args)
44+ else:
45+ self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()] + args)
46 else:
47 env = self.env.env or {}
48 env.update(dict(os.environ))
49 for var in ('LD_LIBRARY_PATH', 'DYLD_LIBRARY_PATH', 'PATH'):
50 env[var] = self.inputs[0].parent.abspath() + os.path.pathsep + env.get(var, '')
51 if getattr(self.generator, 'define_ret', False):
52- self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()], env=env)
53+ self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()] + args, env=env)
54 else:
55- self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()], env=env)
56+ self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()] + args, env=env)
57
58 @feature('test_exec')
59 @after_method('apply_link')
60--
612.7.4
62
diff --git a/meta-networking/recipes-connectivity/samba/samba/20-do-not-import-target-module-while-cross-compile.patch b/meta-networking/recipes-connectivity/samba/samba/0002-do-not-import-target-module-while-cross-compile.patch
index 3f2921ed33..292e614ebf 100644
--- a/meta-networking/recipes-connectivity/samba/samba/20-do-not-import-target-module-while-cross-compile.patch
+++ b/meta-networking/recipes-connectivity/samba/samba/0002-do-not-import-target-module-while-cross-compile.patch
@@ -1,4 +1,4 @@
1From cc0576405803bcae45ee353c4333c449cead9207 Mon Sep 17 00:00:00 2001 1From 9ebea97a52e4f70e831dd6402b865c77753ce1cc Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com> 2From: Changqing Li <changqing.li@windriver.com>
3Date: Tue, 25 Jun 2019 14:25:08 +0800 3Date: Tue, 25 Jun 2019 14:25:08 +0800
4Subject: [PATCH] do not import target module while cross compile 4Subject: [PATCH] do not import target module while cross compile
@@ -12,10 +12,10 @@ update to version 4.10.5, and switch to python3
12Signed-off-by: Changqing Li <changqing.li@windriver.com> 12Signed-off-by: Changqing Li <changqing.li@windriver.com>
13--- 13---
14 buildtools/wafsamba/samba_bundled.py | 27 +++++++++++++++++++-------- 14 buildtools/wafsamba/samba_bundled.py | 27 +++++++++++++++++++--------
15 1 file changed, 18 insertions(+), 8 deletions(-) 15 1 file changed, 19 insertions(+), 8 deletions(-)
16 16
17diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py 17diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
18index 60ce7da..5468a36 100644 18index 5f080dd..cdc115e 100644
19--- a/buildtools/wafsamba/samba_bundled.py 19--- a/buildtools/wafsamba/samba_bundled.py
20+++ b/buildtools/wafsamba/samba_bundled.py 20+++ b/buildtools/wafsamba/samba_bundled.py
21@@ -4,6 +4,7 @@ import sys 21@@ -4,6 +4,7 @@ import sys
@@ -63,5 +63,5 @@ index 60ce7da..5468a36 100644
63 Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion)) 63 Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion))
64 sys.exit(1) 64 sys.exit(1)
65-- 65--
662.7.4 662.17.1
67 67
diff --git a/meta-networking/recipes-connectivity/samba/samba/0002-util_sec.c-Move-__thread-variable-to-global-scope.patch b/meta-networking/recipes-connectivity/samba/samba/0002-util_sec.c-Move-__thread-variable-to-global-scope.patch
deleted file mode 100644
index 6fc849337c..0000000000
--- a/meta-networking/recipes-connectivity/samba/samba/0002-util_sec.c-Move-__thread-variable-to-global-scope.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From c62a6f32ab965de2ec77a614f20f04568116835b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 5 Sep 2019 21:39:05 -0700
4Subject: [PATCH 2/2] util_sec.c: Move __thread variable to global scope
5
6Make clang happy otherwise it complains about variable scope
7
8fixes
9
10source3/./lib/util_sec.c:470:4: error: '__thread' variables must have global storage
11 } __thread cache;
12 ^
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 source3/lib/util_sec.c | 19 +++++++++++--------
17 1 file changed, 11 insertions(+), 8 deletions(-)
18
19diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c
20index 9408269..7390318 100644
21--- a/source3/lib/util_sec.c
22+++ b/source3/lib/util_sec.c
23@@ -444,6 +444,17 @@ void become_user_permanently(uid_t uid, gid_t gid)
24 assert_gid(gid, gid);
25 }
26
27+#ifdef HAVE___THREAD
28+ struct cache_t {
29+ bool active;
30+ uid_t uid;
31+ gid_t gid;
32+ size_t setlen;
33+ uintptr_t gidset;
34+ };
35+
36+static __thread struct cache_t cache;
37+#endif
38 /**********************************************************
39 Function to set thread specific credentials. Leave
40 saved-set uid/gid alone.Must be thread-safe code.
41@@ -461,14 +472,6 @@ int set_thread_credentials(uid_t uid,
42 * available.
43 */
44 #ifdef HAVE___THREAD
45- static struct {
46- bool active;
47- uid_t uid;
48- gid_t gid;
49- size_t setlen;
50- uintptr_t gidset;
51- } __thread cache;
52-
53 if (cache.active &&
54 cache.uid == uid &&
55 cache.gid == gid &&
56--
572.23.0
58
diff --git a/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch b/meta-networking/recipes-connectivity/samba/samba/0003-Add-config-option-without-valgrind.patch
index 46a6f06267..93ca005d68 100644
--- a/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch
+++ b/meta-networking/recipes-connectivity/samba/samba/0003-Add-config-option-without-valgrind.patch
@@ -1,4 +1,4 @@
1From 87bc8e7eafc7d12a1d3a143ebb9e43cf5fbafb72 Mon Sep 17 00:00:00 2001 1From 6455448eb060d03a534539f1a424e2d3e44319e1 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com> 2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 20 Jun 2019 14:11:16 +0800 3Date: Thu, 20 Jun 2019 14:11:16 +0800
4Subject: [PATCH] Add config option without-valgrind 4Subject: [PATCH] Add config option without-valgrind
@@ -15,10 +15,10 @@ Signed-off-by: Changqing Li <changqing.li@windriver.com>
15 2 files changed, 7 insertions(+), 2 deletions(-) 15 2 files changed, 7 insertions(+), 2 deletions(-)
16 16
17diff --git a/lib/replace/wscript b/lib/replace/wscript 17diff --git a/lib/replace/wscript b/lib/replace/wscript
18index a7fd25d..a19ae68 100644 18index 2c856b6..bc726f7 100644
19--- a/lib/replace/wscript 19--- a/lib/replace/wscript
20+++ b/lib/replace/wscript 20+++ b/lib/replace/wscript
21@@ -110,8 +110,9 @@ def configure(conf): 21@@ -121,8 +121,9 @@ def configure(conf):
22 conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h') 22 conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
23 conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h') 23 conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
24 24
@@ -31,10 +31,10 @@ index a7fd25d..a19ae68 100644
31 conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h') 31 conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
32 conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h') 32 conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
33diff --git a/wscript b/wscript 33diff --git a/wscript b/wscript
34index e38a8e9..38b7230 100644 34index 83d9421..969b07a 100644
35--- a/wscript 35--- a/wscript
36+++ b/wscript 36+++ b/wscript
37@@ -105,6 +105,10 @@ def options(opt): 37@@ -123,6 +123,10 @@ def options(opt):
38 help=("Disable RELRO builds"), 38 help=("Disable RELRO builds"),
39 action="store_false", dest='enable_relro') 39 action="store_false", dest='enable_relro')
40 40
@@ -46,5 +46,5 @@ index e38a8e9..38b7230 100644
46 46
47 opt.load('python') # options for disabling pyc or pyo compilation 47 opt.load('python') # options for disabling pyc or pyo compilation
48-- 48--
492.7.4 492.17.1
50 50
diff --git a/meta-networking/recipes-connectivity/samba/samba/0001-Add-options-to-configure-the-use-of-libbsd.patch b/meta-networking/recipes-connectivity/samba/samba/0004-Add-options-to-configure-the-use-of-libbsd.patch
index 80cdd3955f..5fd32f3851 100644
--- a/meta-networking/recipes-connectivity/samba/samba/0001-Add-options-to-configure-the-use-of-libbsd.patch
+++ b/meta-networking/recipes-connectivity/samba/samba/0004-Add-options-to-configure-the-use-of-libbsd.patch
@@ -1,19 +1,21 @@
1From 1e8d31c138395122df4cc2a3e0edd6cd3fad736c Mon Sep 17 00:00:00 2001 1From 5abf3c2efa1cd4e16878b6b26068ff153973ebd3 Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com> 2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Tue, 28 Apr 2020 02:05:33 +0200 3Date: Tue, 28 Apr 2020 02:05:33 +0200
4Subject: [PATCH] Add options to configure the use of libbsd 4Subject: [PATCH] Add options to configure the use of libbsd
5 5
6Upstream-Status: Inappropriate [oe deterministic build specific] 6Upstream-Status: Inappropriate [oe deterministic build specific]
7Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> 7Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
8
9Rebase to 4.14.4
10Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
8--- 11---
9 buildtools/wafsamba/wscript | 7 +++++++ 12 buildtools/wafsamba/wscript | 7 +++++++
10 lib/crypto/wscript_configure | 2 +- 13 lib/replace/wscript | 29 +++++++++++++++--------------
11 lib/replace/wscript | 29 +++++++++++++++-------------- 14 lib/texpect/wscript | 8 +++++++-
12 lib/texpect/wscript | 7 ++++++- 15 3 files changed, 29 insertions(+), 15 deletions(-)
13 4 files changed, 29 insertions(+), 16 deletions(-)
14 16
15diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript 17diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
16index 7b8fb01..a8e4b0a 100644 18index 1aadb95..e7b47c0 100644
17--- a/buildtools/wafsamba/wscript 19--- a/buildtools/wafsamba/wscript
18+++ b/buildtools/wafsamba/wscript 20+++ b/buildtools/wafsamba/wscript
19@@ -88,6 +88,13 @@ def options(opt): 21@@ -88,6 +88,13 @@ def options(opt):
@@ -30,24 +32,11 @@ index 7b8fb01..a8e4b0a 100644
30 gr = opt.option_group('developer options') 32 gr = opt.option_group('developer options')
31 33
32 gr.add_option('-C', 34 gr.add_option('-C',
33diff --git a/lib/crypto/wscript_configure b/lib/crypto/wscript_configure
34index 09dfe04..e871718 100644
35--- a/lib/crypto/wscript_configure
36+++ b/lib/crypto/wscript_configure
37@@ -2,7 +2,7 @@
38 from waflib import Options
39 from waflib import Errors, Logs
40
41-if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
42+if not Options.options.enable_libbsd or not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
43 checklibc=True):
44 conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
45 checklibc=True)
46diff --git a/lib/replace/wscript b/lib/replace/wscript 35diff --git a/lib/replace/wscript b/lib/replace/wscript
47index 0020d2a..cd9228f 100644 36index bc726f7..44ad0d6 100644
48--- a/lib/replace/wscript 37--- a/lib/replace/wscript
49+++ b/lib/replace/wscript 38+++ b/lib/replace/wscript
50@@ -407,20 +407,21 @@ def configure(conf): 39@@ -419,20 +419,21 @@ def configure(conf):
51 40
52 strlcpy_in_bsd = False 41 strlcpy_in_bsd = False
53 42
@@ -84,13 +73,14 @@ index 0020d2a..cd9228f 100644
84 conf.CHECK_CODE(''' 73 conf.CHECK_CODE('''
85 struct ucred cred; 74 struct ucred cred;
86diff --git a/lib/texpect/wscript b/lib/texpect/wscript 75diff --git a/lib/texpect/wscript b/lib/texpect/wscript
87index e14c048..a91de59 100644 76index 82f6b25..33eea64 100644
88--- a/lib/texpect/wscript 77--- a/lib/texpect/wscript
89+++ b/lib/texpect/wscript 78+++ b/lib/texpect/wscript
90@@ -1,7 +1,12 @@ 79@@ -1,7 +1,13 @@
91 #!/usr/bin/env python 80 #!/usr/bin/env python
92+from waflib import Options
93 81
82+from waflib import Options
83+
94 def configure(conf): 84 def configure(conf):
95- conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers='pty.h util.h bsd/libutil.h libutil.h') 85- conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers='pty.h util.h bsd/libutil.h libutil.h')
96+ hdrs = 'pty.h util.h' 86+ hdrs = 'pty.h util.h'
@@ -100,4 +90,7 @@ index e14c048..a91de59 100644
100+ conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers=hdrs) 90+ conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers=hdrs)
101 91
102 def build(bld): 92 def build(bld):
103 bld.SAMBA_BINARY('texpect', 'texpect.c', deps='popt util replace', install=False) 93 bld.SAMBA_BINARY('texpect',
94--
952.17.1
96
diff --git a/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch b/meta-networking/recipes-connectivity/samba/samba/0005-samba-build-dnsserver_common-code.patch
index 0c7592f8e2..2abbe563ae 100644
--- a/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch
+++ b/meta-networking/recipes-connectivity/samba/samba/0005-samba-build-dnsserver_common-code.patch
@@ -1,11 +1,19 @@
1samba: build dnsserver_common code 1From 10d7abc8f1aa99ae45209aeb704978d206f329c0 Mon Sep 17 00:00:00 2001
2From: Joe Slater <joe.slater@windriver.com>
3Date: Tue, 1 Jun 2021 11:09:19 +0800
4Subject: [PATCH] samba: build dnsserver_common code
2 5
3Just 'install' does not seem to do it. 6Just 'install' does not seem to do it.
4 7
5Upstream-Status: Pending 8Upstream-Status: Pending
6 9
7Signed-off-by: Joe Slater <joe.slater@windriver.com> 10Signed-off-by: Joe Slater <joe.slater@windriver.com>
11---
12 source4/dns_server/wscript_build | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
8 14
15diff --git a/source4/dns_server/wscript_build b/source4/dns_server/wscript_build
16index e97c85d..a49fbb9 100644
9--- a/source4/dns_server/wscript_build 17--- a/source4/dns_server/wscript_build
10+++ b/source4/dns_server/wscript_build 18+++ b/source4/dns_server/wscript_build
11@@ -4,7 +4,7 @@ bld.SAMBA_LIBRARY('dnsserver_common', 19@@ -4,7 +4,7 @@ bld.SAMBA_LIBRARY('dnsserver_common',
@@ -17,3 +25,6 @@ Signed-off-by: Joe Slater <joe.slater@windriver.com>
17 ) 25 )
18 26
19 bld.SAMBA_MODULE('service_dns', 27 bld.SAMBA_MODULE('service_dns',
28--
292.17.1
30
diff --git a/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch b/meta-networking/recipes-connectivity/samba/samba/0006-samba-defeat-iconv-test.patch
index 5ae8c59783..00b692b580 100644
--- a/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch
+++ b/meta-networking/recipes-connectivity/samba/samba/0006-samba-defeat-iconv-test.patch
@@ -1,4 +1,7 @@
1samba: defeat iconv test 1From 59f7098bfbd63f9b3c19d7d297a8f90870a1893d Mon Sep 17 00:00:00 2001
2From: Joe Slater <joe.slater@windriver.com>
3Date: Mon, 31 May 2021 14:50:38 +0800
4Subject: [PATCH] samba: defeat iconv test
2 5
3A test was added when configuring samba which requires target code 6A test was added when configuring samba which requires target code
4to be executed. In general, this will not work, so we eliminate it. 7to be executed. In general, this will not work, so we eliminate it.
@@ -6,10 +9,15 @@ to be executed. In general, this will not work, so we eliminate it.
6Upstream-Status: Pending 9Upstream-Status: Pending
7 10
8Signed-off-by: Joe Slater <joe.slater@windriver.com> 11Signed-off-by: Joe Slater <joe.slater@windriver.com>
12---
13 lib/util/charset/wscript_configure | 3 +++
14 1 file changed, 3 insertions(+)
9 15
16diff --git a/lib/util/charset/wscript_configure b/lib/util/charset/wscript_configure
17index 9c27fc6..845eb36 100644
10--- a/lib/util/charset/wscript_configure 18--- a/lib/util/charset/wscript_configure
11+++ b/lib/util/charset/wscript_configure 19+++ b/lib/util/charset/wscript_configure
12@@ -17,6 +17,8 @@ if (conf.CHECK_FUNCS_IN('iconv_open', 'i 20@@ -17,6 +17,8 @@ if (conf.CHECK_FUNCS_IN('iconv_open', 'iconv', checklibc=False, headers='iconv.h
13 21
14 conf.DEFINE('HAVE_NATIVE_ICONV', 1) 22 conf.DEFINE('HAVE_NATIVE_ICONV', 1)
15 23
@@ -18,8 +26,14 @@ Signed-off-by: Joe Slater <joe.slater@windriver.com>
18 conf.CHECK_CODE(''' 26 conf.CHECK_CODE('''
19 uint8_t inbuf[2] = { 0x30, 0xdf }; 27 uint8_t inbuf[2] = { 0x30, 0xdf };
20 uint8_t outbuf[4] = { 0 }; 28 uint8_t outbuf[4] = { 0 };
21@@ -36,3 +38,4 @@ conf.CHECK_CODE(''' 29@@ -36,6 +38,7 @@ conf.CHECK_CODE('''
22 msg='Checking errno of iconv for illegal multibyte sequence', 30 msg='Checking errno of iconv for illegal multibyte sequence',
23 lib='iconv', 31 lib='iconv',
24 headers='errno.h iconv.h') 32 headers='errno.h iconv.h')
25+""" 33+"""
34
35 if conf.CHECK_CFG(package='icu-i18n',
36 args='--cflags --libs',
37--
382.17.1
39
diff --git a/meta-networking/recipes-connectivity/samba/samba/0007-wscript_configure_system_gnutls-disable-check-gnutls.patch b/meta-networking/recipes-connectivity/samba/samba/0007-wscript_configure_system_gnutls-disable-check-gnutls.patch
new file mode 100644
index 0000000000..0f843af20a
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba/0007-wscript_configure_system_gnutls-disable-check-gnutls.patch
@@ -0,0 +1,39 @@
1From a31a014c5d98501074fde1acb5c00162c927c361 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 31 May 2021 15:47:58 +0800
4Subject: [PATCH] wscript_configure_system_gnutls: disable check gnutls
5 AES_CFB8/AES_CMAC
6
7The CHECK_VALUEOF() can not work on cross-compilation.
8
9Fixes configure error:
10 Checking value of GNUTLS_CIPHER_AES_128_CFB8: UNKNOWN
11 Checking value of GNUTLS_MAC_AES_CMAC_128: UNKNOWN
12
13Upstream-Status: Inappropriate [embedded specific]
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 wscript_configure_system_gnutls | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/wscript_configure_system_gnutls b/wscript_configure_system_gnutls
21index 2ec217f..cd91b55 100644
22--- a/wscript_configure_system_gnutls
23+++ b/wscript_configure_system_gnutls
24@@ -39,6 +39,7 @@ if (parse_version(gnutls_version) > parse_version('3.6.14')):
25 if conf.CHECK_FUNCS_IN('gnutls_get_system_config_file', 'gnutls'):
26 conf.DEFINE('HAVE_GNUTLS_CRYPTO_POLICIES', 1)
27
28+"""
29 if conf.CHECK_VALUEOF('GNUTLS_CIPHER_AES_128_CFB8', headers='gnutls/gnutls.h'):
30 conf.DEFINE('HAVE_GNUTLS_AES_CFB8', 1)
31 else:
32@@ -48,3 +49,4 @@ if conf.CHECK_VALUEOF('GNUTLS_MAC_AES_CMAC_128', headers='gnutls/gnutls.h'):
33 conf.DEFINE('HAVE_GNUTLS_AES_CMAC', 1)
34 else:
35 Logs.warn('No gnutls support for AES CMAC')
36+"""
37--
382.17.1
39
diff --git a/meta-networking/recipes-connectivity/samba/samba/0008-source3-wscript-disable-check-fcntl-F_OWNER_EX.patch b/meta-networking/recipes-connectivity/samba/samba/0008-source3-wscript-disable-check-fcntl-F_OWNER_EX.patch
new file mode 100644
index 0000000000..d4ceb5ce9b
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba/0008-source3-wscript-disable-check-fcntl-F_OWNER_EX.patch
@@ -0,0 +1,79 @@
1From ba6bc5459cf148dd617fd9cd38dd50c3a9b5d706 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 31 May 2021 15:50:48 +0800
4Subject: [PATCH] source3/wscript: disable check fcntl F_OWNER_EX
5
6It fails on cross-compilation.
7
8Fixes configure error:
9 Checking whether fcntl supports flags to send direct I/O availability signals: UNKNOWN
10
11Upstream-Status: Inappropriate [embedded specific]
12
13Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
14---
15 source3/wscript | 48 ------------------------------------------------
16 1 file changed, 48 deletions(-)
17
18diff --git a/source3/wscript b/source3/wscript
19index adc31ce..f6de0a6 100644
20--- a/source3/wscript
21+++ b/source3/wscript
22@@ -1168,54 +1168,6 @@ err:
23 #include <fcntl.h>
24 #include <unistd.h>
25 #include <stdlib.h>
26-#include <sys/socket.h>
27-
28-int main(void)
29-{
30- int sockfd, ret;
31- struct f_owner_ex owner, get_owner;
32-
33- sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
34- if (sockfd == -1) {
35- goto err;
36- }
37-
38- owner.type = F_OWNER_PID;
39- owner.pid = getpid();
40-
41- ret = fcntl(sockfd, F_SETOWN_EX, &owner);
42- if (ret == -1) {
43- goto err;
44- }
45-
46- ret = fcntl(sockfd, F_GETOWN_EX, &get_owner);
47- if (ret == -1) {
48- goto err;
49- }
50-
51- if (get_owner.type != F_OWNER_PID) {
52- goto err;
53- }
54-
55- if (get_owner.pid != getpid()) {
56- goto err;
57- }
58-
59- close(sockfd);
60- exit(0);
61-err:
62- close(sockfd);
63- exit(1);
64-}''',
65- 'HAVE_F_OWNER_EX',
66- addmain=False,
67- execute=True,
68- msg="Checking whether fcntl supports flags to send direct I/O availability signals")
69-
70- conf.CHECK_CODE('''
71-#include <fcntl.h>
72-#include <unistd.h>
73-#include <stdlib.h>
74 #include <stdint.h>
75
76 #define DATA "hinttest.fcntl"
77--
782.17.1
79
diff --git a/meta-networking/recipes-connectivity/samba/samba/CVE-2020-14318.patch b/meta-networking/recipes-connectivity/samba/samba/CVE-2020-14318.patch
deleted file mode 100644
index ff1225db07..0000000000
--- a/meta-networking/recipes-connectivity/samba/samba/CVE-2020-14318.patch
+++ /dev/null
@@ -1,142 +0,0 @@
1From ccf53dfdcd39f3526dbc2f20e1245674155380ff Mon Sep 17 00:00:00 2001
2From: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
3Date: Fri, 11 Dec 2020 11:32:44 +0900
4Subject: [PATCH] s4: torture: Add smb2.notify.handle-permissions test.
5
6s3: smbd: Ensure change notifies can't get set unless the
7 directory handle is open for SEC_DIR_LIST.
8
9CVE-2020-14318
10
11BUG: https://bugzilla.samba.org/show_bug.cgi?id=14434
12
13Signed-off-by: Jeremy Allison <jra@samba.org>
14
15Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
16---
17 source3/smbd/notify.c | 8 ++++
18 source4/torture/smb2/notify.c | 82 ++++++++++++++++++++++++++++++++++-
19 2 files changed, 89 insertions(+), 1 deletion(-)
20
21diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c
22index 44c0b09..d23c03b 100644
23--- a/source3/smbd/notify.c
24+++ b/source3/smbd/notify.c
25@@ -283,6 +283,14 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32_t filter,
26 char fullpath[len+1];
27 NTSTATUS status = NT_STATUS_NOT_IMPLEMENTED;
28
29+ /*
30+ * Setting a changenotify needs READ/LIST access
31+ * on the directory handle.
32+ */
33+ if (!(fsp->access_mask & SEC_DIR_LIST)) {
34+ return NT_STATUS_ACCESS_DENIED;
35+ }
36+
37 if (fsp->notify != NULL) {
38 DEBUG(1, ("change_notify_create: fsp->notify != NULL, "
39 "fname = %s\n", fsp->fsp_name->base_name));
40diff --git a/source4/torture/smb2/notify.c b/source4/torture/smb2/notify.c
41index ebb4f8a..a5c9b94 100644
42--- a/source4/torture/smb2/notify.c
43+++ b/source4/torture/smb2/notify.c
44@@ -2569,6 +2569,83 @@ done:
45 return ok;
46 }
47
48+/*
49+ Test asking for a change notify on a handle without permissions.
50+*/
51+
52+#define BASEDIR_HPERM BASEDIR "_HPERM"
53+
54+static bool torture_smb2_notify_handle_permissions(
55+ struct torture_context *torture,
56+ struct smb2_tree *tree)
57+{
58+ bool ret = true;
59+ NTSTATUS status;
60+ union smb_notify notify;
61+ union smb_open io;
62+ struct smb2_handle h1 = {{0}};
63+ struct smb2_request *req;
64+
65+ smb2_deltree(tree, BASEDIR_HPERM);
66+ smb2_util_rmdir(tree, BASEDIR_HPERM);
67+
68+ torture_comment(torture,
69+ "TESTING CHANGE NOTIFY "
70+ "ON A HANDLE WITHOUT PERMISSIONS\n");
71+
72+ /*
73+ get a handle on the directory
74+ */
75+ ZERO_STRUCT(io.smb2);
76+ io.generic.level = RAW_OPEN_SMB2;
77+ io.smb2.in.create_flags = 0;
78+ io.smb2.in.desired_access = SEC_FILE_READ_ATTRIBUTE;
79+ io.smb2.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
80+ io.smb2.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
81+ io.smb2.in.share_access = NTCREATEX_SHARE_ACCESS_READ |
82+ NTCREATEX_SHARE_ACCESS_WRITE;
83+ io.smb2.in.alloc_size = 0;
84+ io.smb2.in.create_disposition = NTCREATEX_DISP_CREATE;
85+ io.smb2.in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS;
86+ io.smb2.in.security_flags = 0;
87+ io.smb2.in.fname = BASEDIR_HPERM;
88+
89+ status = smb2_create(tree, torture, &io.smb2);
90+ CHECK_STATUS(status, NT_STATUS_OK);
91+ h1 = io.smb2.out.file.handle;
92+
93+ /* ask for a change notify,
94+ on file or directory name changes */
95+ ZERO_STRUCT(notify.smb2);
96+ notify.smb2.level = RAW_NOTIFY_SMB2;
97+ notify.smb2.in.buffer_size = 1000;
98+ notify.smb2.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
99+ notify.smb2.in.file.handle = h1;
100+ notify.smb2.in.recursive = true;
101+
102+ req = smb2_notify_send(tree, &notify.smb2);
103+ torture_assert_goto(torture,
104+ req != NULL,
105+ ret,
106+ done,
107+ "smb2_notify_send failed\n");
108+
109+ /*
110+ * Cancel it, we don't really want to wait.
111+ */
112+ smb2_cancel(req);
113+ status = smb2_notify_recv(req, torture, &notify.smb2);
114+ /* Handle h1 doesn't have permissions for ChangeNotify. */
115+ CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
116+
117+done:
118+ if (!smb2_util_handle_empty(h1)) {
119+ smb2_util_close(tree, h1);
120+ }
121+ smb2_deltree(tree, BASEDIR_HPERM);
122+ return ret;
123+}
124+
125 /*
126 basic testing of SMB2 change notify
127 */
128@@ -2602,7 +2679,10 @@ struct torture_suite *torture_smb2_notify_init(TALLOC_CTX *ctx)
129 torture_smb2_notify_rmdir3);
130 torture_suite_add_2smb2_test(suite, "rmdir4",
131 torture_smb2_notify_rmdir4);
132-
133+ torture_suite_add_1smb2_test(suite,
134+ "handle-permissions",
135+ torture_smb2_notify_handle_permissions);
136+
137 suite->description = talloc_strdup(suite, "SMB2-NOTIFY tests");
138
139 return suite;
140--
1412.25.1
142
diff --git a/meta-networking/recipes-connectivity/samba/samba/CVE-2020-14383.patch b/meta-networking/recipes-connectivity/samba/samba/CVE-2020-14383.patch
deleted file mode 100644
index 3341b80a38..0000000000
--- a/meta-networking/recipes-connectivity/samba/samba/CVE-2020-14383.patch
+++ /dev/null
@@ -1,112 +0,0 @@
1From ff17443fe761eda864d13957bec45f5bac478fe3 Mon Sep 17 00:00:00 2001
2From: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
3Date: Fri, 11 Dec 2020 14:34:31 +0900
4Subject: [PATCH] CVE-2020-14383: s4/dns: Ensure variable initialization with
5 NULL. do not crash when additional data not found
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10Found by Francis Brosnan Blázquez <francis@aspl.es>.
11Based on patches from Francis Brosnan Blázquez <francis@aspl.es>
12and Jeremy Allison <jra@samba.org>
13
14BUG: https://bugzilla.samba.org/show_bug.cgi?id=14472
15BUG: https://bugzilla.samba.org/show_bug.cgi?id=12795
16
17Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
18Reviewed-by: Jeremy Allison <jra@samba.org>
19
20Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
21Autobuild-Date(master): Mon Aug 24 00:21:41 UTC 2020 on sn-devel-184
22
23(based on commit df98e7db04c901259dd089e20cd557bdbdeaf379)
24(based on commit 7afe449e7201be92bed8e53cbb37b74af720ef4e
25
26Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
27---
28 .../rpc_server/dnsserver/dcerpc_dnsserver.c | 31 ++++++++++---------
29 1 file changed, 17 insertions(+), 14 deletions(-)
30
31diff --git a/source4/rpc_server/dnsserver/dcerpc_dnsserver.c b/source4/rpc_server/dnsserver/dcerpc_dnsserver.c
32index 910de9a1..618c7096 100644
33--- a/source4/rpc_server/dnsserver/dcerpc_dnsserver.c
34+++ b/source4/rpc_server/dnsserver/dcerpc_dnsserver.c
35@@ -1754,15 +1754,17 @@ static WERROR dnsserver_enumerate_records(struct dnsserver_state *dsstate,
36 TALLOC_CTX *tmp_ctx;
37 char *name;
38 const char * const attrs[] = { "name", "dnsRecord", NULL };
39- struct ldb_result *res;
40- struct DNS_RPC_RECORDS_ARRAY *recs;
41+ struct ldb_result *res = NULL;
42+ struct DNS_RPC_RECORDS_ARRAY *recs = NULL;
43 char **add_names = NULL;
44- char *rname;
45+ char *rname = NULL;
46 const char *preference_name = NULL;
47 int add_count = 0;
48 int i, ret, len;
49 WERROR status;
50- struct dns_tree *tree, *base, *node;
51+ struct dns_tree *tree = NULL;
52+ struct dns_tree *base = NULL;
53+ struct dns_tree *node = NULL;
54
55 tmp_ctx = talloc_new(mem_ctx);
56 W_ERROR_HAVE_NO_MEMORY(tmp_ctx);
57@@ -1845,15 +1847,15 @@ static WERROR dnsserver_enumerate_records(struct dnsserver_state *dsstate,
58 }
59 }
60
61- talloc_free(res);
62- talloc_free(tree);
63- talloc_free(name);
64+ TALLOC_FREE(res);
65+ TALLOC_FREE(tree);
66+ TALLOC_FREE(name);
67
68 /* Add any additional records */
69 if (select_flag & DNS_RPC_VIEW_ADDITIONAL_DATA) {
70 for (i=0; i<add_count; i++) {
71- struct dnsserver_zone *z2;
72-
73+ struct dnsserver_zone *z2 = NULL;
74+ struct ldb_message *msg = NULL;
75 /* Search all the available zones for additional name */
76 for (z2 = dsstate->zones; z2; z2 = z2->next) {
77 char *encoded_name;
78@@ -1865,14 +1867,15 @@ static WERROR dnsserver_enumerate_records(struct dnsserver_state *dsstate,
79 LDB_SCOPE_ONELEVEL, attrs,
80 "(&(objectClass=dnsNode)(name=%s)(!(dNSTombstoned=TRUE)))",
81 encoded_name);
82- talloc_free(name);
83+ TALLOC_FREE(name);
84 if (ret != LDB_SUCCESS) {
85 continue;
86 }
87 if (res->count == 1) {
88+ msg = res->msgs[0];
89 break;
90 } else {
91- talloc_free(res);
92+ TALLOC_FREE(res);
93 continue;
94 }
95 }
96@@ -1885,10 +1888,10 @@ static WERROR dnsserver_enumerate_records(struct dnsserver_state *dsstate,
97 }
98 status = dns_fill_records_array(tmp_ctx, NULL, DNS_TYPE_A,
99 select_flag, rname,
100- res->msgs[0], 0, recs,
101+ msg, 0, recs,
102 NULL, NULL);
103- talloc_free(rname);
104- talloc_free(res);
105+ TALLOC_FREE(rname);
106+ TALLOC_FREE(res);
107 }
108 }
109
110--
1112.25.1
112
diff --git a/meta-networking/recipes-connectivity/samba/samba/glibc_only.patch b/meta-networking/recipes-connectivity/samba/samba/glibc_only.patch
deleted file mode 100644
index d07ec0df18..0000000000
--- a/meta-networking/recipes-connectivity/samba/samba/glibc_only.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 062cf74b498c1d12fd76f9d9bca926ac806e0b99 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 20 Jun 2019 14:15:18 +0800
4Subject: [PATCH] glibc only fix
5
6Signed-off-by: Changqing Li <changqing.li@windriver.com>
7---
8 ctdb/tests/src/test_mutex_raw.c | 2 ++
9 1 file changed, 2 insertions(+)
10
11diff --git a/ctdb/tests/src/test_mutex_raw.c b/ctdb/tests/src/test_mutex_raw.c
12index 926a525..814343f 100644
13--- a/ctdb/tests/src/test_mutex_raw.c
14+++ b/ctdb/tests/src/test_mutex_raw.c
15@@ -291,8 +291,10 @@ int main(int argc, const char **argv)
16 "failed\n");
17 exit (EXIT_FAILURE);
18 }
19+#ifdef __GLIBC__
20 } else if (ret == EBUSY) {
21 printf("INFO: pid=%u\n", mutex->__data.__owner);
22+#endif
23 } else if (ret == 0) {
24 pthread_mutex_unlock(mutex);
25 }
26--
272.7.4
28
diff --git a/meta-networking/recipes-connectivity/samba/samba/0001-samba-fix-musl-lib-without-innetgr.patch b/meta-networking/recipes-connectivity/samba/samba/samba-fix-musl-lib-without-innetgr.patch
index fb12a10e26..fb12a10e26 100644
--- a/meta-networking/recipes-connectivity/samba/samba/0001-samba-fix-musl-lib-without-innetgr.patch
+++ b/meta-networking/recipes-connectivity/samba/samba/samba-fix-musl-lib-without-innetgr.patch
diff --git a/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch b/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch
deleted file mode 100644
index 6ae292835b..0000000000
--- a/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From f99b6a8617df6a46f41fb68ffafb2608dbb6681e Mon Sep 17 00:00:00 2001
2From: Joe Slater <joe.slater@windriver.com>
3Date: Wed, 8 Nov 2017 11:58:05 -0800
4Subject: [PATCH] samba: correct log files location
5
6We use /var/log/samba.
7
8Upstream-Status: Pending
9
10Signed-off-by: Joe Slater <joe.slater@windriver.com>
11
12---
13 examples/smb.conf.default | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/examples/smb.conf.default b/examples/smb.conf.default
17index 2f20720..44c1aa8 100644
18--- a/examples/smb.conf.default
19+++ b/examples/smb.conf.default
20@@ -52,7 +52,7 @@
21
22 # this tells Samba to use a separate log file for each machine
23 # that connects
24- log file = /usr/local/samba/var/log.%m
25+ log file = /var/log/samba/log.%m
26
27 # Put a capping on the size of the log files (in Kb).
28 max log size = 50
diff --git a/meta-networking/recipes-connectivity/samba/samba/source3-wscript-disable-check-fcntl-RW_HINTS.patch b/meta-networking/recipes-connectivity/samba/samba/source3-wscript-disable-check-fcntl-RW_HINTS.patch
new file mode 100644
index 0000000000..a0b7510346
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba/source3-wscript-disable-check-fcntl-RW_HINTS.patch
@@ -0,0 +1,92 @@
1From 9942bca2e276c7b4c7696a08594258430c4c5bb5 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 3 Jun 2021 09:39:56 +0800
4Subject: [PATCH] source3/wscript: disable check fcntl RW_HINTS
5
6It fails on cross-compilation for musl.
7
8Fixes configure error:
9 Checking whether fcntl supports setting/geting hints: UNKNOWN
10
11Upstream-Status: Inappropriate [embedded specific]
12
13Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
14---
15 source3/wscript | 61 -------------------------------------------------
16 1 file changed, 61 deletions(-)
17
18diff --git a/source3/wscript b/source3/wscript
19index f6de0a6..3e260c1 100644
20--- a/source3/wscript
21+++ b/source3/wscript
22@@ -1164,67 +1164,6 @@ err:
23 execute=True,
24 msg="Checking whether fcntl lock supports open file description locks")
25
26- conf.CHECK_CODE('''
27-#include <fcntl.h>
28-#include <unistd.h>
29-#include <stdlib.h>
30-#include <stdint.h>
31-
32-#define DATA "hinttest.fcntl"
33-
34-int main(void)
35-{
36- uint64_t hint, get_hint;
37- int fd;
38-
39- fd = open(DATA, O_RDONLY | O_CREAT | O_EXCL);
40- if (fd == -1) {
41- goto err;
42- }
43-
44- hint = RWH_WRITE_LIFE_SHORT;
45- int ret = fcntl(fd, F_SET_RW_HINT, &hint);
46- if (ret == -1) {
47- goto err;
48- }
49-
50- ret = fcntl(fd, F_GET_RW_HINT, &get_hint);
51- if (ret == -1) {
52- goto err;
53- }
54-
55- if (get_hint != RWH_WRITE_LIFE_SHORT) {
56- goto err;
57- }
58-
59- hint = RWH_WRITE_LIFE_EXTREME;
60- ret = fcntl(fd, F_SET_FILE_RW_HINT, &hint);
61- if (ret == -1) {
62- goto err;
63- }
64-
65- ret = fcntl(fd, F_GET_FILE_RW_HINT, &get_hint);
66- if (ret == -1) {
67- goto err;
68- }
69-
70- if (get_hint != RWH_WRITE_LIFE_EXTREME) {
71- goto err;
72- }
73-
74- close(fd);
75- unlink(DATA);
76- exit(0);
77-err:
78- close(fd);
79- unlink(DATA);
80- exit(1);
81-}''',
82- 'HAVE_RW_HINTS',
83- addmain=False,
84- execute=True,
85- msg="Checking whether fcntl supports setting/geting hints")
86-
87 conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_mtim.tv_nsec',
88 define='HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC') # Linux, Solaris
89 conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_mtimensec',
90--
912.17.1
92
diff --git a/meta-networking/recipes-connectivity/samba/samba_4.10.18.bb b/meta-networking/recipes-connectivity/samba/samba_4.14.4.bb
index 166bf57279..2e0bdceab2 100644
--- a/meta-networking/recipes-connectivity/samba/samba_4.10.18.bb
+++ b/meta-networking/recipes-connectivity/samba/samba_4.14.4.bb
@@ -14,40 +14,36 @@ ${SAMBA_MIRROR} http://www.mirrorservice.org/sites/ftp.samba.org \n \
14 14
15SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \ 15SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
16 file://smb.conf \ 16 file://smb.conf \
17 file://16-do-not-check-xsltproc-manpages.patch \
18 file://20-do-not-import-target-module-while-cross-compile.patch \
19 file://21-add-config-option-without-valgrind.patch \
20 file://netdb_defines.patch \
21 file://glibc_only.patch \
22 file://iconv-4.7.0.patch \
23 file://dnsserver-4.7.0.patch \
24 file://smb_conf-4.7.0.patch \
25 file://volatiles.03_samba \ 17 file://volatiles.03_samba \
26 file://0001-waf-add-support-of-cross_compile.patch \ 18 file://0001-Don-t-check-xsltproc-manpages.patch \
27 file://0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch \ 19 file://0002-do-not-import-target-module-while-cross-compile.patch \
28 file://0002-util_sec.c-Move-__thread-variable-to-global-scope.patch \ 20 file://0003-Add-config-option-without-valgrind.patch \
29 file://0001-Add-options-to-configure-the-use-of-libbsd.patch \ 21 file://0004-Add-options-to-configure-the-use-of-libbsd.patch \
30 file://0001-nsswitch-nsstest.c-Avoid-nss-function-conflicts-with.patch \ 22 file://0005-samba-build-dnsserver_common-code.patch \
31 file://CVE-2020-14318.patch \ 23 file://0006-samba-defeat-iconv-test.patch \
32 file://CVE-2020-14383.patch \ 24 file://0007-wscript_configure_system_gnutls-disable-check-gnutls.patch \
25 file://0008-source3-wscript-disable-check-fcntl-F_OWNER_EX.patch \
33 " 26 "
27
34SRC_URI_append_libc-musl = " \ 28SRC_URI_append_libc-musl = " \
29 file://netdb_defines.patch \
35 file://samba-pam.patch \ 30 file://samba-pam.patch \
36 file://samba-4.3.9-remove-getpwent_r.patch \ 31 file://samba-4.3.9-remove-getpwent_r.patch \
37 file://cmocka-uintptr_t.patch \ 32 file://cmocka-uintptr_t.patch \
38 file://0001-samba-fix-musl-lib-without-innetgr.patch \ 33 file://samba-fix-musl-lib-without-innetgr.patch \
39 " 34 file://source3-wscript-disable-check-fcntl-RW_HINTS.patch \
35 "
40 36
41SRC_URI[md5sum] = "f006a3d1876113e4a049015969d20fe6" 37SRC_URI[md5sum] = "171629ad42b4b303107e8b0fff942a1f"
42SRC_URI[sha256sum] = "7dcfc2aaaac565b959068788e6a43fc79ce2a03e7d523f5843f7a9fddffc7c2c" 38SRC_URI[sha256sum] = "89af092a0b00f5354ed287f0aa37b8c2cf9ba2ce67ea6464192e2c18528f89b9"
43 39
44UPSTREAM_CHECK_REGEX = "samba\-(?P<pver>4\.10(\.\d+)+).tar.gz" 40UPSTREAM_CHECK_REGEX = "samba\-(?P<pver>4\.14(\.\d+)+).tar.gz"
45 41
46inherit systemd waf-samba cpan-base perlnative update-rc.d 42inherit systemd waf-samba cpan-base perlnative update-rc.d
47# remove default added RDEPENDS on perl 43# remove default added RDEPENDS on perl
48RDEPENDS_${PN}_remove = "perl" 44RDEPENDS_${PN}_remove = "perl"
49 45
50DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libaio libpam libtasn1 jansson" 46DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libaio libpam libtasn1 jansson libparse-yapp-perl-native gnutls"
51 47
52inherit features_check 48inherit features_check
53REQUIRED_DISTRO_FEATURES = "pam" 49REQUIRED_DISTRO_FEATURES = "pam"
@@ -56,6 +52,8 @@ DEPENDS_append_libc-musl = " libtirpc"
56CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc" 52CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
57LDFLAGS_append_libc-musl = " -ltirpc" 53LDFLAGS_append_libc-musl = " -ltirpc"
58 54
55COMPATIBLE_HOST_riscv32 = "null"
56
59INITSCRIPT_NAME = "samba" 57INITSCRIPT_NAME = "samba"
60INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ." 58INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ."
61 59
@@ -76,7 +74,7 @@ export WAF_NO_PREFORK="yes"
76# Use krb5. Build active domain controller. 74# Use krb5. Build active domain controller.
77# 75#
78PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd zeroconf', d)} \ 76PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd zeroconf', d)} \
79 acl cups ad-dc gnutls ldap mitkrb5 \ 77 acl cups ad-dc ldap mitkrb5 \
80" 78"
81 79
82RDEPENDS_${PN}-ctdb-tests += "bash util-linux-getopt" 80RDEPENDS_${PN}-ctdb-tests += "bash util-linux-getopt"
@@ -96,19 +94,7 @@ PACKAGECONFIG[libunwind] = ", , libunwind"
96PACKAGECONFIG[gpgme] = ",--without-gpgme,," 94PACKAGECONFIG[gpgme] = ",--without-gpgme,,"
97PACKAGECONFIG[lmdb] = ",--without-ldb-lmdb,lmdb," 95PACKAGECONFIG[lmdb] = ",--without-ldb-lmdb,lmdb,"
98PACKAGECONFIG[libbsd] = "--with-libbsd, --without-libbsd, libbsd" 96PACKAGECONFIG[libbsd] = "--with-libbsd, --without-libbsd, libbsd"
99 97PACKAGECONFIG[ad-dc] = "--with-experimental-mit-ad-dc,--without-ad-dc,python3-markdown python3-dnspython,"
100# Building the AD (Active Directory) DC (Domain Controller) requires GnuTLS,
101# And ad-dc doesn't work with mitkrb5 for versions prior to 4.7.0 according to:
102# http://samba.2283325.n4.nabble.com/samba-4-6-6-Unknown-dependency-kdc-in-service-kdc-objlist-td4722096.html
103# So the working combination is:
104# 1) ad-dc: enable, gnutls: enable, mitkrb5: disable
105# 2) ad-dc: disable, gnutls: enable/disable, mitkrb5: enable
106#
107# We are now at 4.7.0, so take the above with a grain of salt. We do not need to know where
108# krb5kdc is unless ad-dc is enabled, but we tell configure anyhow.
109#
110PACKAGECONFIG[ad-dc] = "--with-experimental-mit-ad-dc,--without-ad-dc,,"
111PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
112PACKAGECONFIG[mitkrb5] = "--with-system-mitkrb5 --with-system-mitkdc=/usr/sbin/krb5kdc,,krb5," 98PACKAGECONFIG[mitkrb5] = "--with-system-mitkrb5 --with-system-mitkdc=/usr/sbin/krb5kdc,,krb5,"
113 99
114SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2" 100SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
@@ -182,11 +168,11 @@ do_install_append() {
182 install -m644 packaging/systemd/samba.sysconfig ${D}${sysconfdir}/default/samba 168 install -m644 packaging/systemd/samba.sysconfig ${D}${sysconfdir}/default/samba
183 169
184 # the items are from ctdb/tests/run_tests.sh 170 # the items are from ctdb/tests/run_tests.sh
185 for d in onnode takeover tool eventscripts cunit simple complex; do 171 for d in cunit eventd eventscripts onnode shellcheck takeover takeover_helper tool; do
186 testdir=${D}${datadir}/ctdb-tests/$d 172 testdir=${D}${datadir}/ctdb-tests/UNIT/$d
187 install -d $testdir 173 install -d $testdir
188 cp ${S}/ctdb/tests/$d/*.sh $testdir 174 cp ${S}/ctdb/tests/UNIT/$d/*.sh $testdir
189 cp -r ${S}/ctdb/tests/$d/scripts ${S}/ctdb/tests/$d/stubs $testdir || true 175 cp -r ${S}/ctdb/tests/UNIT/$d/scripts ${S}/ctdb/tests/UNIT/$d/stubs $testdir || true
190 done 176 done
191 177
192 # fix file-rdeps qa warning 178 # fix file-rdeps qa warning
@@ -197,7 +183,7 @@ do_install_append() {
197 chmod 0750 ${D}${sysconfdir}/sudoers.d || true 183 chmod 0750 ${D}${sysconfdir}/sudoers.d || true
198 rm -rf ${D}/run ${D}${localstatedir}/run ${D}${localstatedir}/log 184 rm -rf ${D}/run ${D}${localstatedir}/run ${D}${localstatedir}/log
199 185
200 for f in samba-gpupdate samba_upgradedns samba_spnupdate samba_kcc samba_dnsupdate; do 186 for f in samba-gpupdate samba_upgradedns samba_spnupdate samba_kcc samba_dnsupdate samba_downgrade_db; do
201 if [ -f "${D}${sbindir}/$f" ]; then 187 if [ -f "${D}${sbindir}/$f" ]; then
202 sed -i -e 's,${PYTHON},/usr/bin/env python3,g' ${D}${sbindir}/$f 188 sed -i -e 's,${PYTHON},/usr/bin/env python3,g' ${D}${sbindir}/$f
203 fi 189 fi