diff --git a/SOURCES/samba-4.10-Fix_forest_trust_with_additional_attrs.patch b/SOURCES/samba-4.10-Fix_forest_trust_with_additional_attrs.patch new file mode 100644 index 0000000..6f7ca74 --- /dev/null +++ b/SOURCES/samba-4.10-Fix_forest_trust_with_additional_attrs.patch @@ -0,0 +1,48 @@ +From 2d783791856be182d420555d8df5e31768b0d7d2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?G=C3=BCnther=20Deschner?= +Date: Thu, 12 Sep 2019 16:39:10 +0200 +Subject: [PATCH] s3-winbindd: fix forest trusts with additional trust + attributes. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14130 + +Guenther + +Signed-off-by: Guenther Deschner +Reviewed-by: Stefan Metzmacher +Reviewed-by: Andreas Schneider +(cherry picked from commit d78c87e665e23e6470a19a69383ede7137172c26) +--- + source3/winbindd/winbindd_ads.c | 2 +- + source3/winbindd/winbindd_util.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c +index 5f20cfb7f76..485ca831be9 100644 +--- a/source3/winbindd/winbindd_ads.c ++++ b/source3/winbindd/winbindd_ads.c +@@ -1457,7 +1457,7 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain, + */ + + if ((trust->trust_attributes +- == LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN) && ++ & LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN) && + !domain->primary ) + { + DEBUG(10,("trusted_domains: Skipping external trusted " +diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c +index cc4c3f7391a..ee7651c9639 100644 +--- a/source3/winbindd/winbindd_util.c ++++ b/source3/winbindd/winbindd_util.c +@@ -723,7 +723,7 @@ static void rescan_forest_trusts( void ) + + if ( (flags & NETR_TRUST_FLAG_INBOUND) && + (type == LSA_TRUST_TYPE_UPLEVEL) && +- (attribs == LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE) ) ++ (attribs & LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE) ) + { + /* add the trusted domain if we don't know + about it */ +-- +2.21.0 + diff --git a/SOURCES/samba-4.10-Remove_shm_get_configure_check.patch b/SOURCES/samba-4.10-Remove_shm_get_configure_check.patch new file mode 100644 index 0000000..9077d9e --- /dev/null +++ b/SOURCES/samba-4.10-Remove_shm_get_configure_check.patch @@ -0,0 +1,76 @@ +From 233bed607ae59f85db7592729e0e5fd3206a9ee2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= +Date: Mon, 11 Feb 2019 10:03:00 +0100 +Subject: [PATCH 1/2] waf: print the library name in which we search for a + function + +Signed-off-by: Bjoern Jacke +Reviewed-by: Andreas Schneider +(cherry picked from commit 7058a88cbe3c1a2ad272b6debc1c9d09a259d116) +--- + buildtools/wafsamba/samba_autoconf.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py +index 6208e3b0439..a39d6ef06d1 100644 +--- a/buildtools/wafsamba/samba_autoconf.py ++++ b/buildtools/wafsamba/samba_autoconf.py +@@ -251,7 +251,10 @@ def CHECK_FUNC(conf, f, link=True, lib=None, headers=None): + + ret = False + +- conf.COMPOUND_START('Checking for %s' % f) ++ in_lib_str = "" ++ if lib: ++ in_lib_str = " in %s" % lib ++ conf.COMPOUND_START('Checking for %s%s' % (f, in_lib_str)) + + if link is None or link: + ret = CHECK_CODE(conf, +-- +2.23.0 + + +From 8ee1eed377186628675ff1590bc69175ed5def48 Mon Sep 17 00:00:00 2001 +From: Christof Schmitt +Date: Wed, 24 Apr 2019 10:16:30 -0700 +Subject: [PATCH 2/2] wscript: Remove checks for shm_open and shmget + +Commit 74a16a1094278 "s3:smbprofile: Replace sysv shmem with tdb" +removed the usage of the shared memory segment for profiling data. As +there are no other users of shared memory segments, remove the configure +check for these functions. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 + +Signed-off-by: Christof Schmitt +Reviewed-by: Jeremy Allison +(cherry picked from commit 94f2ed3eb35b94d5152578dbb6d5ee8f2fa2da69) +--- + source3/wscript | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/source3/wscript b/source3/wscript +index 5c2ba18f872..9d283e40a40 100644 +--- a/source3/wscript ++++ b/source3/wscript +@@ -119,8 +119,6 @@ def configure(conf): + conf.CHECK_FUNCS('lutimes futimes utimensat futimens') + conf.CHECK_FUNCS('mlock munlock mlockall munlockall') + conf.CHECK_FUNCS('memalign posix_memalign hstrerror') +- conf.CHECK_FUNCS('shmget') +- conf.CHECK_FUNCS_IN('shm_open', 'rt', checklibc=True) + conf.CHECK_FUNCS_IN('yp_get_default_domain', 'nsl') + conf.CHECK_FUNCS_IN('dn_expand _dn_expand __dn_expand', 'resolv') + conf.CHECK_FUNCS_IN('dn_expand', 'inet') +@@ -408,7 +406,6 @@ rdchk _read __read _readdir __readdir + _seekdir __seekdir + select setenv setgidx setgroups setlocale setluid + setmntent setpgid setpriv setsid setuidx +-shmget shm_open + _stat __stat statvfs + strcasecmp strchr strpbrk strsignal strtol strupr sysconf sysctl sysctlbyname + __sys_llseek syslog _telldir __telldir timegm +-- +2.23.0 + diff --git a/SOURCES/samba-4.10-avoid_overlinking_with_librt_and_libpthread.patch b/SOURCES/samba-4.10-avoid_overlinking_with_librt_and_libpthread.patch new file mode 100644 index 0000000..74df9e2 --- /dev/null +++ b/SOURCES/samba-4.10-avoid_overlinking_with_librt_and_libpthread.patch @@ -0,0 +1,415 @@ +From 5095b43b5ea079aab47963fa443a0d697f4a7af9 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 23 Sep 2019 15:18:55 +0200 +Subject: [PATCH 1/9] s3:waf: Do not check for nanosleep() as we don't use it + anywhere +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We use usleep() in the meantime. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 + +Signed-off-by: Andreas Schneider +Signed-off-by: Isaac Boukris +Pair-Programmed-With: Isaac Boukris +Reviewed-by: Matthias Dieter Wallnöfer +Reviewed-by: Alexander Bokovoy +(cherry picked from commit 952e1812fa9bdc1bac2a7ae5ebb5532f1ea31447) +--- + source3/wscript | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/source3/wscript b/source3/wscript +index 84a2ad9e601..5c2ba18f872 100644 +--- a/source3/wscript ++++ b/source3/wscript +@@ -116,7 +116,6 @@ def configure(conf): + conf.CHECK_FUNCS('fstatat') + conf.CHECK_FUNCS('getpwent_r setenv clearenv strcasecmp fcvt fcvtl') + conf.CHECK_FUNCS('syslog vsyslog timegm setlocale') +- conf.CHECK_FUNCS_IN('nanosleep', 'rt') + conf.CHECK_FUNCS('lutimes futimes utimensat futimens') + conf.CHECK_FUNCS('mlock munlock mlockall munlockall') + conf.CHECK_FUNCS('memalign posix_memalign hstrerror') +-- +2.23.0 + + +From 74d4e574e0f971bd7c0bf60af696d285c3a01aae Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 23 Sep 2019 15:14:24 +0200 +Subject: [PATCH 2/9] replace: Only link against librt if really needed +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +fdatasync() and clock_gettime() are provided by glibc on Linux, so there +is no need to link against librt. Checks have been added so if there are +platforms which require it are still functional. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 + +Signed-off-by: Andreas Schneider +Signed-off-by: Isaac Boukris +Pair-Programmed-With: Isaac Boukris +Reviewed-by: Matthias Dieter Wallnöfer +Reviewed-by: Alexander Bokovoy +(cherry picked from commit 480152dd6729d4c58faca6f3e4fa91ff4614c272) +--- + lib/replace/wscript | 24 +++++++++++++++++++++--- + 1 file changed, 21 insertions(+), 3 deletions(-) + +diff --git a/lib/replace/wscript b/lib/replace/wscript +index a7fd25d15bc..d8423b1d281 100644 +--- a/lib/replace/wscript ++++ b/lib/replace/wscript +@@ -457,11 +457,28 @@ def configure(conf): + conf.CHECK_C_PROTOTYPE('dlopen', 'void *dlopen(const char* filename, unsigned int flags)', + define='DLOPEN_TAKES_UNSIGNED_FLAGS', headers='dlfcn.h dl.h') + +- if conf.CHECK_FUNCS_IN('fdatasync', 'rt', checklibc=True): ++ # ++ # Check for clock_gettime and fdatasync ++ # ++ # First check libc to avoid linking libreplace against librt. ++ # ++ if conf.CHECK_FUNCS('fdatasync'): + # some systems are missing the declaration + conf.CHECK_DECLS('fdatasync') ++ else: ++ if conf.CHECK_FUNCS_IN('fdatasync', 'rt'): ++ # some systems are missing the declaration ++ conf.CHECK_DECLS('fdatasync') ++ ++ has_clock_gettime = False ++ if conf.CHECK_FUNCS('clock_gettime'): ++ has_clock_gettime = True ++ ++ if not has_clock_gettime: ++ if conf.CHECK_FUNCS_IN('clock_gettime', 'rt', checklibc=True): ++ has_clock_gettime = True + +- if conf.CHECK_FUNCS_IN('clock_gettime', 'rt', checklibc=True): ++ if has_clock_gettime: + for c in ['CLOCK_MONOTONIC', 'CLOCK_PROCESS_CPUTIME_ID', 'CLOCK_REALTIME']: + conf.CHECK_CODE(''' + #if TIME_WITH_SYS_TIME +@@ -815,6 +832,7 @@ def build(bld): + + extra_libs = '' + if bld.CONFIG_SET('HAVE_LIBBSD'): extra_libs += ' bsd' ++ if bld.CONFIG_SET('HAVE_LIBRT'): extra_libs += ' rt' + + bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC', + REPLACE_HOSTCC_SOURCE, +@@ -855,7 +873,7 @@ def build(bld): + # at the moment: + # hide_symbols=bld.BUILTIN_LIBRARY('replace'), + private_library=True, +- deps='crypt dl nsl socket rt attr' + extra_libs) ++ deps='crypt dl nsl socket attr' + extra_libs) + + replace_test_cflags = '' + if bld.CONFIG_SET('HAVE_WNO_FORMAT_TRUNCATION'): +-- +2.23.0 + + +From 58859a3088a74753b301e48b964edb6d242d245a Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 23 Sep 2019 16:10:35 +0200 +Subject: [PATCH 3/9] pthreadpool: Only link pthreadpool against librt if we + have to +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This calls clock_gettime() which is available in glibc on Linux. If the +wscript in libreplace detected that librt is needed for clock_gettime() +we have to link against it. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 + +Signed-off-by: Andreas Schneider +Signed-off-by: Isaac Boukris +Pair-Programmed-With: Isaac Boukris +Reviewed-by: Matthias Dieter Wallnöfer +Reviewed-by: Alexander Bokovoy +(cherry picked from commit 4b28239d13b17e42eb5aa4b405342f46347f3de4) +--- + lib/pthreadpool/wscript_build | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/lib/pthreadpool/wscript_build b/lib/pthreadpool/wscript_build +index 57df25548b1..70aa7cbf041 100644 +--- a/lib/pthreadpool/wscript_build ++++ b/lib/pthreadpool/wscript_build +@@ -1,12 +1,17 @@ + #!/usr/bin/env python + + if bld.env.WITH_PTHREADPOOL: ++ extra_libs='' ++ ++ # Link to librt if needed for clock_gettime() ++ if bld.CONFIG_SET('HAVE_LIBRT'): extra_libs += ' rt' ++ + bld.SAMBA_SUBSYSTEM('PTHREADPOOL', + source='''pthreadpool.c + pthreadpool_pipe.c + pthreadpool_tevent.c + ''', +- deps='pthread rt replace tevent-util') ++ deps='pthread replace tevent-util' + extra_libs) + else: + bld.SAMBA_SUBSYSTEM('PTHREADPOOL', + source='''pthreadpool_sync.c +-- +2.23.0 + + +From 8a268f3af434d409dcd84db5fef10d6943266b75 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 23 Sep 2019 17:04:57 +0200 +Subject: [PATCH 4/9] third_party: Only link cmocka against librt if really + needed +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +cmocka also uses clock_gettime(). + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 + +Signed-off-by: Andreas Schneider +Signed-off-by: Isaac Boukris +Pair-Programmed-With: Isaac Boukris +Reviewed-by: Matthias Dieter Wallnöfer +Reviewed-by: Alexander Bokovoy +(cherry picked from commit 36e8d715bc8dc1e8466f5a5c9798df76310b7572) +--- + third_party/cmocka/wscript | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/third_party/cmocka/wscript b/third_party/cmocka/wscript +index 9ebdd7cfbe9..3c2ad50801a 100644 +--- a/third_party/cmocka/wscript ++++ b/third_party/cmocka/wscript +@@ -12,8 +12,13 @@ def build(bld): + if bld.CONFIG_SET('USING_SYSTEM_CMOCKA'): + return + ++ extra_libs='' ++ ++ # Link to librt if needed for clock_gettime() ++ if bld.CONFIG_SET('HAVE_LIBRT'): extra_libs += ' rt' ++ + bld.SAMBA_LIBRARY('cmocka', + source='cmocka.c', +- deps='rt', ++ deps=extra_libs, + allow_warnings=True, + private_library=True) +-- +2.23.0 + + +From 3b3d2606fefb98a9a27626f1ddfdabdf22992a9e Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 23 Sep 2019 17:39:29 +0200 +Subject: [PATCH 5/9] third_party: Link nss_wrapper against pthread +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +nss_wrapper uses pthread_atfork() which is only provided by libpthread. +So we need an explicit dependency. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 + +Signed-off-by: Andreas Schneider +Signed-off-by: Isaac Boukris +Pair-Programmed-With: Isaac Boukris +Reviewed-by: Matthias Dieter Wallnöfer +Reviewed-by: Alexander Bokovoy +(cherry picked from commit 68d8a02ef57cce29e4ff3ef1b792adfc10d0b916) +--- + third_party/nss_wrapper/wscript | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/third_party/nss_wrapper/wscript b/third_party/nss_wrapper/wscript +index 2e9d1db13b1..40848603b36 100644 +--- a/third_party/nss_wrapper/wscript ++++ b/third_party/nss_wrapper/wscript +@@ -89,6 +89,6 @@ def build(bld): + # breaks preloading! + bld.SAMBA_LIBRARY('nss_wrapper', + source='nss_wrapper.c', +- deps='dl', ++ deps='dl pthread', + install=False, + realname='libnss-wrapper.so') +-- +2.23.0 + + +From 2f27ac30a8d75b09f3ac9ac32d3a0e23d3d48581 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 23 Sep 2019 17:40:13 +0200 +Subject: [PATCH 6/9] third_party: Link uid_wrapper against pthread +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +uid_wrapper uses pthread_atfork() which is only provided by libpthread. │···················· +So we need an explicit dependency. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 + +Signed-off-by: Andreas Schneider +Signed-off-by: Isaac Boukris +Pair-Programmed-With: Isaac Boukris +Reviewed-by: Matthias Dieter Wallnöfer +Reviewed-by: Alexander Bokovoy +(cherry picked from commit bd0cd8e13234d684da77a65f6fdaea2572625369) +--- + third_party/uid_wrapper/wscript | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/third_party/uid_wrapper/wscript b/third_party/uid_wrapper/wscript +index 61d8a189625..738343f49e4 100644 +--- a/third_party/uid_wrapper/wscript ++++ b/third_party/uid_wrapper/wscript +@@ -119,6 +119,6 @@ def build(bld): + # breaks preloading! + bld.SAMBA_LIBRARY('uid_wrapper', + source='uid_wrapper.c', +- deps='dl', ++ deps='dl pthread', + install=False, + realname='libuid-wrapper.so') +-- +2.23.0 + + +From bf1b1e4b85c516a480c5a29a98a8761870a59735 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 23 Sep 2019 16:53:12 +0200 +Subject: [PATCH 7/9] waf:replace: Do not link against libpthread if not + necessary +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On Linux we should avoid linking everything against libpthread. Symbols +used my most application are provided by glibc and code which deals with +threads has to explicitly link against libpthread. This avoids setting +LDFLAGS=-pthread globally. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 + +Signed-off-by: Andreas Schneider +Signed-off-by: Isaac Boukris +Pair-Programmed-With: Isaac Boukris +Reviewed-by: Matthias Dieter Wallnöfer +Reviewed-by: Alexander Bokovoy +(cherry picked from commit 9499db075b72b147e2ff9bb78e9d5edbaac14e69) +--- + lib/replace/wscript | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/lib/replace/wscript b/lib/replace/wscript +index d8423b1d281..b5919835c0b 100644 +--- a/lib/replace/wscript ++++ b/lib/replace/wscript +@@ -551,6 +551,11 @@ def configure(conf): + PTHREAD_CFLAGS='error' + PTHREAD_LDFLAGS='error' + ++ if PTHREAD_LDFLAGS == 'error': ++ # Check if pthread_attr_init() is provided by libc first! ++ if conf.CHECK_FUNCS('pthread_attr_init'): ++ PTHREAD_CFLAGS='-D_REENTRANT' ++ PTHREAD_LDFLAGS='' + if PTHREAD_LDFLAGS == 'error': + if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthread'): + PTHREAD_CFLAGS='-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS' +@@ -563,10 +568,7 @@ def configure(conf): + if conf.CHECK_FUNCS_IN('pthread_attr_init', 'c_r'): + PTHREAD_CFLAGS='-D_THREAD_SAFE -pthread' + PTHREAD_LDFLAGS='-pthread' +- if PTHREAD_LDFLAGS == 'error': +- if conf.CHECK_FUNCS('pthread_attr_init'): +- PTHREAD_CFLAGS='-D_REENTRANT' +- PTHREAD_LDFLAGS='-lpthread' ++ + # especially for HP-UX, where the CHECK_FUNC macro fails to test for + # pthread_attr_init. On pthread_mutex_lock it works there... + if PTHREAD_LDFLAGS == 'error': +-- +2.23.0 + + +From cce4834d7aacf69975bc5acf24c66e3a2913f231 Mon Sep 17 00:00:00 2001 +From: Isaac Boukris +Date: Tue, 15 Oct 2019 13:52:42 +0300 +Subject: [PATCH 8/9] nsswitch: Link stress-nss-libwbclient against pthread + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 + +Signed-off-by: Isaac Boukris +Reviewed-by: Andreas Schneider +Reviewed-by: Alexander Bokovoy +(cherry picked from commit d473f1e38c2822746030516269b4d70032cf9b2e) +--- + nsswitch/wscript_build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build +index 6acc4a19b9b..861ed2f23bf 100644 +--- a/nsswitch/wscript_build ++++ b/nsswitch/wscript_build +@@ -20,7 +20,7 @@ bld.SAMBA_BINARY('nsstest', + if bld.CONFIG_SET('HAVE_PTHREAD'): + bld.SAMBA_BINARY('stress-nss-libwbclient', + source='stress-nss-libwbclient.c', +- deps='wbclient', ++ deps='wbclient pthread', + install=False + ) + +-- +2.23.0 + + +From d3609fef9b4e7ac76d4dfe2f387e89e3a79749c6 Mon Sep 17 00:00:00 2001 +From: Isaac Boukris +Date: Tue, 15 Oct 2019 17:01:48 +0300 +Subject: [PATCH 9/9] s3:libsmb: Link libsmb against pthread + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 + +Signed-off-by: Isaac Boukris +Reviewed-by: Andreas Schneider +Reviewed-by: Alexander Bokovoy +(cherry picked from commit 7259197bf716f8b81dea74beefe6ee3b1239f172) +--- + source3/libsmb/wscript | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/source3/libsmb/wscript b/source3/libsmb/wscript +index d9e933e9e9f..febff9df7fc 100644 +--- a/source3/libsmb/wscript ++++ b/source3/libsmb/wscript +@@ -16,6 +16,7 @@ def build(bld): + libsmb_xattr.c + libsmb_setget.c''', + public_deps=''' ++ pthread + talloc + smbconf + libsmb +-- +2.23.0 + diff --git a/SOURCES/samba-4.10-fix_linking_nsl_socket.patch b/SOURCES/samba-4.10-fix_linking_nsl_socket.patch new file mode 100644 index 0000000..e21e9cc --- /dev/null +++ b/SOURCES/samba-4.10-fix_linking_nsl_socket.patch @@ -0,0 +1,82 @@ +From 8f500a77df4a3e38f19ec5aad6f6dc62f608fffc Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 21 Oct 2019 17:08:08 +0200 +Subject: [PATCH] replace: Only link libnsl and libsocket if requrired + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14168 + +Signed-off-by: Andreas Schneider +Reviewed-by: Alexander Bokovoy + +Autobuild-User(master): Andreas Schneider +Autobuild-Date(master): Wed Oct 23 08:23:13 UTC 2019 on sn-devel-184 + +(cherry picked from commit 263bec1b8d0744da73dd92e4a361fb7430289ab3) +--- + lib/replace/wscript | 36 +++++++++++++++++++++++++++++++----- + 1 file changed, 31 insertions(+), 5 deletions(-) + +diff --git a/lib/replace/wscript b/lib/replace/wscript +index b5919835c0b..0ebeb36944f 100644 +--- a/lib/replace/wscript ++++ b/lib/replace/wscript +@@ -190,10 +190,35 @@ def configure(conf): + conf.CHECK_TYPE_IN('sig_atomic_t', 'signal.h', define='HAVE_SIG_ATOMIC_T_TYPE') + conf.CHECK_FUNCS('sigsetmask siggetmask sigprocmask sigblock sigaction sigset') + +- conf.CHECK_FUNCS_IN('''inet_ntoa inet_aton inet_ntop inet_pton connect gethostbyname +- getaddrinfo getnameinfo freeaddrinfo gai_strerror socketpair''', +- 'socket nsl', checklibc=True, +- headers='sys/socket.h netinet/in.h arpa/inet.h netdb.h') ++ # Those functions are normally available in libc ++ if not conf.CHECK_FUNCS(''' ++ inet_ntoa ++ inet_aton ++ inet_ntop ++ inet_pton ++ connect ++ gethostbyname ++ getaddrinfo ++ getnameinfo ++ freeaddrinfo ++ gai_strerror ++ socketpair''', ++ headers='sys/socket.h netinet/in.h arpa/inet.h netdb.h'): ++ conf.CHECK_FUNCS_IN(''' ++ inet_ntoa ++ inet_aton ++ inet_ntop ++ inet_pton ++ connect ++ gethostbyname ++ getaddrinfo ++ getnameinfo ++ freeaddrinfo ++ gai_strerror ++ socketpair''', ++ 'socket nsl', ++ headers='sys/socket.h netinet/in.h arpa/inet.h netdb.h') ++ conf.DEFINE('REPLACE_REQUIRES_LIBSOCKET_LIBNSL', 1) + + conf.CHECK_FUNCS('memset_s memset_explicit') + +@@ -835,6 +860,7 @@ def build(bld): + extra_libs = '' + if bld.CONFIG_SET('HAVE_LIBBSD'): extra_libs += ' bsd' + if bld.CONFIG_SET('HAVE_LIBRT'): extra_libs += ' rt' ++ if bld.CONFIG_SET('REPLACE_REQUIRES_LIBSOCKET_LIBNSL'): extra_libs += ' socket nsl' + + bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC', + REPLACE_HOSTCC_SOURCE, +@@ -875,7 +901,7 @@ def build(bld): + # at the moment: + # hide_symbols=bld.BUILTIN_LIBRARY('replace'), + private_library=True, +- deps='crypt dl nsl socket attr' + extra_libs) ++ deps='crypt dl attr' + extra_libs) + + replace_test_cflags = '' + if bld.CONFIG_SET('HAVE_WNO_FORMAT_TRUNCATION'): +-- +2.23.0 + diff --git a/SOURCES/samba-4.10-fix_smbspool_device_uri.patch b/SOURCES/samba-4.10-fix_smbspool_device_uri.patch new file mode 100644 index 0000000..d72091e --- /dev/null +++ b/SOURCES/samba-4.10-fix_smbspool_device_uri.patch @@ -0,0 +1,52 @@ +From 24aa04cee5ce3cdab1fd3cf970e285dbd065305e Mon Sep 17 00:00:00 2001 +From: Bryan Mason +Date: Mon, 16 Sep 2019 12:35:06 -0700 +Subject: [PATCH] s3:client:Use DEVICE_URI, instead of argv[0],for Device URI + +CUPS sanitizes argv[0] by removing username/password, so use +DEVICE_URI environment variable first. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14128 + +Signed-off-by: Bryan Mason +Reviewed-by: Alexander Bokovoy +Reviewed-by: Andreas Schneider + +Autobuild-User(master): Andreas Schneider +Autobuild-Date(master): Wed Sep 18 12:31:11 UTC 2019 on sn-devel-184 + +(cherry picked from commit d65b17c3f7f9959ed95b03cc09e020d7387b7931) +--- + source3/client/smbspool.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c +index ad988eb0df9..36f7f67ca94 100644 +--- a/source3/client/smbspool.c ++++ b/source3/client/smbspool.c +@@ -256,13 +256,15 @@ main(int argc, /* I - Number of command-line arguments */ + + /* + * Find the URI ... +- */ +- if (dev_uri == NULL) { +- env = getenv("DEVICE_URI"); +- if (env != NULL && env[0] != '\0') { +- dev_uri = env; +- } +- } ++ * ++ * The URI in argv[0] is sanitized to remove username/password, so ++ * use DEVICE_URI if available. Otherwise keep the URI already ++ * discovered in argv. ++ */ ++ env = getenv("DEVICE_URI"); ++ if (env != NULL && env[0] != '\0') { ++ dev_uri = env; ++ } + + if (dev_uri == NULL) { + fprintf(stderr, +-- +2.23.0 + diff --git a/SPECS/samba.spec b/SPECS/samba.spec index 272e322..65b987e 100644 --- a/SPECS/samba.spec +++ b/SPECS/samba.spec @@ -6,7 +6,7 @@ # ctdb is enabled by default, you can disable it with: --without clustering %bcond_without clustering -%define main_release 1 +%define main_release 101 %define samba_version 4.10.4 %define talloc_version 2.1.16 @@ -119,6 +119,11 @@ Source14: samba.pamd Source201: README.downgrade Patch0: samba-4.10-fix_smbspool.patch +Patch1: samba-4.10-avoid_overlinking_with_librt_and_libpthread.patch +Patch2: samba-4.10-Fix_forest_trust_with_additional_attrs.patch +Patch3: samba-4.10-fix_smbspool_device_uri.patch +Patch4: samba-4.10-Remove_shm_get_configure_check.patch +Patch5: samba-4.10-fix_linking_nsl_socket.patch Requires(pre): /usr/sbin/groupadd Requires(post): systemd @@ -864,7 +869,7 @@ export LDFLAGS="%{__global_ldflags} -fuse-ld=gold" --systemd-winbind-extra=%{_systemd_extra} \ --systemd-samba-extra=%{_systemd_extra} -make %{?_smp_mflags} +make %{?_smp_mflags} V=1 %install rm -rf %{buildroot} @@ -3433,6 +3438,14 @@ fi %endif # with_clustering_support %changelog +* Wed Oct 23 2019 Andreas Schneider - 4.10.4-101 +- related: #1760824 - Removed additional issues with overlinking + +* Fri Oct 11 2019 Andreas Schneider - 4.10.4-100 +- resolves: #1760824 - Avoid overlinking with librt and libpthread +- resolves: #1759236 - Fix forest trusts enumeration +- resolves: #1761719 - Fix CUPS username/password authentication with smbspool + * Wed Jun 19 2019 Andreas Schneider - 4.10.4-1 - resolves: #1712378 - Fix smbspool CUPS backend - resolves: #1696612 - Fix 'net ads join -U admin@parentdomain'