Log

Author Commit Date CI Message
Guillem Jover 6e074a2b 2015-11-30T23:00:35 build: Make git log invocation immune to local configuration
Guillem Jover 0871daf7 2015-11-30T04:12:02 build: Move hash/helper.c into new libbsd_la_included_sources Use this variable in EXTRA_DIST and libbsd_la_DEPENDENCIES.
Guillem Jover 02c33d50 2015-11-30T02:48:23 build: Move proctitle_LDFLAGS inside BUILD_LIBBSD_CTOR conditional
Guillem Jover 45443583 2015-09-23T19:37:37 Add explicit_bzero() function from OpenBSD
Guillem Jover 8641d8ae 2015-09-24T04:01:11 Make closefrom_procfs() fail when reallocarray() fails
Guillem Jover 151bc71d 2015-09-22T16:22:56 Add compile and link-time deprecation warnings for fgetln() Although the current implementation in libbsd is probably one of the safest ones around, it still poses some problems when used with many file streams. This function has now a replacement, that is both more standard and portable. Ask users to switch to getline(3) instead.
Guillem Jover 32388fe5 2014-11-03T23:21:52 Use reallocarray() instead of malloc() or realloc()
Guillem Jover 30e328cb 2014-11-03T00:43:27 Do not close file descriptors while scanning the /proc filesystem Closing file descriptors changes the content of the fd directories in the /proc filesystem, which means readdir() might get very confused. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85663
Guillem Jover 41ff37bb 2015-09-22T16:21:12 build: Add support for linker warnings
Guillem Jover 4cc43915 2014-11-02T23:58:23 Move procfs based implementation into a new closefrom_procfs() function
Guillem Jover 34df1426 2014-11-05T20:01:53 Refactor file descriptor closure into a new closefrom_close()
Guillem Jover 53d989a2 2014-12-13T21:28:36 Switch fparseln() implementation from fgetln() to getline()
Guillem Jover 3881c4fc 2014-11-02T00:23:00 Update closefrom() function Import from sudo. Adapt the build system to detect the required features.
Guillem Jover 3a3d87d7 2015-09-23T04:40:21 test: Add closefrom() unit test
Guillem Jover f50b197e 2015-09-22T22:30:17 test: Add fparseln() unit test
Guillem Jover d62f7d8f 2014-11-01T00:55:55 test: Add test case for fpurge(NULL)
Guillem Jover cfb4d462 2014-11-01T00:54:09 test: Move and activate fpurge() test case from module to a dedicated file
Guillem Jover 0982dcd9 2015-09-23T07:10:18 Lock the file streams in fgetln() and fparseln() The fparseln() function had the NetBSD uppercase macros stubbed out, so replace them with the actual stdio ones. The fgetln() function was missing any locking at all.
Guillem Jover 54f15341 2015-09-22T20:56:15 test: Refactor stream testing functions into a new module
Guillem Jover 205827a2 2014-11-01T00:52:42 build: Centralize testsuite LDADD setting in a single variable
Guillem Jover c7e01e98 2014-11-01T00:22:28 Sync queue(3) from FreeBSD Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85147
Brent Cook 9688ab26 2014-12-13T08:55:59 Avoid left shift overflow in reallocarray Some 64-bit platforms (e.g. Windows 64) have a 32-bit long. So, shifting 1UL 32-bits to the left causes an overflow. This replaces the constant 1UL with (size_t)1 so that we get the correct constant size for the platform. Import from OpenBSD. Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover ee26e59e 2015-09-23T05:50:52 Mark functions handling format strings with __printflike
Guillem Jover 025b4480 2014-11-04T05:34:46 Make mergesort setup() static
Guillem Jover a6a101ef 2014-11-04T05:33:26 Use ANSI C prototypes
Guillem Jover 32671144 2014-11-01T00:21:30 Add __offsetof, __rangeof and __containerof to sys/cdefs.h Import and adapt from FreeBSD.
Guillem Jover 0e4e3ab2 2014-11-01T00:20:23 Add __DECONST, __DEVOLATILE and __DEQUALIFY macros to sys/cdefs.h Import from FreeBSD.
Guillem Jover a6fe103c 2014-10-31T17:29:54 Add new man page for reallocarray(3) Import man page from OpenBSD. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85622
Guillem Jover 02b55488 2014-08-12T12:32:34 Use stdint integer types instead of BSD legacy ones
Callum Davies 63783511 2014-08-10T12:34:44 Fix arc4random() and arc4random_stir() prototypes These two functions accept no arguments. The prototypes should reflect this. This change lets the compiler warn about certain (admittedly silly) mistakes. Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover e390651b 2014-07-29T03:00:08 Release libbsd 0.7.0
Guillem Jover e8d3d041 2014-07-20T01:48:20 build: Remove hard requirement for GNU .init_array section support In case the support is not available, just stop building the libbsd-ctor.a library, which is a nice to have thing, but should not have been a hard requirement from the start. This should allow to build libbsd on non-glibc based systems using another libc.
Benjamin Baier faa005cb 2014-06-27T02:05:11 Add reallocarray() function from OpenBSD Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 36aca8c0 2014-06-26T21:43:55 Add stringlist module from NetBSD
Guillem Jover e8f93003 2014-06-26T21:32:11 Add getbsize() function Import code from DragonFlyBSD and man page from FreeBSD.
Christian Svensson a88bb838 2014-03-06T22:10:36 Add OpenRISC support to nlist() Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 8d16c3df 2013-10-11T05:43:42 Add timeconv module from FreeBSD Inline license information from FreeBSD root dir COPYRIGHT file.
Guillem Jover f41fdcf1 2013-10-21T05:07:56 Add funopen() function This is a wrapper over the glibc fopencookie() function. We diverge from the FreeBSD, OpenBSD and DragonFlyBSD declarations, because seekfn() there wrongly uses fpos_t, assuming it's an integral type, and any code using that on a system where fpos_t is a struct (such as GNU-based systems or NetBSD) will fail to build. In which case, as the code has to be modified anyway, we might just as well use the correct declaration.
Guillem Jover 86cbff38 2013-10-11T05:11:42 Handle glibc partial header inclusions The glibc headers use selective inclusions through the __need_NAME mechanism to avoid circular dependencies. The problem is that if we are being overlaid, and have been requested a partial inclusion, when we pass control to the system header, then we might miss definitions needed by our own header, resulting in build failures. Workaround that by catching current partial requests, and skip the current inclusion.
Guillem Jover ee04e8de 2013-10-10T09:49:04 build: Set subdir-objects automake option Bump automake minimal version to 1.9.
Guillem Jover 61b2dbb8 2013-07-15T01:44:30 Fix dehumanize_number() to correctly detect overflows Do not allow numbers greated than INT64_MAX and smaller than INT64_MIN. Clarify the positive sign value by prefixing it with an explicit +. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66909
Guillem Jover 11941746 2013-07-14T10:58:20 Release libbsd 0.6.0
Guillem Jover 948bcf1d 2013-07-13T02:11:20 Warn when setproctitle() gets called before initialization Try to give a helpful message in case the program is not initializing the setproctitle() machinery.
Guillem Jover c5b95902 2013-07-11T12:25:54 Move setproctitle() automatic initialization to its own library The automatic initialization cannot be part of the main shared library, because there is no thread-safe way to change the environ global variable. This is not a problem if the initializaion happens just at program load time, but becomes one if the shared library is directly or indirectly dlopen()ed during the execution of the program, which could have either kept references to the old environ or could change it in some other thread. This has been observed for example on systems using Samba NSS modules. To avoid any other possible fallout, the constructor is split into a new static library that needs to be linked explicitly into programs using setproctitle(). As an additional safety measure the pkg-config linker flags will mark the program as not allowing to be dlopen()ed so that we avoid the problem described above. Reported-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66679
Guillem Jover 3077d2ff 2013-07-12T22:15:58 build: Move version ABI from Makefile to configure.ac It's easier to find there, and the value can be reused in case we have to provide another shared library.
Guillem Jover 1bf0a555 2013-06-08T17:43:42 Release libbsd 0.5.2
Guillem Jover ad613d9d 2013-06-07T07:11:50 Create a shallow copy of environ before replacing it in setproctitle() Because clearenv() or setenv() might free the environ array of pointers, we should make sure to copy it so that we can access it later on when doing the deep copy via setenv(). Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=65470
Guillem Jover e084ce3f 2013-06-07T04:46:29 Specify setproctitle_stub() signature manually if typeof is missing Do not stop exporting the function in the version node even if typeof is not available, as that would break ABI.
Guillem Jover 50e4c55a 2013-06-08T17:55:19 Try to check if setproctitle() constructor got passed arguments
Guillem Jover 6faea4d2 2013-05-29T02:23:56 Force setproctitle() into .init_array section The GNU .init_array support is an extension over the standard System V ABI .init_array support, which passes the main() arguments to the init function. This support comes in three parts. First the dynamic linker (from glibc) needs to support it. Then function pointers need to be placed in the section, for example by using __attribute__((constructor)), that the compiler (gcc or clang for example) might place in section .ctors and the linker (from binutils) will move to .init_array on the output object, or by placing them directly into .init_array by the compiler when compiling. If this does not happen and the function pointers end up in .ctors, then they will not get passed the main() arguments, which we do really need in this case. But this relies on recent binutils or gcc having native .init_array support, and not having it disabled through --disable-initfini-array. To guarantee we get the correct behaviour, let's just place the function pointer in the .init_array section directly, so we only require a recent enough glibc. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=65029
Guillem Jover 367e0365 2013-06-08T08:15:21 test: Try setting and getting an environment variable after setproctitle()
Guillem Jover dc8b0978 2013-05-30T04:09:25 build: Ignore automake 1.13+ test suite generated files
Guillem Jover 46633647 2013-05-27T06:52:05 Release libbsd 0.5.1
Guillem Jover df5aebd7 2013-05-27T06:49:57 test: Mark a literal integer as long long This fixes build failures on 32-bit architectures.
Guillem Jover 95878823 2013-05-21T04:34:34 Release libbsd 0.5.0
Guillem Jover 01f146c2 2013-05-27T04:41:58 build: Handle the ChangeLog as a distributed-only file The ChangeLog file is distributed, and cannot be regenerated outside of the git repository, so do not remove it in DISTCLEANFILES, and move the generation code into dist-hook, which also avoids unnecessary computation during normal builds.
Guillem Jover 509841b5 2013-05-25T15:44:57 build: Use AM_V_at for mkdir
Guillem Jover 06f0585c 2013-05-21T10:31:59 build: Compress the distribution tarball with xz instead of gzip
Guillem Jover 7c4caa67 2013-05-25T15:36:11 Fix comparison between signed and unsigned integer compiler warnings
Guillem Jover 30349f89 2013-05-25T15:35:39 Update radixsort module from NetBSD Merge some interesting changes.
Guillem Jover 96a2dae3 2013-05-25T15:31:45 Update setmode module from NetBSD Merge some interesting changes.
Casper Dik a4812cdf 2013-03-15T01:13:58 Fix getpeereid() compilation on Solaris The code in getpeereid() is unlikely to compile as ucred_t is an opaque struct (ucred_t * works but ucred_t does not). Either you need to give a pointer initialized to NULL and getpeerucred() allocates a new ucred or you call it with an allocated ucred as in this patch. Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover d3a09e1c 2012-12-27T11:19:20 Switch dehumanize_number() to use expand_number() The function is a duplicate of expand_number(), but covering less prefixes and with a slightly different function signature. Spotted-by: Peter da Silva <resuna@gmail.com>
Guillem Jover 330b569f 2013-05-26T04:34:57 test: Add new humanize unit test
Guillem Jover 8c26c40a 2012-11-27T14:23:26 test: Add setproctitle() unit test
Guillem Jover e9933255 2013-05-25T17:11:53 Make setproctitle() available in 0.2 and 0.5 version nodes Make the 0.5 version the default, so that code wanting the actual implemented version can get a proper versioned depdendency. For code linked against the old version, make it available as an alias.
Guillem Jover c984dacd 2012-11-27T14:24:13 Implement sendmail semantics for setproctitle() Prefix the title with "progname: ", and skip it if the format string starts with '-' (which gets skipped on output too).
Guillem Jover 35785f8d 2012-11-25T21:10:53 Modify setproctitle() to conform to project coding style Use local getprogname()/setprogname() instead of reimplementing them locally. Use clearenv() if available, not just on glibc. Use bool instead of _Bool. Use paranthesis on sizeof. Fold the SPT_MIN macro into spt_min(). Make spt_init() static. Avoid unnecessary gotos.
William Ahern 2a0260d0 2012-11-28T11:09:02 Add a setproctitle() implementation Taken from libnostd. Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover f8d52ead 2012-11-23T18:33:23 Add x32 support to nlist()
Guillem Jover cf683a27 2012-11-23T18:32:35 Add arm64 (aka aarch64) to nlist()
Guillem Jover 7196b4dc 2013-05-23T02:05:19 test: Add new fgetln() and fgetwln() unit test
Guillem Jover a97ce513 2012-11-23T21:19:45 Add new fgetwln() function Man page taken from FreeBSD.
Strake ee0489eb 2012-08-07T08:44:30 Add new fparseln() function Taken from NetBSD. [guillem@hadrons.org: - Import from NetBSD instead of FreeBSD to get a 3-clause BSD license, instead of a 4-clause one. - Define compatibility macros. - Change library from libc to libbsd and header in man page. - Add copyright information to COPYING. - Add symbol to map file. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover cb7bc0d8 2012-11-25T22:09:43 Add file buffer pool support to fgetln() This avoids buffer overwrites during concurrent or intermixed calls to fgetln() when using more than one different stream (currently 32), which the original interface supports natively by using an internal buffer from the FILE structure. Although this workaround is rudimentary, it should cover most of the theoretically problematic cases.
Guillem Jover 1be0bdb2 2012-11-25T21:13:38 Add new strnstr() function Taken from FreeBSD.
Guillem Jover ff0d700d 2012-11-23T17:16:43 Add new wcslcat() and wcslcpy() functions Taken from FreeBSD.
Guillem Jover 38627648 2013-05-21T04:13:55 Coalesce identical BSD-2-clause licenses
Guillem Jover 918a4dba 2012-06-27T09:15:15 Release libbsd 0.4.2
Guillem Jover 444bd1fb 2012-06-21T10:16:14 man: Use minus signs and hyphens consistently Any string that can be copy & pasted into a terminal, for example, needs to correctly use minus signs (escaped dashes), instead of the default hyphen.
Guillem Jover 1d69ae1c 2012-06-04T05:47:26 man: Recode flopen(3) to UTF-8 Spotted-by: Eric Smith <eric@brouhaha.com>
Guillem Jover 14524b54 2012-06-03T07:39:42 build: Set default compiler variables from configure This centralizes the setting so there's no duplication anymore, makes sure the user supplied variables are never overridden, and are only set when using gcc. Reported-by: Samuli Suominen <ssuominen@gentoo.org>
Guillem Jover c21d788f 2012-06-01T08:20:37 Release libbsd 0.4.1
Guillem Jover fdcae577 2012-06-01T08:17:42 build: Set runtimelibdir to libdir This makes sure the install-exec-hook under src works as expected even when no runtimelibdir was specified, otherwise the symlinks end up pointing to non-existing targets. Reported-by: Ryan Mullen <rmmullen@gmail.com>
Guillem Jover e9e4a60d 2012-06-01T08:15:00 build: Use MKDIR_P variable instead of literal «mkdir -p»
Guillem Jover 309c82a0 2012-05-29T04:38:07 Release libbsd 0.4.0
Guillem Jover cd67cb14 2012-05-29T07:17:46 Use implicit <md5.h> from overlay instead explicit <bsd/md5.h> This was assuming an installed <bsd/md5.h> on the system, due to the build system not including -Iinclude/ anymore. Regression introduced in commit 901ed630fc64fca828e031bc8fa6780db9f05db1.
Guillem Jover 1b5b1cd5 2012-04-24T04:20:58 Move mdX.3 man page to section 3bsd This makes sure there will be no collisions on systems where a mdX.3 provided by a third party is already present.
Guillem Jover ddefaae3 2012-04-24T04:05:48 Do not quote man page titles
Guillem Jover e7f39760 2012-03-23T10:31:42 Add email address to my name
Guillem Jover e59ac2c9 2012-03-23T10:11:57 Clarify that the 4-clause BSD licenses are only for man pages
Guillem Jover 7cfa7e43 2012-01-12T19:13:16 Add new man page for tree(3) Taken from FreeBSD.
Guillem Jover 7620fef7 2012-01-12T20:56:24 Remove UC Berkeley advertising clause As per <ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>.
Guillem Jover 08139dd5 2012-01-12T19:13:16 Add new man pages for bitstring(3) and queue(3) Taken from FreeBSD.
Guillem Jover d90ce079 2011-05-14T14:18:57 Add new man pages for getprogname(3) and setprogname(3) Taken from FreeBSD.
Guillem Jover c1d086c2 2011-05-14T14:18:57 Add new man page for setproctitle(3) Taken from FreeBSD.
Guillem Jover e37293a1 2012-01-12T18:16:55 Add <bitstring.h> for compatibility with NetBSD and OpenBSD
Guillem Jover 34bf1068 2012-03-23T10:43:33 test: Add a unit test for endian encoder/decoder
Robert Millan 4eab0cc3 2012-01-03T05:29:36 Add inline endian encoding/decoding functions Taken from FreeBSD. Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 75299746 2012-01-03T08:58:01 Base getprogname() on program_invocation_short_name presence instead of glibc