added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,59 @@
From f6fa33bfc2e1272198db6ea08910b4162b364b18 Mon Sep 17 00:00:00 2001
From: Bian Naimeng <biannm@cn.fujitsu.com>
Date: Mon, 18 Apr 2016 17:00:53 -0400
Subject: [PATCH] Don't check xsltproc manpages
Upstream-Status: Pending
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
Rebase to 4.14.4
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
lib/ldb/wscript | 2 +-
lib/talloc/wscript | 2 +-
lib/tdb/wscript | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index 60bb7cf..b7b0152 100644
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -144,7 +144,7 @@ def configure(conf):
conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_RELEASE', int(v[2]))
if conf.env.standalone_ldb:
- conf.CHECK_XSLTPROC_MANPAGES()
+ #conf.CHECK_XSLTPROC_MANPAGES()
# we need this for the ldap backend
if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index 3089663..76cd65e 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -48,7 +48,7 @@ def configure(conf):
conf.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
conf.env.TALLOC_VERSION = VERSION
- conf.CHECK_XSLTPROC_MANPAGES()
+ #conf.CHECK_XSLTPROC_MANPAGES()
conf.CHECK_HEADERS('sys/auxv.h')
conf.CHECK_FUNCS('getauxval')
diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index 71ada31..accd474 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -95,7 +95,7 @@ def configure(conf):
not conf.env.disable_tdb_mutex_locking):
conf.define('USE_TDB_MUTEX_LOCKING', 1)
- conf.CHECK_XSLTPROC_MANPAGES()
+ #conf.CHECK_XSLTPROC_MANPAGES()
conf.SAMBA_CHECK_PYTHON()
conf.SAMBA_CHECK_PYTHON_HEADERS()
--
2.25.1

View File

@@ -0,0 +1,67 @@
From f7b8e2e149b06a8033e31f4242c392573fa9ab52 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Tue, 25 Jun 2019 14:25:08 +0800
Subject: [PATCH] do not import target module while cross compile
Some modules such as dynamic library maybe cann't be imported
while cross compile, we just check whether does the module exist.
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
update to version 4.10.5, and switch to python3
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
buildtools/wafsamba/samba_bundled.py | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 7d2d855..01dcb56 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -4,6 +4,7 @@ import sys
from waflib import Build, Options, Logs
from waflib.Configure import conf
from wafsamba import samba_utils
+import importlib.util, os
def PRIVATE_NAME(bld, name):
'''possibly rename a library to include a bundled extension'''
@@ -241,17 +242,27 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, libname, modulename, minversion='0.0.0'):
# versions
minversion = minimum_library_version(conf, libname, minversion)
- try:
- m = __import__(modulename)
- except ImportError:
- found = False
- else:
+ # Find module in PYTHONPATH
+ spec = importlib.util._find_spec_from_path(modulename, [os.environ["PYTHONPATH"]])
+ if spec:
try:
- version = m.__version__
- except AttributeError:
+ module = importlib.util.module_from_spec(spec)
+ spec.loader.load_module(module)
+ except ImportError:
found = False
+
+ if conf.env.CROSS_COMPILE:
+ # Some modules such as dynamic library maybe cann't be imported
+ # while cross compile, we just check whether the module exist
+ Logs.warn('Cross module[%s] has been found, but can not be loaded.' % (spec.name))
+ found = True
else:
- found = tuplize_version(version) >= tuplize_version(minversion)
+ try:
+ version = module.__version__
+ except AttributeError:
+ found = False
+ else:
+ found = tuplize_version(version) >= tuplize_version(minversion)
if not found and not conf.LIB_MAY_BE_BUNDLED(libname):
Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion))
sys.exit(1)
--
2.25.1

View File

@@ -0,0 +1,50 @@
From 556bb3cf17ccdf0b0ee0d82801c4b20cf0990ae4 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Thu, 20 Jun 2019 14:11:16 +0800
Subject: [PATCH] Add config option without-valgrind
Upstream-Status: Pending
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Update patch to version 4.10.5
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
lib/replace/wscript | 5 +++--
wscript | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 2f17999..9ef9bd9 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -114,8 +114,9 @@ def configure(conf):
conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
- conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
+ if not Options.options.disable_valgrind:
+ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
+ conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
diff --git a/wscript b/wscript
index 3af4207..54d7e9e 100644
--- a/wscript
+++ b/wscript
@@ -116,6 +116,10 @@ def options(opt):
help=("Disable RELRO builds"),
action="store_false", dest='enable_relro')
+ opt.add_option('--without-valgrind',
+ help=("Disable use of the valgrind headers"),
+ action="store_true", dest='disable_valgrind', default=False)
+
gr = opt.option_group('developer options')
opt.load('python') # options for disabling pyc or pyo compilation
--
2.25.1

View File

