Compare commits

...

6 Commits

Author SHA1 Message Date
David Abdurachmanov 677dafe90e
Enable RISC-V (riscv64)
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2018-09-13 08:41:37 +02:00
Andreas Schneider e84add587d Update samba-4.9.0rc5-parallel-builds.patch 2018-09-06 14:32:50 +02:00
Andreas Schneider 3736d1c511 Update to version 4.9.0rc5 2018-09-06 14:32:49 +02:00
Günther Deschner 3ca70ac699 Update to Samba 4.9.0rc4
Guenther
2018-08-29 17:34:48 +02:00
Günther Deschner f3ad248a6d More python3 cleanup
Guenther
2018-08-17 15:28:37 +02:00
Andreas Schneider e1c1d3ec79 Fix python3 packaging 2018-08-17 15:23:08 +02:00
6 changed files with 205 additions and 107 deletions

4
.gitignore vendored
View File

@ -133,3 +133,7 @@ samba-3.6.0pre1.tar.gz
/samba-4.9.0rc2.tar.asc
/samba-4.9.0rc3.tar.xz
/samba-4.9.0rc3.tar.asc
/samba-4.9.0rc4.tar.xz
/samba-4.9.0rc4.tar.asc
/samba-4.9.0rc5.tar.asc
/samba-4.9.0rc5.tar.xz

View File

@ -1,96 +0,0 @@
From dd9da7bc9306b95496d502589f95be0efc097fc0 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <ab@samba.org>
Date: Thu, 12 Jul 2018 10:19:41 +0300
Subject: [PATCH] wafsamba/samba_abi: always hide ABI symbols which must be
local
binutils 2.31 is going to change how shared libraries are linked, such
that they always provide their own local definitions of the _end, _edata
and _bss_start symbols. This would all be fine, except for shared
libraries that export all symbols be default. (Rather than just
exporting those symbols that form part of their API).
According to binutils developers, we should only export the symbols we
explicitly want to be used. We don't use this principle for all our
libraries and deliberately don't want to have ABI versioning control for
all of them, so the change I introduce here is to explicitly mark those
symbols that will always be added by default linker configuration with
binutils 2.31 as local. Right now these are '_end', '_edata', and
'__bss_start' symbols.
Signed-off-by: Alexander Bokovoy <ab@samba.org>
---
buildtools/wafsamba/samba_abi.py | 10 ++++++----
buildtools/wafsamba/tests/test_abi.py | 14 ++++++++++++++
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index 196b468f5b3..4603e764fea 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -192,10 +192,12 @@ def abi_write_vscript(f, libname, current_version, versions, symmap, abi_match):
f.write("\t\t%s;\n" % x)
else:
f.write("\t\t*;\n")
- if abi_match != ["*"]:
- f.write("\tlocal:\n")
- for x in local_abi:
- f.write("\t\t%s;\n" % x[1:])
+ # Always hide symbols that must be local if exist
+ local_abi.extend(["!_end", "!__bss_start", "!_edata"])
+ f.write("\tlocal:\n")
+ for x in local_abi:
+ f.write("\t\t%s;\n" % x[1:])
+ if global_abi != ["*"]:
if len(global_abi) > 0:
f.write("\t\t*;\n")
f.write("};\n")
diff --git a/buildtools/wafsamba/tests/test_abi.py b/buildtools/wafsamba/tests/test_abi.py
index bba78c1ba07..74892146990 100644
--- a/buildtools/wafsamba/tests/test_abi.py
+++ b/buildtools/wafsamba/tests/test_abi.py
@@ -66,6 +66,10 @@ class WriteVscriptTests(TestCase):
1.0 {
\tglobal:
\t\t*;
+\tlocal:
+\t\t_end;
+\t\t__bss_start;
+\t\t_edata;
};
""")
@@ -84,6 +88,10 @@ MYLIB_0.1 {
1.0 {
\tglobal:
\t\t*;
+\tlocal:
+\t\t_end;
+\t\t__bss_start;
+\t\t_edata;
};
""")
@@ -99,6 +107,9 @@ MYLIB_0.1 {
\t\t*;
\tlocal:
\t\texc_*;
+\t\t_end;
+\t\t__bss_start;
+\t\t_edata;
};
""")
@@ -115,6 +126,9 @@ MYLIB_0.1 {
\t\tpub_*;
\tlocal:
\t\texc_*;
+\t\t_end;
+\t\t__bss_start;
+\t\t_edata;
\t\t*;
};
""")
--
2.17.1

