summaryrefslogtreecommitdiff
path: root/lib/replace/replace.h
AgeCommit message (Collapse)AuthorFilesLines
2020-10-16replace: also use portable __has_attribute macro to check for "deprecated" ↵Björn Jacke1-1/+1
attribute BUG: https://bugzilla.samba.org/show_bug.cgi?id=14526 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-05-24replace, attr.: use function attributes only if supported by feature macro ↵Björn Jacke1-1/+6
(or old gcc) BUG: https://bugzilla.samba.org/show_bug.cgi?id=12296 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-03-26lib: Add macro ARRAY_DEL_ELEMENT()Volker Lendecke1-0/+6
Every time I have to remove an element from within an array I have to scratch my head about the memmove arguments. Make this easier to use. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-02-27Undef ARRAY_SIZE, if defined, before define to avoid compilation warningsPeter Eriksson1-0/+3
Signed-off-by: Peter Eriksson <pen@lysator.liu.se> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Gary Lockyer <<gary@catalyst.net.nz> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Feb 27 21:43:29 UTC 2020 on sn-devel-184
2019-09-19replace: Remove crypt() reimplementationAndrew Bartlett1-5/+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-04-30replace: Add ZERO_ARRAY_LEN() macroAndreas Schneider1-0/+5
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-04-26Revert "lib/replace: define NAME_MAX for platforms that don't have it"Günther Deschner1-4/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13872 This reverts commit e3c894fb6b87df8aa56e29ef3b16ae1ef456a875. Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Fri Apr 26 13:03:05 UTC 2019 on sn-devel-184
2019-04-16lib/replace: define NAME_MAX for platforms that don't have itGünther Deschner1-0/+4
This allows the vfs_glusterfs_fuse build to complete on AIX. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13872 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Apr 16 15:14:50 UTC 2019 on sn-devel-144
2019-01-29wafsamba/replace: move __STDC_WANT_LIB_EXT1__ to CFLAGSStefan Metzmacher1-2/+8
This fixes the build of python bindings, which use memset_s() (via ZERO_STRUCT). In python bindings Python.h needs to be the first header, which means is already includes string.h. Defining __STDC_WANT_LIB_EXT1__ in replace.h is too late in that case. This fixes the --check-c-compiler=gcc --picky-developer on FreeBSD 12. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-12-20replace: Use memset_s for ZERO_* macrosAndreas Schneider1-4/+8
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-20replace: Cleanup comments for ZERO_*Andreas Schneider1-11/+13
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-16replace: Fix checking for config.h #define in replace.hAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-11-30replace: Correctly check for 'extern char **environ' in unistd.hAndreas Schneider1-9/+11
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-28s3: Remove unsused MMAP_BLACKLIST ifdef checksAndreas Schneider1-4/+0
This doesn't get defined by anything. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-11-28lib:replace: Check if HAVE_DECL_ENVIRON is defined firstAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-11-12lib:replace: Add getprogname()Andreas Schneider1-0/+5
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/+8
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-04-03lib/replace: define __[u]intptr_t_defined if we prove an replacementStefan Metzmacher1-0/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13344 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org>
2018-03-01lib:replace: Add FALL_THROUGH supportAndreas Schneider1-0/+9
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-09-26s4:smbd: call setproctitle_initGary Lockyer1-0/+4
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-06-13strerror_r: provide XSI-compliant strerror_rGary Lockyer1-1/+1
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-01-08replace: Include sysmacros.hAndreas Schneider1-0/+4
In the GNU C Library, "makedev" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but it is planned to remove this soon. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sun Jan 8 22:30:03 CET 2017 on sn-devel-144
2016-06-13libreplace: Add a closefrom() implementationVolker Lendecke1-0/+6
There is closefrom in some BSDs, but Linux ships this only as part of libbsd. Add a new implementation of it in libreplace. The one in libbsd of jessie and upstream differ and it has for example optimizations for FreeBSD, but it gets some of the array calculations slightly wrong from my point of view. If you want those, use libbsd. This replacement is optimized on Linux only looking at /proc/self/fd/, everything else would do the OPEN_MAX brute force fallback. Signed-off-by: Volker Lendecke <vl@samba.org>
2016-03-24libreplace: use HAVE___ATTRIBUTE__ instead of __GNUC__Douglas Bagnall1-2/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
2015-07-29lib: replace: Add strsep function (missing on Solaris).Jeremy Allison1-0/+5
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11359 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@wakeful.net> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jul 29 02:24:55 CEST 2015 on sn-devel-104
2014-09-17replace: Make EWOULDBLOCK always availableVolker Lendecke1-0/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-07lib: tevent: make TEVENT_SIG_INCREMENT atomic.Jeremy Allison1-0/+5
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>
2014-04-17replace: Add socket_wrapper_enabled().Andreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17replace: Add nss_wrapper_hosts_enabled().Andreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17replace: Add nss_wrapper_enabled().Andreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17replace: Add uid_wrapper_enabled().Andreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-05-06lib/replace: add SCNx macrosChristian Ambach1-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>
2013-05-06lib/replace: prefer inttypes.h over stdint.hChristian Ambach1-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>
2013-01-19heimdal_build: Try again to sort out the strerror_r messAndrew Bartlett1-1/+2
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03replace: Remove deprecated getpass() support.Andreas Schneider1-11/+0
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-11-22lib/replace: Do not use STRERROR_R_PROTO_COMPATIBLE as only roken.h sets thisAndrew Bartlett1-3/+1
Currently, we put strerror_r into libreplace even on systems with strerror_r. Andrew Bartlett Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-14lib/replace: replace all *printf function if we replace snprintf (bug #9390)Stefan Metzmacher1-12/+30
This fixes segfaults in log level = 10 on Solaris. Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Björn Jacke <bj@sernet.de> Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Wed Nov 14 19:41:14 CET 2012 on sn-devel-104
2012-09-24replace: Support setproctitle().Jelmer Vernooij1-0/+9
This uses the setproctitle() from libc, libsetproctitle or libbsd. If none is available it provides a dummy implementation.
2012-09-10osX define uint64_t as long long intMatthieu Patou1-1/+1
2012-07-04replace: make the INT64_MAX define more portableBjörn Jacke1-1/+1
2012-06-28replace: define INT64_MAX when not definedBjörn Jacke1-0/+4
Tru64 doesn't have any stdint.h Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Thu Jun 28 00:45:58 CEST 2012 on sn-devel-104
2012-06-14lib/replace: define HAVE_WORKING_STRPTIME instead of REPLACE_STRPTIMEStefan Metzmacher1-1/+1
That makes the logic in 'wscript' simpler. metze
2012-06-03librepace: put #defines after #include "sys/xattr.h"Andrew Bartlett1-40/+0
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
2012-06-02libreplace: Fix build on MacOS where we have the same fn name but more argumentsAndrew Bartlett1-8/+8
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sat Jun 2 15:52:51 CEST 2012 on sn-devel-104
2012-06-02lib/replace: Merge remaining xattr test details from lib/utilAndrew Bartlett1-8/+8
I prefer the longer XATTR_ADDITIONAL_OPTIONS define and the NULL rather than 0 values in the getxattr test. Andrew Bartlett
2012-06-02lib/replace: xattr wrappers in lib/replace rather than source3/lib/system.cAndrew Bartlett1-0/+40
This also moves all the still-used configure tests etc. The unused OSF API is also removed at this time. Andrew Bartlett
2012-04-10On advice from Jelmer and Andrew, move the blksize_t and blkcnt_t tests into ↵Jeremy Allison1-8/+0
libreplace to make it standalone. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Apr 10 04:07:11 CEST 2012 on sn-devel-104
2012-04-09Move blksize_t and blkcnt_t to replace.h from includes.h. Should help with ↵Jeremy Allison1-0/+8
platforms that don't have these. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Apr 9 21:40:42 CEST 2012 on sn-devel-104
2012-03-24libreplace: Add usleep implementation.Jelmer Vernooij1-0/+6
2012-03-24libreplace: Add getpeereid implementation.Jelmer Vernooij1-0/+9