@@ -0,0 +1,96 @@
From 515f2455b4b69f5fcd2c61a532663280785db737 Mon Sep 17 00:00:00 2001
From: Peter Kjellerstedt <pkj@axis.com>
Date: Tue, 28 Apr 2020 02:05:33 +0200
Subject: [PATCH] Add options to configure the use of libbsd
Upstream-Status: Inappropriate [oe deterministic build specific]
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Rebase to 4.14.4
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
buildtools/wafsamba/wscript | 7 +++++++
lib/replace/wscript | 29 +++++++++++++++--------------
lib/texpect/wscript | 8 +++++++-
3 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 8729b08..1c55428 100644
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -145,6 +145,13 @@ Currently the only tested value is 'smbtorture,smbd/smbd' for Samba'''),
help=("Disable use of gettext"),
action="store_true", dest='disable_gettext', default=False)
+ opt.add_option('--with-libbsd',
+ help=("Enable use of libbsd"),
+ action="store_true", dest='enable_libbsd')
+ opt.add_option('--without-libbsd',
+ help=("Disable use of libbsd"),
+ action="store_false", dest='enable_libbsd', default=False)
+
gr = opt.option_group('developer options')
gr.add_option('-C',
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 9ef9bd9..d47de4f 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -439,20 +439,21 @@ def configure(conf):
strlcpy_in_bsd = False
- # libbsd on some platforms provides strlcpy and strlcat
- if not conf.CHECK_FUNCS('strlcpy strlcat'):
- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
- checklibc=True):
- strlcpy_in_bsd = True
- if not conf.CHECK_FUNCS('getpeereid'):
- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
- if not conf.CHECK_FUNCS('setproctitle_init'):
- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
-
- if not conf.CHECK_FUNCS('closefrom'):
- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
+ if Options.options.enable_libbsd:
+ # libbsd on some platforms provides strlcpy and strlcat
+ if not conf.CHECK_FUNCS('strlcpy strlcat'):
+ if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+ checklibc=True):
+ strlcpy_in_bsd = True
+ if not conf.CHECK_FUNCS('getpeereid'):
+ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+ if not conf.CHECK_FUNCS('setproctitle_init'):
+ conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
+
+ if not conf.CHECK_FUNCS('closefrom'):
+ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
conf.CHECK_CODE('''
struct ucred cred;
diff --git a/lib/texpect/wscript b/lib/texpect/wscript
index 44f92a8..79e8d09 100644
--- a/lib/texpect/wscript
+++ b/lib/texpect/wscript
@@ -1,7 +1,13 @@
#!/usr/bin/env python
+from waflib import Options
+
def configure(conf):
- conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers='pty.h util.h bsd/libutil.h libutil.h')
+ hdrs = 'pty.h util.h'
+ if Options.options.enable_libbsd:
+ hdrs += ' bsd/libutil.h'
+ hdrs += ' libutil.h'
+ conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers=hdrs)
def build(bld):
bld.SAMBA_BINARY('texpect',
--
2.25.1

View File

@@ -0,0 +1,63 @@
From a8b4a40b535a2c69eb408f649e7169bcc1975fc1 Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Wed, 24 Nov 2021 13:33:35 +0800
Subject: [PATCH] Fix pyext_PATTERN for cross compilation
The pyext_PATTERN will add native arch as suffix when cross compiling.
For example, on qemuarm64, it is expanded to:
pyext_PATTERN ='%s.cpython-310-x86_64-linux-gnu.so'
which will result in the incorrect library name.
root@qemuarm64:~# find /usr/lib -name \*cpython\*
/usr/lib/pkgconfig/samba-policy.cpython-310-x86_64-linux-gnu.pc
/usr/lib/libsamba-policy.cpython-310-x86-64-linux-gnu.so
/usr/lib/samba/libsamba-python.cpython-310-x86-64-linux-gnu-samba4.so
/usr/lib/samba/libsamba-net.cpython-310-x86-64-linux-gnu-samba4.so
/usr/lib/libsamba-policy.cpython-310-x86-64-linux-gnu.so.0
/usr/lib/libsamba-policy.cpython-310-x86-64-linux-gnu.so.0.0.1
/usr/lib/python3.10/site-packages/samba/dsdb_dns.cpython-310-x86_64-linux-gnu.so
/usr/lib/python3.10/site-packages/samba/dsdb.cpython-310-x86_64-linux-gnu.so
/usr/lib/python3.10/site-packages/samba/xattr_tdb.cpython-310-x86_64-linux-gnu.so
/usr/lib/python3.10/site-packages/samba/_ldb.cpython-310-x86_64-linux-gnu.so
/usr/lib/python3.10/site-packages/samba/gensec.cpython-310-x86_64-linux-gnu.so
[snip]
Set pyext_PATTERN to '%s.so' to remove the suffix.
After the patch:
root@qemuarm64:~# find /usr/lib/
/usr/lib/pkgconfig/samba-policy.pc
/usr/lib/libsamba-policy.so
/usr/lib/samba/libsamba-python-samba4.so
/usr/lib/samba/libsamba-net-samba4.so
/usr/lib/libsamba-policy.so.0
/usr/lib/libsamba-policy.so.0.0.1
/usr/lib/python3.10/site-packages/samba/dsdb_dns.so
/usr/lib/python3.10/site-packages/samba/dsdb.so
/usr/lib/python3.10/site-packages/samba/xattr_tdb.so
/usr/lib/python3.10/site-packages/samba/_ldb.so
/usr/lib/python3.10/site-packages/samba/gensec.so
[snip]
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
third_party/waf/waflib/Tools/python.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py
index a23bd01..af202e0 100644
--- a/third_party/waf/waflib/Tools/python.py
+++ b/third_party/waf/waflib/Tools/python.py
@@ -328,7 +328,7 @@ def check_python_headers(conf, features='pyembed pyext'):
x = 'MACOSX_DEPLOYMENT_TARGET'
if dct[x]:
env[x] = conf.environ[x] = str(dct[x])
- env.pyext_PATTERN = '%s' + (dct['EXT_SUFFIX'] or dct['SO']) # SO is deprecated in 3.5 and removed in 3.11
+ env.pyext_PATTERN = '%s.so'
# Try to get pythonX.Y-config
--
2.25.1

View File

@@ -0,0 +1,38 @@
From 950b5977ea7e72343067d0070cc35fb0dc5163d4 Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Thu, 25 Aug 2022 16:46:04 +0800
Subject: [PATCH] smbtorture: skip test case tfork_cmd_send
The test case tfork_cmd_send fails on target as it requires a script
located in the source directory:
$ smbtorture ncalrpc:localhost local.tfork.tfork_cmd_send
test: tfork_cmd_send
/buildarea/build/tmp/work/core2-64-poky-linux/samba/4.14.14-r0/samba-4.14.14/testprogs/blackbox/tfork.sh:
Failed to exec child - No such file or directory
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
lib/util/tests/tfork.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/lib/util/tests/tfork.c b/lib/util/tests/tfork.c
index 70ae975..4826ce6 100644
--- a/lib/util/tests/tfork.c
+++ b/lib/util/tests/tfork.c
@@ -839,10 +839,6 @@ struct torture_suite *torture_local_tfork(TALLOC_CTX *mem_ctx)
"tfork_threads",
test_tfork_threads);
- torture_suite_add_simple_test(suite,
- "tfork_cmd_send",
- test_tfork_cmd_send);
-
torture_suite_add_simple_test(suite,
"tfork_event_file_handle",
test_tfork_event_file_handle);
--
2.25.1