View File

@ -0,0 +1,55 @@
From 2f1c716ffef351a56aa5bd0a26c3dd1e34d3283a Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Thu, 6 Sep 2018 12:40:10 +0200
Subject: [PATCH] wafsamba: Deal with make -j<num>
Currently only make -j works for parallel builds and make -j4 results in
no parallel jobs at all.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13606
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
---
buildtools/wafsamba/samba_utils.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index 30e99432d1b..fd61b8425d8 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -448,6 +448,7 @@ def CHECK_MAKEFLAGS(bld):
if makeflags is None:
return
jobs_set = False
+ jobs = None
# we need to use shlex.split to cope with the escaping of spaces
# in makeflags
for opt in shlex.split(makeflags):
@@ -470,17 +471,21 @@ def CHECK_MAKEFLAGS(bld):
setattr(Options.options, opt[0:loc], opt[loc+1:])
elif opt[0] != '-':
for v in opt:
- if v == 'j':
+ if re.search(r'j[0-9]*$', v):
jobs_set = True
+ jobs = opt.strip('j')
elif v == 'k':
Options.options.keep = True
- elif opt == '-j':
+ elif re.search(r'-j[0-9]*$', opt):
jobs_set = True
+ jobs = opt.strip('-j')
elif opt == '-k':
Options.options.keep = True
if not jobs_set:
# default to one job
Options.options.jobs = 1
+ elif jobs_set and jobs:
+ Options.options.jobs = int(jobs)
Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS
--
2.18.0

View File

@ -0,0 +1,117 @@
From e2dd47233f467e2ab80564968be4af6da6505161 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Mon, 3 Sep 2018 10:35:08 +0200
Subject: [PATCH 1/2] waf: Check for -fstack-protect-strong support
The -fstack-protector* flags are compiler only flags, don't pass them to
the linker.
https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 38e97f8b52e85bdfcf2d74a4fb3c848fa46ba371)
---
buildtools/wafsamba/samba_autoconf.py | 36 ++++++++++++++-------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index c4391d0c4dc..bfd6f9710db 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -674,23 +674,25 @@ def SAMBA_CONFIG_H(conf, path=None):
return
# we need to build real code that can't be optimized away to test
- if conf.check(fragment='''
- #include <stdio.h>
-
- int main(void)
- {
- char t[100000];
- while (fgets(t, sizeof(t), stdin));
- return 0;
- }
- ''',
- execute=0,
- ccflags='-fstack-protector',
- ldflags='-fstack-protector',
- mandatory=False,
- msg='Checking if toolchain accepts -fstack-protector'):
- conf.ADD_CFLAGS('-fstack-protector')
- conf.ADD_LDFLAGS('-fstack-protector')
+ stack_protect_list = ['-fstack-protector-strong', '-fstack-protector']
+ for stack_protect_flag in stack_protect_list:
+ flag_supported = conf.check(fragment='''
+ #include <stdio.h>
+
+ int main(void)
+ {
+ char t[100000];
+ while (fgets(t, sizeof(t), stdin));
+ return 0;
+ }
+ ''',
+ execute=0,
+ ccflags=[ '-Werror', '-Wp,-D_FORTIFY_SOURCE=2', stack_protect_flag],
+ mandatory=False,
+ msg='Checking if compiler accepts %s' % (stack_protect_flag))
+ if flag_supported:
+ conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag))
+ break
if Options.options.debug:
conf.ADD_CFLAGS('-g', testflags=True)
--
2.18.0
From 09f3acb3497efb9ebb8a0d7d199726a8c318e4f8 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Mon, 3 Sep 2018 10:49:52 +0200
Subject: [PATCH 2/2] waf: Add -fstack-clash-protection
https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit fc4df251c88365142515a81bea1120b2b84cc4a0)
---
buildtools/wafsamba/samba_autoconf.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index bfd6f9710db..f2b3ec8db8d 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -694,6 +694,23 @@ def SAMBA_CONFIG_H(conf, path=None):
conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag))
break
+ flag_supported = conf.check(fragment='''
+ #include <stdio.h>
+
+ int main(void)
+ {
+ char t[100000];
+ while (fgets(t, sizeof(t), stdin));
+ return 0;
+ }
+ ''',
+ execute=0,
+ ccflags=[ '-Werror', '-fstack-clash-protection'],
+ mandatory=False,
+ msg='Checking if compiler accepts -fstack-clash-protection')
+ if flag_supported:
+ conf.ADD_CFLAGS('-fstack-clash-protection')
+
if Options.options.debug:
conf.ADD_CFLAGS('-g', testflags=True)
--
2.18.0

