summaryrefslogtreecommitdiffstats
path: root/lib/replace
Commit message (Collapse)AuthorAgeFilesLines
* lib: tevent: make TEVENT_SIG_INCREMENT atomic.Jeremy Allison2014-06-072-0/+30
| | | | | | | | | | | | | | | | | | | | | | | On arm platforms incrementing a variable is not an atomic operation, so may be interrupted by signal processing (if a signal interrupts another signal handler). Use compiler built-ins to make this atomic. __sync_fetch_and_add() works on gcc, llvm, IBM xlC on AIX, and Intel icc (10.1 and above). atomic_add_32() works on Oracle Solaris. Based on an inital patch from kamei@osstech.co.jp. Bug #10640 - smbd is not responding - tevent_common_signal_handler() increments non-atomic variables https://bugzilla.samba.org/show_bug.cgi?id=10640 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* libreplace: Define PTHREAD_MUTEX_ROBUST along with pthread_mutexattr_setrobustVolker Lendecke2014-05-221-0/+8
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libreplace-waf: Only check for _np functions if standard functions are not ↵Volker Lendecke2014-05-221-8/+14
| | | | | | | | available Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libreplace: Add support for pthread_mutex_consistentVolker Lendecke2014-05-222-2/+17
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libreplace: Add support for pthread_mutexattr_setrobustVolker Lendecke2014-05-222-0/+49
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libreplace: only add PTHREAD CFLAGS and LDFLAGS globally if asked forStefan Metzmacher2014-05-221-2/+3
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libreplace: Move thread checks from source3/wscriptVolker Lendecke2014-05-221-0/+32
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Remove special socket_wrapper code.Andreas Schneider2014-04-173-13/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* replace: Add socket_wrapper_enabled().Andreas Schneider2014-04-172-0/+6
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Remove special nss_wrapper codeAndreas Schneider2014-04-172-13/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* replace: Add nss_wrapper_hosts_enabled().Andreas Schneider2014-04-172-0/+6
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* replace: Add nss_wrapper_enabled().Andreas Schneider2014-04-172-0/+6
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Remove uid_wrapper related code.Andreas Schneider2014-04-171-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib: Change uid_wrapper to preloadable version.Andreas Schneider2014-04-173-33/+0
| | | | | | | This imports version 1.0.1 of uid_wrapper. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* replace: Add uid_wrapper_enabled().Andreas Schneider2014-04-173-0/+34
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* auth: Remove plaintext OSF1 password supportAndrew Bartlett2014-04-151-3/+0
| | | | | | | | The WAF build does not have the code to detect getprpwnam on which this is based, and so this is dead code. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* waf:lib/replace fix iconv checks on HP/UXChristian Ambach2014-02-131-1/+1
| | | | | | | | | | | | | | | | | we need to copy away the list of LDFLAGS to be tried before modifying it instead of just creating a new reference and then continuing with a modified list while it should have been reset back to the original value Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Feb 13 02:01:03 CET 2014 on sn-devel-104
* libreplace: free() deals fine with NULL pointersVolker Lendecke2014-01-241-6/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* waf:lib/replace gettext configure checksChristian Ambach2014-01-171-0/+9
| | | | | | | | | | | | | Make sure we only try to work with gettext if we found the prototypes and were able to link Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Fri Jan 17 19:30:33 CET 2014 on sn-devel-104
* waf:lib/replace fix gettext detectionChristian Ambach2014-01-031-0/+7
| | | | | | | | | | if the user has specified a path for gettext, add it to CFLAGS and LDFLAGS so we can find it during configure and build Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* waf:lib/replace change detection of gettextChristian Ambach2014-01-031-4/+5
| | | | | | | | | | | | convert this to an automatic check: if no option is given, try to find gettext and if found, use it if user has specified --with-gettext, then bail out if it could not be found in case of --without-gettext, skip all gettext related configure checks Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* waf:lib/replace fix up libintl related checksChristian Ambach2014-01-031-0/+1
| | | | | | | | | | | | on a default installation of AIX, libintl.a exists but libintl.h does not So check for the declarations of those functions as well to make sure that the build works. Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* waf:lib/replace correct detection of libiconvChristian Ambach2014-01-031-1/+1
| | | | | | | | | | add -liconv as a complete command line argument, not all characters on their own Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* waf: Fix the FreeBSD build with libinotifyVolker Lendecke2014-01-061-1/+5
| | | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jan 6 19:50:22 CET 2014 on sn-devel-104
* lib/replace remove orphaned codeChristian Ambach2013-12-042-349/+0
| | | | | | | | | | this is not compiled and used anymore Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Wed Dec 4 22:55:12 CET 2013 on sn-devel-104
* replace: fix typo in variable nameDavid Disseldorp2013-11-281-1/+1
| | | | | | | | | | | 13550a2b5eed57084a5d9671d9493a9a2e08d7e3 added a typo causing compilation failure. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Thu Nov 28 18:16:27 CET 2013 on sn-devel-104
* replace: Don't run over dst in strlcatVolker Lendecke2013-11-281-1/+1
| | | | | | | | | If "d" is not 0-terminated, the pure strlen will read beyond the end of the given bufsize. strlcat in libbsd deliberately avoids this, so we should do the same. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* replace: Fix developer build on BSD.Andreas Schneider2013-11-211-0/+1
| | | | | | | | | | This fixes bsd_attr_list() calling geteuid(). Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Nov 21 03:37:59 CET 2013 on sn-devel-104
* xattr: fix listing EAs on *BSD for non-root usersBjörn Jacke2013-11-081-0/+4
| | | | | | | | | | | | Thanks to Stefan Rompf for reporting. This fixes bug #10247 Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Nov 8 20:43:30 CET 2013 on sn-devel-104
* waf: consolidate libintl related checksChristian Ambach2013-08-091-10/+36
| | | | | | | | | | | | | | consolidate the dealing with functions from libintl and the handling of checking if libiconv is required or not to a common place in lib/replace also add a new samba_intl subsystem that has dependencies on the appropriate set of libraries (libintl, libintl+libiconv or none) that can be used as a general dependency by code that depends on the internationalization libraries Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix bug 10025 - Lack of Sanity Checking in calls to malloc()/calloc().Bill Parker2013-07-171-0/+29
| | | | | | | | | | | | | In reviewing various files in Samba-4.0.7, I found a number of instances where malloc()/calloc() were called without the checking the return value for a value of NULL, which would indicate failure. (NB. The changes needed to ccan, iniparser, popt and heimdal will be reported upstream, not patched inside Samba). Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Source <idra@samba.org>
* Bug 8997: change libreplace GPL source to LGPLDavid Disseldorp2013-06-033-31/+43
| | | | | | | | | | | | | | | | | | | | | | | | libreplace currently includes socket.c and getifaddrs.c both of which are GPL licensed. Although not required, talloc and tdb build alongside this source, leading to some ambiguity regarding their LGPL licences. The following copyright holders have agreed to the GPL->LGPL change: lib/replace/getifaddrs.c Copyright (C) Andrew Tridgell 1998 Copyright (C) Jeremy Allison 2007 Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007 lib/replace/test/getifaddrs.c lib/replace/socket.c * Copyright (C) Michael Adam <obnox@samba.org> 2008 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Jun 3 18:06:18 CEST 2013 on sn-devel-104
* build: Remove autoconf build systemAndrew Bartlett2013-05-2812-2174/+0
| | | | | | | | | | | We are now confident that that waf build system meets enough of our needs that we will work to improve it, rather than maintain two build systems. Andrew Bartlett Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* lib/replace: Remove unused install-shAndrew Bartlett2013-05-271-238/+0
| | | | | | | Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon May 27 05:51:04 CEST 2013 on sn-devel-104
* lib/replace: Set BROKEN_STRNLEN and BROKEN_STRNDUP on all AIXAndrew Bartlett2013-05-231-0/+13
| | | | | | | | | | | The background is in https://bugzilla.samba.org/show_bug.cgi?id=1097 and wider reports are at http://stackoverflow.com/questions/2091460/strndup-call-is-currupting-stack-frames Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 23 03:52:10 CEST 2013 on sn-devel-104
* waf: only use -fstack-protector when both compiler and linker support itChristian Ambach2013-05-171-1/+1
| | | | | | | | otherwise build with xlc on AIX fails because the compiler silently ignores the parameter but the linker does not like it Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/replace: add SCNx macrosChristian Ambach2013-05-061-0/+39
| | | | | | | we already have PRI*, but the corresponding SCN* were missing Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib/replace: prefer inttypes.h over stdint.hChristian Ambach2013-05-061-4/+4
| | | | | | | | | according to C99 7.8, inttypes.h should include stdint.h so prefer inttypes.h and fall back to stdint.h (and our own definitions of PRI*) only when inttypes.h could not be found Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* waf: add -fstack-protector to LDFLAGS if detected.Ira Cooper2013-03-061-0/+1
| | | | | | | | | | If we compile with -fstack-protector, we should link with it. Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Mar 6 04:06:04 CET 2013 on sn-devel-104
* waf: Correctly check for prctl in just one place.Andreas Schneider2013-03-051-1/+14
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* lib/replace: add AC_CHECK_VALUEOF() macroStefan Metzmacher2013-03-011-0/+15
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* build: use -fstack-protector if availableBjörn Jacke2013-02-221-0/+3
| | | | | | | | Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Matthieu Patou <mat@samba.org> Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Fri Feb 22 15:38:21 CET 2013 on sn-devel-104
* Revert "wafbuild: use -Wstack-protector if available"Björn Jacke2013-02-221-3/+0
| | | | | | | This reverts commit e6643fbf48afccd0acedb65fbe24d3ce84d44c40. Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Matthieu Patou <mat@samba.org>
* heimdal_build: Try again to sort out the strerror_r messAndrew Bartlett2013-01-192-2/+3
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* build(waf)-libreplace: remove redundant check for flistea functionBjörn Baumbach2013-01-151-1/+1
| | | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* lib/replace: Include sys/ucontext.h if available.Jeremy Allison2013-01-151-0/+4
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/replace: Add ucontext configure autoconf checks.Jeremy Allison2013-01-151-0/+13
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/replace: Add ucontext configure waf checks.Jeremy Allison2013-01-151-1/+10
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/replace: Add missing check for sys/wait.hJeremy Allison2013-01-151-1/+1
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Fix bug 9548: Correctly detect O_DIRECTVolker Lendecke2013-01-142-11/+21
| | | | | | | Reviewed by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Jan 14 21:16:23 CET 2013 on sn-devel-104