View File

@@ -0,0 +1,123 @@
From f783bb9c87ce11e824dfefca473d0dcf6edad238 Mon Sep 17 00:00:00 2001
From: Lei Maohui <leimaohui@fujitsu.com>
Date: Sun, 30 Oct 2022 11:59:31 +0900
Subject: [PATCH] Deleted settiong of python to fix the install conflict error
when enable multilib.
file /usr/bin/samba-tool conflicts between attempted installs of samba-4.14.14-r0.core2_64 and lib32-samba-4.14.14-r0.i686
file /usr/sbin/samba-gpupdate conflicts between attempted installs of samba-4.14.14-r0.core2_64 and lib32-samba-4.14.14-r0.i686
file /usr/sbin/samba_dnsupdate conflicts between attempted installs of samba-4.14.14-r0.core2_64 and lib32-samba-4.14.14-r0.i686
file /usr/sbin/samba_downgrade_db conflicts between attempted installs of samba-4.14.14-r0.core2_64 and lib32-samba-4.14.14-r0.i686
file /usr/sbin/samba_kcc conflicts between attempted installs of samba-4.14.14-r0.core2_64 and lib32-samba-4.14.14-r0.i686
file /usr/sbin/samba_spnupdate conflicts between attempted installs of samba-4.14.14-r0.core2_64 and lib32-samba-4.14.14-r0.i686
file /usr/sbin/samba_upgradedns conflicts between attempted installs of samba-4.14.14-r0.core2_64 and lib32-samba-4.14.14-r0.i686
The conflict is because there is a difference between of lib32-samba-* and samba-* as the following:
64bit:
sys.path.insert(0, "/usr/lib64/python3.10/site-packages")
32bit:
sys.path.insert(0, "/usr/lib/python3.10/site-packages")
But this setting is for environment when running from source tree. There
is no necessary on target.
Upstream-Status: Inappropriate
Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
---
source4/scripting/bin/samba-gpupdate | 1 -
source4/scripting/bin/samba-tool | 1 -
source4/scripting/bin/samba_dnsupdate | 1 -
source4/scripting/bin/samba_downgrade_db | 1 -
source4/scripting/bin/samba_kcc | 1 -
source4/scripting/bin/samba_spnupdate | 1 -
source4/scripting/bin/samba_upgradedns | 1 -
7 files changed, 7 deletions(-)
diff --git a/source4/scripting/bin/samba-gpupdate b/source4/scripting/bin/samba-gpupdate
index 4b3f057..08fec2d 100755
--- a/source4/scripting/bin/samba-gpupdate
+++ b/source4/scripting/bin/samba-gpupdate
@@ -25,7 +25,6 @@ applied, have changed, or is in the right container'''
import os
import sys
-sys.path.insert(0, "bin/python")
import optparse
from samba import getopt as options
diff --git a/source4/scripting/bin/samba-tool b/source4/scripting/bin/samba-tool
index f8a70a6..3c818de 100755
--- a/source4/scripting/bin/samba-tool
+++ b/source4/scripting/bin/samba-tool
@@ -22,7 +22,6 @@
import sys
# Find right direction when running from source tree
-sys.path.insert(0, "bin/python")
# make sure the script dies immediately when hitting control-C,
# rather than raising KeyboardInterrupt. As we do all database
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index 1ce53f5..2cdfbf8 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -36,7 +36,6 @@ os.environ['PYTHONUNBUFFERED'] = '1'
os.environ["TZ"] = "GMT"
# Find right directory when running from source tree
-sys.path.insert(0, "bin/python")
import samba
import optparse
diff --git a/source4/scripting/bin/samba_downgrade_db b/source4/scripting/bin/samba_downgrade_db
index b9a0909..80f581e 100755
--- a/source4/scripting/bin/samba_downgrade_db
+++ b/source4/scripting/bin/samba_downgrade_db
@@ -23,7 +23,6 @@ import optparse
import sys
# Find right directory when running from source tree
-sys.path.insert(0, "bin/python")
import samba
diff --git a/source4/scripting/bin/samba_kcc b/source4/scripting/bin/samba_kcc
index 67d801e..2fc0d6a 100755
--- a/source4/scripting/bin/samba_kcc
+++ b/source4/scripting/bin/samba_kcc
@@ -36,7 +36,6 @@ os.environ['PYTHONUNBUFFERED'] = '1'
os.environ["TZ"] = "GMT"
# Find right directory when running from source tree
-sys.path.insert(0, "bin/python")
import optparse
import time
diff --git a/source4/scripting/bin/samba_spnupdate b/source4/scripting/bin/samba_spnupdate
index 84ff771..b6fe041 100755
--- a/source4/scripting/bin/samba_spnupdate
+++ b/source4/scripting/bin/samba_spnupdate
@@ -32,7 +32,6 @@ os.environ['PYTHONUNBUFFERED'] = '1'
os.environ["TZ"] = "GMT"
# Find right directory when running from source tree
-sys.path.insert(0, "bin/python")
import samba, ldb
import optparse
diff --git a/source4/scripting/bin/samba_upgradedns b/source4/scripting/bin/samba_upgradedns
index afc5807..727a3cc 100755
--- a/source4/scripting/bin/samba_upgradedns
+++ b/source4/scripting/bin/samba_upgradedns
@@ -27,7 +27,6 @@ import grp
from base64 import b64encode
import shlex
-sys.path.insert(0, "bin/python")
import ldb
import samba
--
2.25.1

View File

@@ -0,0 +1,51 @@
From 14f8ee7cd1318567b00e52217d57f0a528fd2cf7 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Wed, 25 Jul 2018 09:55:25 +0800
Subject: [PATCH] samba: cmocka.h: fix musl libc conflicting types error
Fix build on qemumips64(el)
taken from:
[PATCH] libldb: fix musl libc conflicting types error
/third_party/cmocka/cmocka.h:126:28: error: conflicting types for 'uintptr_t'
typedef unsigned int uintptr_t;
^~~~~~~~~
use __DEFINED_uintptr_t in alltypes.h to check if uintptr already defined
Upstream-Status: Pending
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
---
third_party/cmocka/cmocka.h | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/third_party/cmocka/cmocka.h b/third_party/cmocka/cmocka.h
index e6861c8..238201d 100644
--- a/third_party/cmocka/cmocka.h
+++ b/third_party/cmocka/cmocka.h
@@ -111,7 +111,7 @@ typedef uintmax_t LargestIntegralType;
((LargestIntegralType)(value))
/* Smallest integral type capable of holding a pointer. */
-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
+#if !defined(__DEFINED_uintptr_t)
# if defined(_WIN32)
/* WIN32 is an ILP32 platform */
typedef unsigned int uintptr_t;
@@ -135,9 +135,8 @@ typedef uintmax_t LargestIntegralType;
# endif /* __WORDSIZE */
# endif /* _WIN32 */
-# define _UINTPTR_T
-# define _UINTPTR_T_DEFINED
-#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
+# define __DEFINED_uintptr_t
+#endif /* !defined(__DEFINED_uintptr_t) */
/* Perform an unsigned cast to uintptr_t. */
#define cast_to_pointer_integral_type(value) \
--
2.25.1

View File

@@ -0,0 +1,97 @@
From 08003ea30d86a8b983be89f6a161d3baacdaa038 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 6 Nov 2016 23:40:54 -0800
Subject: [PATCH] Musl does not have _r versions of getent() and getpwent()
APIs
Taken from gentoo
http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.3.9-remove-getpwent_r.patch
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
source4/torture/local/nss_tests.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/source4/torture/local/nss_tests.c b/source4/torture/local/nss_tests.c
index 2943122..bc185ca 100644
--- a/source4/torture/local/nss_tests.c
+++ b/source4/torture/local/nss_tests.c
@@ -247,7 +247,6 @@ static bool test_getgrnam_r(struct torture_context *tctx,
return true;
}
-
static bool test_getgrgid(struct torture_context *tctx,
gid_t gid,
struct group *grp_p)
@@ -333,6 +332,7 @@ static bool test_enum_passwd(struct torture_context *tctx,
return true;
}
+#if HAVE_GETPWENT_R
static bool test_enum_r_passwd(struct torture_context *tctx,
struct passwd **pwd_array_p,
size_t *num_pwd_p)
@@ -383,6 +383,7 @@ static bool test_enum_r_passwd(struct torture_context *tctx,
return true;
}
+#endif
static bool torture_assert_passwd_equal(struct torture_context *tctx,
const struct passwd *p1,
@@ -434,7 +435,7 @@ static bool test_passwd_r(struct torture_context *tctx)
struct passwd *pwd, pwd1, pwd2;
size_t num_pwd;
- torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
+ torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
"failed to enumerate passwd");
for (i=0; i < num_pwd; i++) {
@@ -462,7 +463,7 @@ static bool test_passwd_r_cross(struct torture_context *tctx)
struct passwd *pwd, pwd1, pwd2, pwd3, pwd4;
size_t num_pwd;
- torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
+ torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
"failed to enumerate passwd");
for (i=0; i < num_pwd; i++) {
@@ -533,6 +534,7 @@ static bool test_enum_group(struct torture_context *tctx,
return true;
}
+#if HAVE_GETGRENT_R
static bool test_enum_r_group(struct torture_context *tctx,
struct group **grp_array_p,
size_t *num_grp_p)
@@ -583,6 +585,7 @@ static bool test_enum_r_group(struct torture_context *tctx,
return true;
}
+#endif
static bool torture_assert_group_equal(struct torture_context *tctx,
const struct group *g1,
@@ -639,7 +642,7 @@ static bool test_group_r(struct torture_context *tctx)
struct group *grp, grp1, grp2;
size_t num_grp;
- torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
+ torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
"failed to enumerate group");
for (i=0; i < num_grp; i++) {
@@ -667,7 +670,7 @@ static bool test_group_r_cross(struct torture_context *tctx)
struct group *grp, grp1, grp2, grp3, grp4;
size_t num_grp;
- torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
+ torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
"failed to enumerate group");
for (i=0; i < num_grp; i++) {
--
2.25.1

View File

@@ -0,0 +1,46 @@
From 6822c61ade5617c9f109e32ad4cdc115fa9e12c8 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 6 Nov 2016 23:40:54 -0800
Subject: [PATCH] Lifted from gentoo and ported to 4.4.5
http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.2.7-pam.patch
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
source3/wscript | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/source3/wscript b/source3/wscript
index 22be17a..ee9ce52 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -862,7 +862,7 @@ msg.msg_accrightslen = sizeof(fd);
if conf.env.with_iconv:
conf.DEFINE('HAVE_ICONV', 1)
- if Options.options.with_pam:
+ if Options.options.with_pam != False:
use_pam=True
conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
@@ -939,6 +939,17 @@ int i; i = PAM_RADIO_TYPE;
"or headers not found. Use --without-pam to disable "
"PAM support.");
+ else:
+ Logs.warn("PAM disabled")
+ use_pam=False
+ conf.undefine('WITH_PAM')
+ conf.undefine('WITH_PAM_MODULES')
+ conf.undefine('HAVE_SECURITY_PAM_APPL_H')
+ conf.undefine('PAM_RHOST')
+ conf.undefine('PAM_TTY')
+ conf.undefine('HAVE_PAM_PAM_APPL_H')
+
+
seteuid = False
#
--
2.25.1

View File

@@ -0,0 +1,240 @@
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
# Prevent anonymous connections. Overriden if the user sets guest ok = yes
# on any share
restrict anonymous = 1
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP
#### Networking ####
# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0
# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes
#### Debugging/Accounting ####
# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
# Cap the size of the individual log files (in KiB).
max log size = 1000
# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
logging = file
# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
server role = standalone server
obey pam restrictions = yes
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes
# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = never
########## Domains ###########
#
# The following settings only takes effect if 'server role = classic
# primary domain controller', 'server role = classic backup domain controller'
# or 'domain logons' is set
#
# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U
# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd
# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g
############ Misc ############
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m
# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap config * : backend = tdb
; idmap config * : range = 3000-7999
; idmap config YOURDOMAINHERE : backend = tdb
; idmap config YOURDOMAINHERE : range = 100000-999999
; template shell = /bin/bash
# Setup usershare options to enable non-root users to share folders
# with the net usershare command.
# Maximum number of usershare. 0 means that usershare is disabled.
# usershare max shares = 100
# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes
#======================= Share Definitions =======================
[homes]
comment = Home Directories
browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
valid users = %S
# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin

View File

@@ -0,0 +1,3 @@
# <type> <owner> <group> <mode> <path> <linksource>
d root root 0755 /var/log/samba none
d root root 0755 /var/run/samba none

View File

@@ -0,0 +1,361 @@
HOMEPAGE = "https://www.samba.org/"
SECTION = "console/network"
LICENSE = "GPL-3.0-or-later & LGPL-3.0-or-later & GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://${COREBASE}/meta/files/common-licenses/LGPL-3.0-or-later;md5=c51d3eef3be114124d11349ca0d7e117 \
file://${COREBASE}/meta/files/common-licenses/GPL-2.0-or-later;md5=fed54355545ffd980b814dab4a3b312c"
SAMBA_MIRROR = "http://samba.org/samba/ftp"
MIRRORS += "\
${SAMBA_MIRROR} http://mirror.internode.on.net/pub/samba \n \
${SAMBA_MIRROR} http://www.mirrorservice.org/sites/ftp.samba.org \n \
"
export PYTHONHASHSEED="1"
SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
file://smb.conf \
file://volatiles.03_samba \
file://0001-Don-t-check-xsltproc-manpages.patch \
file://0002-do-not-import-target-module-while-cross-compile.patch \
file://0003-Add-config-option-without-valgrind.patch \
file://0004-Add-options-to-configure-the-use-of-libbsd.patch \
file://0005-Fix-pyext_PATTERN-for-cross-compilation.patch \
file://0006-smbtorture-skip-test-case-tfork_cmd_send.patch \
file://0007-Deleted-settiong-of-python-to-fix-the-install-confli.patch \
"
SRC_URI:append:libc-musl = " \
file://samba-pam.patch \
file://samba-4.3.9-remove-getpwent_r.patch \
file://cmocka-uintptr_t.patch \
"
SRC_URI[sha256sum] = "cedeaa2f244a0862c4f73b7b9f2ff92d181fd3ba7df80284a2f25f7713b9cc0e"
UPSTREAM_CHECK_REGEX = "samba\-(?P<pver>4\.18(\.\d+)+).tar.gz"
inherit systemd waf-samba cpan-base perlnative update-rc.d perl-version pkgconfig
# CVE-2011-2411 is valnerble only on HP NonStop Servers.
CVE_CHECK_IGNORE += "CVE-2011-2411"
# Patch for CVE-2018-1050 is applied in version 4.5.15, 4.6.13, 4.7.5.
CVE_CHECK_IGNORE += "CVE-2018-1050"
# Patch for CVE-2018-1057 is applied in version 4.3.13, 4.4.16.
CVE_CHECK_IGNORE += "CVE-2018-1057"
# remove default added RDEPENDS on perl
RDEPENDS:${PN}:remove = "perl"
DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libaio libpam libtasn1 jansson libparse-yapp-perl-native gnutls"
inherit features_check
REQUIRED_DISTRO_FEATURES = "pam"
DEPENDS:append:libc-musl = " libtirpc"
CFLAGS:append:libc-musl = " -I${STAGING_INCDIR}/tirpc"
LDFLAGS:append:libc-musl = " -ltirpc"
COMPATIBLE_HOST:riscv32 = "null"
INITSCRIPT_NAME = "samba"
INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ."
SYSTEMD_PACKAGES = "${PN}-base ${PN}-ad-dc winbind ctdb"
SYSTEMD_SERVICE:${PN}-base = "nmb.service smb.service"
SYSTEMD_SERVICE:${PN}-ad-dc = "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'samba.service', '', d)}"
SYSTEMD_SERVICE:winbind = "winbind.service"
SYSTEMD_SERVICE:ctdb = "ctdb.service"
# There are prerequisite settings to enable ad-dc, so disable the service by default.
# Reference:
# https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller
SYSTEMD_AUTO_ENABLE:${PN}-ad-dc = "disable"
#cross_compile cannot use preforked process, since fork process earlier than point subproces.popen
#to cross Popen
export WAF_NO_PREFORK="yes"
# Use krb5. Build active domain controller.
#
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd zeroconf', d)} \
acl cups ad-dc ldap mitkrb5 \
"
PACKAGECONFIG[acl] = "--with-acl-support,--without-acl-support,acl"
PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin"
PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,cups"
PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
PACKAGECONFIG[sasl] = ",,cyrus-sasl"
PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
PACKAGECONFIG[dmapi] = "--with-dmapi,--without-dmapi,dmapi"
PACKAGECONFIG[zeroconf] = "--enable-avahi,--disable-avahi,avahi"
PACKAGECONFIG[valgrind] = ",--without-valgrind,valgrind,"
PACKAGECONFIG[lttng] = "--with-lttng,--without-lttng,lttng-ust"
PACKAGECONFIG[archive] = "--with-libarchive,--without-libarchive,libarchive"
PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind"
PACKAGECONFIG[gpgme] = "--with-gpgme,--without-gpgme,gpgme"
PACKAGECONFIG[lmdb] = ",--without-ldb-lmdb,lmdb"
PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
PACKAGECONFIG[ad-dc] = "--with-experimental-mit-ad-dc,--without-ad-dc,python3-markdown python3-dnspython,"
PACKAGECONFIG[mitkrb5] = "--with-system-mitkrb5 --with-system-mitkdc=/usr/sbin/krb5kdc,,krb5,"
SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
SAMBA4_PDB_MODULES="pdb_tdbsam,${@bb.utils.contains('PACKAGECONFIG', 'ldap', 'pdb_ldap,', '', d)}pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
SAMBA4_AUTH_MODULES="auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4"
SAMBA4_MODULES="${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MODULES}"
# These libraries are supposed to replace others supplied by packages, but decorate the names of
# .so files so there will not be a conflict. This is not done consistantly, so be very careful
# when adding to this list.
#
SAMBA4_LIBS="heimdal,cmocka,NONE"
EXTRA_OECONF += "--enable-fhs \
--with-piddir=/run \
--with-sockets-dir=/run/samba \
--with-modulesdir=${libdir}/samba \
--with-privatelibdir=${libdir}/samba \
--with-lockdir=${localstatedir}/lib/samba \
--with-cachedir=${localstatedir}/lib/samba \
--disable-rpath-install \
--disable-rpath \
--with-shared-modules=${SAMBA4_MODULES} \
--bundled-libraries=${SAMBA4_LIBS} \
${@oe.utils.conditional('TARGET_ARCH', 'x86_64', '', '--disable-glusterfs', d)} \
--with-cluster-support \
--with-profiling-data \
--with-libiconv=${STAGING_DIR_HOST}${prefix} \
--with-pam --with-pammodulesdir=${base_libdir}/security \
"
LDFLAGS += "-Wl,-z,relro,-z,now ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
do_configure:append() {
cd ${S}/pidl/
perl Makefile.PL PREFIX=${prefix}
sed -e 's,VENDORPREFIX)/lib/perl,VENDORPREFIX)/${baselib}/perl,g' \
-e 's,PERLPREFIX)/lib/perl,PERLPREFIX)/${baselib}/perl,g' -i Makefile
}
do_compile:append() {
oe_runmake -C ${S}/pidl
}
do_install:append() {
for section in 1 5 7; do
install -d ${D}${mandir}/man$section
install -m 0644 ctdb/doc/*.$section ${D}${mandir}/man$section
done
for section in 1 5 7 8; do
install -d ${D}${mandir}/man$section
install -m 0644 docs/manpages/*.$section ${D}${mandir}/man$section
done
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${S}/bin/default/packaging/systemd/*.service ${D}${systemd_system_unitdir}/
sed -e 's,\(ExecReload=\).*\(/kill\),\1${base_bindir}\2,' \
-e 's,/etc/sysconfig/samba,${sysconfdir}/default/samba,' \
-i ${D}${systemd_system_unitdir}/*.service
if [ "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'yes', 'no', d)}" = "no" ]; then
rm -f ${D}${systemd_system_unitdir}/samba.service
fi
install -d ${D}${sysconfdir}/tmpfiles.d
install -m644 packaging/systemd/samba.conf.tmp ${D}${sysconfdir}/tmpfiles.d/samba.conf
echo "d ${localstatedir}/log/samba 0755 root root -" \
>> ${D}${sysconfdir}/tmpfiles.d/samba.conf
install -d ${D}${sysconfdir}/init.d
install -m 0755 packaging/sysv/samba.init ${D}${sysconfdir}/init.d/samba
sed -e 's,/opt/samba/bin,${sbindir},g' \
-e 's,/opt/samba/smb.conf,${sysconfdir}/samba/smb.conf,g' \
-e 's,/opt/samba/log,${localstatedir}/log/samba,g' \
-e 's,/etc/init.d/samba.server,${sysconfdir}/init.d/samba,g' \
-e 's,/usr/bin,${base_bindir},g' \
-i ${D}${sysconfdir}/init.d/samba
install -d ${D}${sysconfdir}/samba
echo "127.0.0.1 localhost" > ${D}${sysconfdir}/samba/lmhosts
install -m644 ${WORKDIR}/smb.conf ${D}${sysconfdir}/samba/smb.conf
install -D -m 644 ${WORKDIR}/volatiles.03_samba ${D}${sysconfdir}/default/volatiles/03_samba
install -d ${D}${sysconfdir}/default
install -m644 packaging/systemd/samba.sysconfig ${D}${sysconfdir}/default/samba
# the items are from ctdb/tests/run_tests.sh
for d in cunit eventd eventscripts onnode shellcheck takeover takeover_helper tool; do
testdir=${D}${datadir}/ctdb-tests/UNIT/$d
install -d $testdir
cp ${S}/ctdb/tests/UNIT/$d/*.sh $testdir
cp -r ${S}/ctdb/tests/UNIT/$d/scripts ${S}/ctdb/tests/UNIT/$d/stubs $testdir || true
done
# fix file-rdeps qa warning
if [ -f ${D}${bindir}/onnode ]; then
sed -i 's:\(#!/bin/\)bash:\1sh:' ${D}${bindir}/onnode
fi
chmod 0750 ${D}${sysconfdir}/sudoers.d || true
rm -rf ${D}/run ${D}${localstatedir}/run ${D}${localstatedir}/log
for f in samba-gpupdate samba_upgradedns samba_spnupdate samba_kcc samba_dnsupdate samba_downgrade_db; do
if [ -f "${D}${sbindir}/$f" ]; then
sed -i -e 's,${PYTHON},/usr/bin/env python3,g' ${D}${sbindir}/$f
fi
done
if [ -f "${D}${bindir}/samba-tool" ]; then
sed -i -e 's,${PYTHON},/usr/bin/env python3,g' ${D}${bindir}/samba-tool
fi
oe_runmake -C ${S}/pidl DESTDIR=${D} install_vendor
find ${D}${libdir}/perl5/ -type f -name "perllocal.pod" -delete
find ${D}${libdir}/perl5/ -type f -name ".packlist" -delete
sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${bindir}/pidl
}
PACKAGES =+ "${PN}-python3 ${PN}-pidl \
${PN}-dsdb-modules ${PN}-testsuite registry-tools \
winbind ctdb ctdb-tests \
${PN}-common ${PN}-base ${PN}-ad-dc \
smbclient ${PN}-client ${PN}-server ${PN}-test"
python samba_populate_packages() {
def module_hook(file, pkg, pattern, format, basename):
pn = d.getVar('PN')
d.appendVar('RRECOMMENDS:%s-base' % pn, ' %s' % pkg)
mlprefix = d.getVar('MLPREFIX') or ''
pam_libdir = d.expand('${base_libdir}/security')
pam_pkgname = mlprefix + 'pam-plugin%s'
do_split_packages(d, pam_libdir, r'^pam_(.*)\.so$', pam_pkgname, 'PAM plugin for %s', extra_depends='', prepend=True)
libdir = d.getVar('libdir')
do_split_packages(d, libdir, r'^lib(.*)\.so\..*$', 'lib%s', 'Samba %s library', extra_depends='${PN}-common', prepend=True, allow_links=True)
pkglibdir = '%s/samba' % libdir
do_split_packages(d, pkglibdir, r'^lib(.*)\.so$', 'lib%s', 'Samba %s library', extra_depends='${PN}-common', prepend=True)
moduledir = '%s/samba/auth' % libdir
do_split_packages(d, moduledir, r'^(.*)\.so$', 'samba-auth-%s', 'Samba %s authentication backend', hook=module_hook, extra_depends='', prepend=True)
moduledir = '%s/samba/pdb' % libdir
do_split_packages(d, moduledir, r'^(.*)\.so$', 'samba-pdb-%s', 'Samba %s password backend', hook=module_hook, extra_depends='', prepend=True)
}
PACKAGESPLITFUNCS:prepend = "samba_populate_packages "
PACKAGES_DYNAMIC = "samba-auth-.* samba-pdb-.*"
RDEPENDS:${PN} += "${PN}-base ${PN}-python3 ${PN}-dsdb-modules python3"
RDEPENDS:${PN}-python3 += "pytalloc python3-tdb pyldb"
FILES:${PN}-base = "${sbindir}/nmbd \
${sbindir}/smbd \
${sysconfdir}/init.d \
${systemd_system_unitdir}/nmb.service \
${systemd_system_unitdir}/smb.service"
FILES:${PN}-ad-dc = "${sbindir}/samba \
${systemd_system_unitdir}/samba.service \
${libdir}/krb5/plugins/kdb/samba.so \
"
RDEPENDS:${PN}-ad-dc = "krb5-kdc"
FILES:ctdb = "${bindir}/ctdb \
${bindir}/ctdb_diagnostics \
${bindir}/ltdbtool \
${bindir}/onnode \
${bindir}/ping_pong \
${sbindir}/ctdbd \
${datadir}/ctdb \
${libexecdir}/ctdb \
${localstatedir}/lib/ctdb \
${sysconfdir}/ctdb \
${sysconfdir}/sudoers.d/ctdb \
${systemd_system_unitdir}/ctdb.service \
"
FILES:ctdb-tests = "${bindir}/ctdb_run_tests \
${bindir}/ctdb_run_cluster_tests \
${datadir}/ctdb-tests \
${datadir}/ctdb/tests \
"
RDEPENDS:ctdb-tests += "bash util-linux-getopt ctdb"
FILES:${BPN}-common = "${sysconfdir}/default \
${sysconfdir}/samba \
${sysconfdir}/tmpfiles.d \
${localstatedir}/lib/samba \
${localstatedir}/spool/samba \
"
FILES:${PN} += "${libdir}/vfs/*.so \
${libdir}/charset/*.so \
${libdir}/*.dat \
${libdir}/auth/*.so \
"
FILES:${PN}-dsdb-modules = "${libdir}/samba/ldb"
FILES:${PN}-testsuite = "${bindir}/gentest \
${bindir}/locktest \
${bindir}/masktest \
${bindir}/ndrdump \
${bindir}/smbtorture"
FILES:registry-tools = "${bindir}/regdiff \
${bindir}/regpatch \
${bindir}/regshell \
${bindir}/regtree"
FILES:winbind = "${sbindir}/winbindd \
${bindir}/wbinfo \
${bindir}/ntlm_auth \
${libdir}/samba/idmap \
${libdir}/samba/nss_info \
${libdir}/winbind_krb5_locator.so \
${libdir}/winbind-krb5-localauth.so \
${sysconfdir}/init.d/winbind \
${systemd_system_unitdir}/winbind.service"
FILES:${PN}-python3 = "${PYTHON_SITEPACKAGES_DIR}"
FILES:smbclient = "${bindir}/cifsdd \
${bindir}/rpcclient \
${bindir}/smbcacls \
${bindir}/smbclient \
${bindir}/smbcquotas \
${bindir}/smbget \
${bindir}/smbspool \
${bindir}/smbtar \
${bindir}/smbtree \
${libexecdir}/samba/smbspool_krb5_wrapper"
FILES:${PN}-pidl = "${bindir}/pidl \
${libdir}/perl5 \
"
RDEPENDS:${PN}-pidl += "perl perl-modules libparse-yapp-perl"
RDEPENDS:${PN}-client = "\
smbclient \
winbind \
registry-tools \
${PN}-pidl \
"
ALLOW_EMPTY:${PN}-client = "1"
RDEPENDS:${PN}-server = "\
${PN} \
winbind \
registry-tools \
"
ALLOW_EMPTY:${PN}-server = "1"
RDEPENDS:${PN}-test = "\
ctdb-tests \
${PN}-testsuite \
"
ALLOW_EMPTY:${PN}-test = "1"