View File

@ -6,7 +6,7 @@
# ctdb is enabled by default, you can disable it with: --without clustering
%bcond_without clustering
%define main_release 2
%define main_release 3
%define samba_version 4.9.0
%define talloc_version 2.1.14
@ -14,12 +14,12 @@
%define tevent_version 0.9.37
%define ldb_version 1.4.2
# This should be rc1 or nil
%define pre_release rc3
%define pre_release rc5
%if "x%{?pre_release}" != "x"
%define samba_release 0.%{main_release}.%{pre_release}%{?dist}
%else
%define samba_release %{main_release}%{?dist}
%define samba_release %{main_release}.0.riscv64%{?dist}
%endif
# This is a network daemon, do a hardened build
@ -39,7 +39,7 @@
%global with_vfs_cephfs 0
%if 0%{?fedora}
%ifarch aarch64 ppc64le s390x x86_64
%ifarch aarch64 ppc64le s390x x86_64 riscv64
%global with_vfs_cephfs 1
%endif
%endif
@ -122,7 +122,8 @@ Source14: samba.pamd
Source200: README.dc
Source201: README.downgrade
Patch1: samba-4.8.3-vscript.local.patch
Patch0: samba-4.9.0rc5-stack-protector.patch
Patch1: samba-4.9.0rc5-parallel-builds.patch
Requires(pre): /usr/sbin/groupadd
Requires(post): systemd
@ -832,8 +833,10 @@ xzcat %{SOURCE0} | gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} -
# TODO: resolve underlinked python modules
export python_LDFLAGS="$(echo %{__global_ldflags} | sed -e 's/-Wl,-z,defs//g')"
# Use the gold linker
# Use the gold linker, except RISC-V (riscv64), which does not have gold
%ifnarch riscv64
export LDFLAGS="%{__global_ldflags} -fuse-ld=gold"
%endif
%if 0%{?rhel}
# Use Python 2 for the waf buildscript
@ -921,7 +924,6 @@ done
filenames=$(echo "
tests/dcerpc/integer.py
tests/dcerpc/unix.py
tests/dns_invalid.py
")
for file in $filenames; do
filename="%{buildroot}/%{python3_sitearch}/samba/$file"
@ -2210,10 +2212,10 @@ fi
%{python2_sitearch}/samba/tests/dns.py*
%{python2_sitearch}/samba/tests/dns_base.py*
%{python2_sitearch}/samba/tests/dns_forwarder.py*
%{python2_sitearch}/samba/tests/dns_invalid.py*
%dir %{python2_sitearch}/samba/tests/dns_forwarder_helpers
%{python2_sitearch}/samba/tests/dns_forwarder_helpers/server.py*
%{python2_sitearch}/samba/tests/dns_tkey.py*
%{python2_sitearch}/samba/tests/dns_invalid.py*
%{python2_sitearch}/samba/tests/dns_wildcard.py*
%{python2_sitearch}/samba/tests/docs.py*
%{python2_sitearch}/samba/tests/domain_backup.py*
@ -2602,6 +2604,7 @@ fi
%{python3_sitearch}/samba/tests/__pycache__/dns.*.pyc
%{python3_sitearch}/samba/tests/__pycache__/dns_base.*.pyc
%{python3_sitearch}/samba/tests/__pycache__/dns_forwarder.*.pyc
%{python3_sitearch}/samba/tests/__pycache__/dns_invalid.*.pyc
%{python3_sitearch}/samba/tests/__pycache__/dns_tkey.*.pyc
%{python3_sitearch}/samba/tests/__pycache__/dns_wildcard.*.pyc
%{python3_sitearch}/samba/tests/__pycache__/dsdb.*.pyc
@ -2733,7 +2736,10 @@ fi
%{python3_sitearch}/samba/tests/dns.py
%{python3_sitearch}/samba/tests/dns_base.py
%{python3_sitearch}/samba/tests/dns_forwarder.py
%{python3_sitearch}/samba/tests/dns_forwarder_helpers
%dir %{python3_sitearch}/samba/tests/dns_forwarder_helpers
%{python3_sitearch}/samba/tests/dns_forwarder_helpers/__pycache__/server.*.pyc
%{python3_sitearch}/samba/tests/dns_forwarder_helpers/server.py
%{python3_sitearch}/samba/tests/dns_invalid.py
%{python3_sitearch}/samba/tests/dns_tkey.py
%{python3_sitearch}/samba/tests/dns_wildcard.py
%{python3_sitearch}/samba/tests/dsdb.py
@ -3137,6 +3143,7 @@ fi
%{_datadir}/ctdb/tests/cunit/config_test_004.sh
%{_datadir}/ctdb/tests/cunit/config_test_005.sh
%{_datadir}/ctdb/tests/cunit/config_test_006.sh
%{_datadir}/ctdb/tests/cunit/config_test_007.sh
%{_datadir}/ctdb/tests/cunit/db_hash_test_001.sh
%{_datadir}/ctdb/tests/cunit/event_protocol_test_001.sh
%{_datadir}/ctdb/tests/cunit/event_script_test_001.sh
@ -3826,6 +3833,17 @@ fi
%endif # with_clustering_support
%changelog
* Thu Sep 13 2018 David Abdurachmanov <david.abdurachmanov@gmail.com> - 4.9.0rc5-3.0.riscv64
* Thu Sep 06 2018 Andreas Schneider <asn@redhat.com> - 4.9.0rc5-3
- Update to Samba 4.9.0rc5
* Wed Aug 29 2018 Guenther Deschner <gdeschner@redhat.com> - 4.9.0rc4-3
- Update to Samba 4.9.0rc4
* Thu Aug 16 2018 Andreas Schneider <asn@redhat.com> - 4.9.0rc3-3
- Fix python3 packaging
* Wed Aug 15 2018 Guenther Deschner <gdeschner@redhat.com> - 4.9.0rc3-2
- Update to Samba 4.9.0rc3
- resolves: #1589651, #1617916 - Security fixes for CVE-2018-1139

View File

@ -1,2 +1,2 @@
SHA512 (samba-4.9.0rc3.tar.xz) = 42164fda5f7d75754893a0d66f2909608ca006c968e6031d4f68797ab9a07502330e96977f553c452f24737f4deddb9cc8cb836ab70d4909d1eb102bd14457fb
SHA512 (samba-4.9.0rc3.tar.asc) = 0b405e77d7e3a824916880f5f32716e69e94158dd519b6dac66fd2109f5e70e32a55ee827274d31f500b6ddf0aafd00efa54b58b6dfdc6a26ab46d3acb04a286
SHA512 (samba-4.9.0rc5.tar.asc) = c70796cd5ffdea99ce474c07695af652b21df41de0dfe9548eb178e37792eecef0acaa4610361a88dee2e8e67fd5ab1dfefb5c214ee7f31b6dc34f68400868ab
SHA512 (samba-4.9.0rc5.tar.xz) = e6c1d49868044a3d7a33d5baf99a09869a6a3bfec6a81ee0042f381f7065215d0204f190b2a6cb679b4544e1ed31c34a0d7c0237f7ddcf72a94933cbae138d91