summaryrefslogtreecommitdiff
path: root/lib/replace/system
Commit message (Collapse)AuthorAgeFilesLines
* lib/replace: add a replacement for openat2() that returns ENOSYSStefan Metzmacher2022-08-151-0/+35
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* lib:replace: Only include <sys/mount.h> on non-Linux systemsAndreas Schneider2022-08-021-1/+3
| | | | | | | | | | | | | Details at: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132 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 Aug 2 11:05:14 UTC 2022 on sn-devel-184
* Revert "lib:replace: Remove <sys/mount.h> from filesys.h"Andreas Schneider2022-08-021-0/+4
| | | | | | | | | This reverts commit 7a6bd2279897ed389d10f09e5b315a7bca96e7d4. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* lib:replace: Remove <sys/mount.h> from filesys.hAndreas Schneider2022-07-291-4/+0
| | | | | | | | | | | | | | | | You need to be careful if you include <sys/mount.h> or <linux/mount.h> at least since glibc 2.36. Details at: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jul 29 13:08:36 UTC 2022 on sn-devel-184
* lib:replace: Remove NIS supportAndreas Schneider2021-04-221-55/+0
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CI: add samba-no-opathRalph Boehme2020-12-161-0/+4
| | | | | | | Add a job that builds with O_PATH undefined. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ldap_server: fix hurd buildSamuel Thibault2020-08-031-0/+7
| | | | | | | | | | | | There is no hardcoded IOV_MAX iov limitation on GNU/Hurd. We however do not want unbound allocation, so define it to a reasonable amount. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Mon Aug 3 09:39:02 UTC 2020 on sn-devel-184
* lib/replace: prefer <sys/xattr.h> over <attr/xattr.h>Ralph Boehme2019-12-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents the following compile error that may happens if "system/filesys.h" is included before "system/capability.h" on Ubuntu 16.04: [1802/4407] Compiling source3/lib/system.c In file included from ../../lib/replace/system/filesys.h:112:0, from ../../source3/include/vfs.h:29, from ../../source3/include/smb.h:150, from ../../source3/include/includes.h:284, from ../../source3/lib/system.c:23: /usr/include/x86_64-linux-gnu/sys/xattr.h:32:3: error: expected identifier before numeric constant XATTR_CREATE = 1, /* set value, fail if attr already exists. */ ^ The above error is from compiling a source tree which includes a change that adds an include "system/filesys.h" to the top of "source3/include/vfs.h". "source3/lib/system.c" has the following includes: #include "includes.h" #include "system/syslog.h" #include "system/capability.h" #include "system/passwd.h" #include "system/filesys.h" #include "../lib/util/setid.h" The first include of "includes.h" pulls in "vfs.h" which will pull in "system/filesys.h" with the mentioned change. "system/filesys.h" pulls in <attr/xattr.h> which has this define #define XATTR_CREATE 0x1 Later in "source3/lib/system.c" "system/capability.h" is included which includes <sys/xattr.h> on Ubuntu 16.04 (not in later versions of glibc). This defines the XATTR_* values as an enum: enum { XATTR_CREATE = 1, /* set value, fail if attr already exists. */ XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */ }; The previous define of XATTR_CREATE as 1 makes this enum { 1 = 1, /* set value, fail if attr already exists. */ 2 = 2 /* set value, fail if attr does not exist. */ }; which is invalid C. The compiler error diagnostic is a bit confusing, as it prints the original enum from the include file. See also: <https://bugs.freedesktop.org/show_bug.cgi?id=78741> <https://bugs.launchpad.net/ubuntu/+source/attr/+bug/1288091> <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756097> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Björn Baumbach <bb@samba.org>
* lib/replace: work around an API conflict between ncurses and XFS xattr APIRalph Boehme2019-12-121-6/+4
| | | | | | | | | | | | | | | | | | | | | Compile error: [4530/4693] Compiling source3/utils/regedit_list.c In file included from ../../source3/utils/regedit_list.h:24, from ../../source3/utils/regedit_list.c:20: /usr/include/curses.h:611:28: error: conflicting types for ‘attr_get’ 611 | extern NCURSES_EXPORT(int) attr_get (attr_t *, NCURSES_PAIRS_T *, void *); /* generated */ | ^~~~~~~~ compilation terminated due to -Wfatal-errors. Both ncurses and XFS xattr API provide a get_attr() function. As a workaround avoid including <sys|attr/attributes.h> if <attr|sys/xattr.h> is present. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Dec 12 20:22:51 UTC 2019 on sn-devel-184
* replace: ensure UTIME_NOW and UTIME_OMIT are always availableRalph Boehme2019-12-061-0/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7771 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/replace: Remove libaio supportVolker Lendecke2019-10-041-32/+0
| | | | | | | | | | | 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
* lib/replace: Remove #undef TCP_NODELAYAndrew Bartlett2019-06-181-28/+0
| | | | | | | | | | | | | | | | | | | | | A duplicate define warning is better than not defining this at all. Similar to a patch Torsten Werner submitted to the Samba Bugzilla in 2005. Not tested on HP-UX reverts fc84e916f628b4fb6f6667ad45d0ced0e9134b23 that was still present in the new copy of nis.h created in c29d087e1ea4c92717ef86e372fe80f410580fdc BUG: https://bugzilla.samba.org/show_bug.cgi?id=2406 BUG: https://bugzilla.samba.org/show_bug.cgi?id=2140 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 Jun 18 06:47:05 UTC 2019 on sn-devel-184
* replace: remove needless vxfs header file checkBjörn Jacke2019-02-171-8/+0
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* replace: only include <sys/capability.h> with HAVE_POSIX_CAPABILITIESStefan Metzmacher2019-01-291-0/+2
| | | | | | | | | On FreeBSD <sys/capability.h> is a legacy wrapper to <sys/capsicum.h>, which implements something different. With FreeBSD 12 including <sys/capability.h> generates a compiler warning/error. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* replace: Fix checking for config.h #define in gssapi.hAndreas Schneider2018-12-161-4/+4
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* replace: Fix checking for config.h #define in readline.hAndreas Schneider2018-12-161-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* replace: Use #ifdef instead of #if for config.h definitionsAndreas Schneider2018-11-284-10/+10
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* replace: add checks for atomic_thread_fence(memory_order_seq_cst) and add ↵Stefan Metzmacher2018-07-241-0/+27
| | | | | | | | | | | | | | | | | | | | | | 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>
* build: bundle and reduce huge number of EA function testsBjörn Jacke2018-07-031-23/+4
| | | | | | | | | | | | 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
* replace: remove some duplicate checksBjörn Jacke2018-02-211-8/+0
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* include: Create system/nis.h in libreplaceAndreas Schneider2018-01-221-0/+83
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238 Pair-Programmed-With: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* lib/replace: apply readline -Wstrict-prototypes workaroundUri Simchoni2017-11-241-0/+3
| | | | | | | | | | | | | | clang -Wstrict-prototypes has issues with readline > 6.3. Fix suggested by Timur I. Bakeyev <timur@freebsd.org> cf. https://lists.gnu.org/archive/html/bug-readline/2014-04/msg00018.html cf. https://lists.samba.org/archive/samba-technical/2017-November/123923.html Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Nov 24 05:16:10 CET 2017 on sn-devel-144
* libbreplace: compatibility fix for AIXGuillaume Xavier Taillon2017-06-131-1/+9
| | | | | | | | | | | | | | Adds macros for preprocessor compares and replaces an incomptatible compare with one of the new macros. This fixes a comptability bug on AIX. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11621 Signed-off-by: Guillaume Xavier Taillon <gtaillon@ca.ibm.com> Reviewed-by: Björn Jacke <bjacke@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Tue Jun 13 09:11:56 CEST 2017 on sn-devel-144
* replace: make sure we have a SCOPE_DELIMITER defineBjörn Jacke2016-12-091-0/+4
| | | | | Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* replace: Include libgen.h if availableAmitay Isaacs2016-12-011-0/+4
| | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Dec 1 18:08:54 CET 2016 on sn-devel-144
* lib:replace: Missing semicolon on function definition.Jeremy Allison2016-04-021-1/+1
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Sat Apr 2 06:04:13 CEST 2016 on sn-devel-144
* lib/replace: fix PTHREAD_MUTEX_ROBUST fallback to PTHREAD_MUTEX_ROBUST_NP on ↵Stefan Metzmacher2015-06-121-6/+3
| | | | | | | | | | | | | | | | | | | | | | solaris 11 Without this we got the following defines in config.h: #define HAVE_DECL_PTHREAD_MUTEXATTR_SETROBUST_NP 1 #define HAVE_DECL_PTHREAD_MUTEX_CONSISTENT_NP 1 #define HAVE_PTHREAD_MUTEXATTR_SETROBUST 1 #define HAVE_PTHREAD_MUTEX_CONSISTENT 1 #define HAVE_ROBUST_MUTEXES 1 #define USE_TDB_MUTEX_LOCKING 1 And the build failed with PTHREAD_MUTEX_ROBUST being unknown. Note that PTHREAD_MUTEX_ROBUST and PTHREAD_MUTEX_ROBUST_NP are enum values while they're defines on solaris 11 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11319 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* Add Solaris ports as a tevent backend.Jeremy Allison2015-02-151-0/+4
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Sun Feb 15 23:25:07 CET 2015 on sn-devel-104
* replace: Fix includes of unistd.hMartin Schwenke2014-09-193-4/+9
| | | | | | | | This should always be conditional. system/passwd.h wants it too so that uid_t is defined. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* 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: Add support for pthread_mutex_consistentVolker Lendecke2014-05-221-0/+5
| | | | | | 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-221-0/+35
| | | | | | 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-171-9/+0
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Remove special nss_wrapper codeAndreas Schneider2014-04-171-12/+0
| | | | | 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>
* 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>
* build: Remove autoconf build systemAndrew Bartlett2013-05-281-145/+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: 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>
* replace: Remove deprecated getpass() support.Andreas Schneider2012-12-031-11/+0
| | | | Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* attr: Look for attr/attributes.h too.Jelmer Vernooij2012-06-161-0/+2
| | | | | | | Fixes finding of ATTR_ROOT on GNU/kFreeBSD. Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Sat Jun 16 18:54:27 CEST 2012 on sn-devel-104
* librepace: put #defines after #include "sys/xattr.h"Andrew Bartlett2012-06-031-0/+8
| | | | | | | | | This avoids redefining the system xattr functions, which should fix MacOS. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sun Jun 3 09:46:44 CEST 2012 on sn-devel-104
* lib/replace: Merge remaining xattr test details from lib/utilAndrew Bartlett2012-06-021-8/+8
| | | | | | | I prefer the longer XATTR_ADDITIONAL_OPTIONS define and the NULL rather than 0 values in the getxattr test. Andrew Bartlett
* lib/replace: xattr wrappers in lib/replace rather than source3/lib/system.cAndrew Bartlett2012-06-021-0/+56
| | | | | | | This also moves all the still-used configure tests etc. The unused OSF API is also removed at this time. Andrew Bartlett
* Introduce system MIT krb5 build with --with-system-mitkrb5 option.Alexander Bokovoy2012-05-231-1/+1
| | | | | | | | | | | | | | | | | System MIT krb5 build also enabled by specifying --without-ad-dc When --with-system-mitkrb5 (or --withou-ad-dc) option is passed to top level configure in WAF build we are trying to detect and use system-wide MIT krb5 libraries. As result, Samba 4 DC functionality will be disabled due to the fact that it is currently impossible to implement embedded KDC server with MIT krb5. Thus, --with-system-mitkrb5/--without-ad-dc build will only produce * Samba 4 client libraries and their Python bindings * Samba 3 server (smbd, nmbd, winbindd from source3/) * Samba 3 client libraries In addition, Samba 4 DC server-specific tests will not be compiled into smbtorture. This in particular affects spoolss_win, spoolss_notify, and remote_pac rpc tests.
* lib/replace: split out GSSAPI from lib/replace/system/kerberos.h into ↵Alexander Bokovoy2012-04-252-16/+55
| | | | | | | | | | | | | | lib/replace/system/gssapi.h With waf build include directories are defined by dependencies specified to subsystems. Without proper dependency <gssapi/gssapi.h> cannot be found for embedded Heimdal builds when there are no system-wide gssapi/gssapi.h available. Split out GSSAPI header includes in a separate replacement header and use that explicitly where needed. Autobuild-User: Alexander Bokovoy <ab@samba.org> Autobuild-Date: Wed Apr 25 00:18:33 CEST 2012 on sn-devel-104
* replace: added ENOATTR define if undefinedAndrew Tridgell2012-04-181-0/+8
| | | | | | | this fixes the build of the tdb xattr wrapper code on systems without xattr headers Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* Fix bug #8729 - getpass regressions on Solaris/Illumos - 3.6 and master.Ira Cooper2012-01-311-0/+2
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Jan 31 23:28:09 CET 2012 on sn-devel-104
* replace: Add don't include unistd.h directly and add uid_wrapper.Andreas Schneider2011-10-272-0/+24
|
* Include uid_wrapper correctly.Andreas Schneider2011-10-271-0/+11
|
* lib/replace: include <sys/uio.h> in "system/filesys.h" in order to have ↵Stefan Metzmacher2011-09-081-0/+4
| | | | | | | | struct iovec This is needed on some platforms, e.g. NetBSD5. metze