summaryrefslogtreecommitdiff
path: root/lib/replace/wscript
AgeCommit message (Collapse)AuthorFilesLines
2020-11-10replace: define BOOL_DEFINED to fix header yp_prot header check on SolarisBjörn Jacke1-0/+1
Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-11-10replace/waf: fix libnsl checking on SolarisBjörn Jacke1-3/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13343 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-09-08lib/replace: move lib/replace/closefrom.c from ROKEN_HOSTCC_SOURCE to ↵Stefan Metzmacher1-0/+3
REPLACE_HOSTCC_SOURCE This is where it really belongs and we avoid the strange interaction with source4/heimdal_build/config.h. This a follow up for commit f31333d40e6fa38daa32a3ebb32d5a317c06fc62. This fixes a build problem if libbsd-dev is not installed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14482 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Sep 8 13:59:58 UTC 2020 on sn-devel-184
2020-08-15lib/util: Standardize use of st_[acm]time nsMatthew DeVore1-2/+0
Commit 810397f89a10, and possibly others, broke the build for macOS and other environments which don't have st_[acm]tim fields on 'struct stat'. Multiple places in the codebase used the config.h values to determine how to access the nanosecond or microsecond values of the stat timestamps, so rather than add more, centralize them all into lib/util/time.c. Also allow pvfs_fileinfo.c to read nanosecond-granularity timestamps on platforms where it didn't before, since its #if branches were not complete. Signed-off-by: Matthew DeVore <matvore@google.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Aug 15 08:51:09 UTC 2020 on sn-devel-184
2020-07-01dsdb: Allow "password hash userPassword schemes = CryptSHA256" to work on RHEL7Andrew Bartlett1-0/+1
On RHEL7 crypt_r() will set errno. This is a problem because the implementation of crypt_r() in RHEL8 and elsewhere in libcrypt will return non-NULL but set errno on failure. The workaround is to use crypt_rn(), provided only by libcrypt, which will return NULL on failure, and so avoid checking errno in the non-failure case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14424 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-02-15lib/replace: remove unused check for aio.hStefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-13build: Only link against libcrypt where neededAndrew Bartlett1-1/+1
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-10-23replace: Only link libnsl and libsocket if requriredAndreas Schneider1-5/+31
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14168 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Oct 23 08:23:13 UTC 2019 on sn-devel-184
2019-10-07replace: Improve sys/sysctl.h check to catch warning on glibc >= 2.30Andreas Schneider1-1/+12
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Oct 7 11:48:24 UTC 2019 on sn-devel-184
2019-10-04lib/replace: Remove libaio supportVolker Lendecke1-1/+1
io_uring is the way to go these days, libaio was never really useful for Samba Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Oct 4 18:18:41 UTC 2019 on sn-devel-184
2019-09-25waf:replace: Do not link against libpthread if not necessaryAndreas Schneider1-4/+6
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 <asn@samba.org> Signed-off-by: Isaac Boukris <iboukris@gmail.com> Pair-Programmed-With: Isaac Boukris <iboukris@gmail.com> Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2019-09-25replace: Only link against librt if really neededAndreas Schneider1-3/+21
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 <asn@samba.org> Signed-off-by: Isaac Boukris <iboukris@gmail.com> Pair-Programmed-With: Isaac Boukris <iboukris@gmail.com> Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2019-09-19replace: Remove crypt() reimplementationAndrew Bartlett1-1/+0
Use of Samba with plaintext authenticaiton is incredibly rare, even more rare is plaintext authentication on systems without a crypt() call and where DES based crypt() would be the right thing to do. Remove this additional cryptographic code per our current efforts to rely entirely on external libraries instead. Similar to the arguments in this thread about zlib discussed on samba-technical here: https://lists.samba.org/archive/samba-technical/2019-May/133476.html Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Sep 19 09:28:21 UTC 2019 on sn-devel-184
2019-09-17build: Remove tests for getdents() and getdirentries()Andrew Bartlett1-1/+1
These date back to 3a9beef2b7b25427ee4611cfc375e05cc82a1150 in 2003 and 829e72fe9c97feaa3d45b768984a4c47b906a23a in 1998 and appear to be related to smbwrapper. More of these should be removed but the getdirents() test caused a timeout on an ARM builder in Debian. It might just be a fluke but the tests are pointless regardless. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Sep 17 13:48:18 UTC 2019 on sn-devel-184
2019-09-17lib/replace/wscript: Avoid generating nested main functionKhem Raj1-0/+1
clang is not happy when it sees another main nested inside the main function and fails the test for prctl syscall, therefore avoid adding implicit main() here Signed-off-by: Khem Raj <raj.khem@gmail.com> Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-09-01Spelling fixes s/convertion/conversion/Mathieu Parent1-1/+1
Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-05-25lib: Only compile resolvconftest if fmemopen existsVolker Lendecke1-0/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13961 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat May 25 00:05:25 UTC 2019 on sn-devel-184
2019-05-06replace: Fix "make test" to actually test libreplaceAndrew Bartlett1-9/+27
Found by Joe Guo during preperation for automated code coverage output. In order to allow the Makefile wrapper to work we need to rename the test directory to tests. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-05-06build: Remove build of replacetortAndrew Bartlett1-5/+4
This is built close to the code it tests in lib/replace/wscript_build as replace_testsuite. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-02-17replace: remove needless vxfs header file checkBjörn Jacke1-1/+1
Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
2019-01-10waf:lib/replace: fix a build error with non-gcc compilersBjörn Jacke1-1/+1
3a175830e579ab10231439657b23733338cd5634 added that variable which should have been an empty initialization here. -Wno-format-zero-length (which might be unsupported by the compiler) should not be set if we really only want to initialize the cflags. Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2018-12-20replace: Add memset_s to replacement functionsAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-30replace: Correctly check for 'extern char **environ' in unistd.hAndreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Nov 30 11:41:44 CET 2018 on sn-devel-144
2018-11-13replace: Add check for variable program_invocation_short_nameMartin Schwenke1-0/+1
It appears that wafsamba's configure() defines _GNU_SOURCE unconditionally, so checking _GNU_SOURCE isn't enough to know if this variable is available. For example, it isn't available on AIX with the xlc compiler: [ 6/10] Compiling lib/replace/replace.c ... "../../lib/replace/replace.c", line 991.16: 1506-045 (S) Undeclared identifier program_invocation_short_name. Instead, add a configure check for program_invocation_short_name and use it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Nov 13 11:11:11 CET 2018 on sn-devel-144
2018-11-12lib:replace: Add getprogname()Andreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-10-16replace: Add memset_s() if not availableAndreas Schneider1-0/+17
See https://en.cppreference.com/w/c/string/byte/memset Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-09-16PY3: fix iteritems usage, not supported in python3Noel Power1-2/+2
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10Revert "lib/replace: force to unset defines if check has failed"Stefan Metzmacher1-2/+1
This reverts commit 8ec7eb0c0129518557d1f446191860a62ef3ff79. There was already a better fix under discusion. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-08lib/replace: force to unset defines if check has failedAlexander Bokovoy1-1/+2
For HAVE_WORKING_STRPTIME and HAVE_INCOHERENT_MMAP we always want to have their defines unset as the code is using '#ifdef' rather than just '#if'. Setting them to 0 means #ifdef will succeed due to a difference how '#ifdef' and '#if' are working. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-07lib/replace/wscript: fix detection of a fallthrough attribute for clangAlexander Bokovoy1-0/+1
clang issues a warning but otherwise allows our test to be compiled and linked. We consider this case a successful pass for a fallthrough attribute detection while it is an error. Turn missing declaration warning into an error so that we actually do not define fallthrough attribute support in case it doesn't really work. Fixes FreeBSD 11.2 with clang. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05lib/replace/wscript: update to handle waf 2.0.4Alexander Bokovoy1-10/+12
Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-07-24lib/replace: also check for valgrind/helgrind.hStefan Metzmacher1-1/+2
This will be used in lib/pthreadpool/pthreadpool_tevent.c in order to avoid extected helgrind/drd warnings. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-07-24replace: add checks for atomic_thread_fence(memory_order_seq_cst) and add ↵Stefan Metzmacher1-1/+18
possible fallbacks This implements a full memory barrier. On ubuntu amd64 with results in an 'mfence' instruction. This is required to syncronization between threads, where there's typically only one write of a memory that should be synced between all threads with the barrier. Much more details can be found here: https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/_005f_005fatomic-Builtins.html#g_t_005f_005fatomic-Builtins https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/_005f_005fsync-Builtins.html#g_t_005f_005fsync-Builtins The main one we use seems to be in C11 via stdatomic.h, the oldest fallback is __sync_synchronize(), which is available since 2005 in gcc. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-07-24lib/replace: check for __thread supportStefan Metzmacher1-0/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-07-04replace: Be strict when checking __attribute__ featuresAmitay Isaacs1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-07-03build: bundle and reduce huge number of EA function testsBjörn Jacke1-29/+18
It's sufficient to check for one basic function of an EA implementation and a use a single ifdef for each group of EA functions. This makes more sense than checking for each EA function on each platform. Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Jul 3 13:24:51 CEST 2018 on sn-devel-144
2018-07-02replace: Add test for sin6_len in sockaddr_in6 structureAmitay Isaacs1-0/+4
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-04-03replace: Check for -Wno-strict-overflowAndreas Schneider1-0/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-20lib:replace: Fix linking when libtirpc-devel overwrites system headersNoel Power1-1/+9
Some systems (like SUSE currently) install the new tirpc headers by overwritting the existing system location used by gcc. This patch will detect if the headers in the system location belong to tirpc or not. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13341 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Mar 20 16:07:05 CET 2018 on sn-devel-144
2018-03-01lib:replace: Add FALL_THROUGH supportAndreas Schneider1-0/+36
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-02-27replace: Only warn if rpc/rpc.h haven't been foundAndreas Schneider1-2/+1
This is also used by talloc, tevent, etc. Those libs don't need or use rpc.h Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Feb 27 03:23:37 CET 2018 on sn-devel-144
2018-01-22waf: Fix NFS quota support with libtirpcAndreas Schneider1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Jan 22 17:26:52 CET 2018 on sn-devel-144
2018-01-22build: deal with recent glibc sunrpc header removalGünther Deschner1-5/+33
We need to rely on libtirpc or libntirpc to be around in that case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238 BUG: https://bugzilla.samba.org/show_bug.cgi?id=10976 Guenther Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-22build: detect availability of -Wno-unused-functionUri Simchoni1-0/+3
Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-10-20replace: Link to -lbsd when building replace.c by handAndrew Bartlett1-3/+9
This ensures that we correctly detect HAVE_IFACE_GETIFADDRS et al, which are based on a "build the source" style test. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13087 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2017-09-26s4:smbd: call setproctitle_initGary Lockyer1-0/+2
Call setproctitle_init() in main which suppresses the "samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor." messages, but more importantly it displays meaningful details in ps output. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9816 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2017-08-24configure: Centralize check for posix_fallocateVolker Lendecke1-0/+12
This checks for posix_fallocate unless we are sitting on an ancient glibc. With this we don't need HAVE_BROKEN_POSIX_FALLOCATE anymore, HAVE_POSIX_FALLOCATE will only be defined if we have a valid [g]libc. ./configure tested on Debian, FreeBSD (which does have posix_fallocate) and OpenBSD (which does not have posix_fallocate). Also tested with changing the not have an old-enough glibc around. All did the right thing. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-23waf:lib/replace: Fix building with older GCC versionsBjörn Baumbach1-1/+7
Using gcc 4.3.2: cc1: error: unrecognized command line option "-Wno-format-truncation" Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-06-13strerror_r: provide XSI-compliant strerror_rGary Lockyer1-0/+7
Provide a XSI-compliant strerror_r on GNU based systems. The default GNU strerror_r is not XSI-compliant, this patch wraps the GNU-specific call in an XSI-compliant wrapper. This reverts 18ed32ce0821d11c0c06d82c07ba1c27b0c2b886 which tried to make Heimdal use roken, rather than libreplace for strerror_r. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-01waf: Do not trhow a format-truncation error for test/snprintf.cAndreas Schneider1-1/+1
This fixes building with GCC 7.1 Error: ../lib/replace/test/testsuite.c:355:6: error: ‘%d’ directive output truncated writing 1 byte into a region of size 0 [-Werror=format-truncation=] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>