Guillem Jover
f84004baf2
test: Add new unit tests for individual headers usage
2015-12-14 03:34:40 +01:00
Guillem Jover
cdf998a056
Turn <bsd/bsd.h> inert when using LIBBSD_OVERLAY
...
Also print a warning stating this fact.
2015-12-14 00:58:59 +01:00
Guillem Jover
2c77ad593c
Add missing include to <md5.h>
...
The header was not self-contained, it was missing definitions for some
types included in <sys/types.h>.
2015-12-14 00:58:59 +01:00
Guillem Jover
48ac79b188
Use the non-overlayed libbsd headers when we need our own definitions
2015-12-14 00:58:51 +01:00
Guillem Jover
290a1ce8f2
Switch COPYING to Debian copyright machine readable format 1.0
2015-12-07 03:36:33 +01:00
Guillem Jover
6bcb1312f4
Relicense my contribution to BSD-2-clause
...
This avoids having two licenses on the same file.
2015-12-07 03:24:47 +01:00
Guillem Jover
da137a0921
Add missing copyright and license headers
2015-12-07 01:56:25 +01:00
Guillem Jover
d2f59a23d5
Fix getentropy implementation to use the correct system hooks
...
Include getentropy_<SYSTEM>.c instead of arc4random_<SYSTEM>.c.
2015-12-02 04:03:16 +01:00
Guillem Jover
01b77f0dcf
Add support for GNU/kFreeBSD for closefrom() and getentropy()
2015-12-02 03:32:13 +01:00
Guillem Jover
75729394af
Unify most arc4random Unix hooks into a single file
...
The Unix hook should work for most Unix-like systems, move glibc
specific code there and a FreeBSd specific comment, and remove the rest.
Also change the code to always fallback to use the generic Unix code.
This should cover GNU/Hurd and GNU/kFreeBSD among others.
2015-12-02 03:08:17 +01:00
Guillem Jover
8493c7f27d
Use local SHA512 header
...
Actually use the local private SHA512 header instead of relying on the
OpenSSL one for no good reason. Add definition for expected macro
SHA512_DIGEST_LENGTH.
2015-12-01 03:40:57 +01:00
Guillem Jover
2b030da016
Release libbsd 0.8.0
0.8.0
2015-11-30 23:48:50 +01:00
Guillem Jover
330e211142
Update license and copyright information
2015-11-30 23:48:50 +01:00
Guillem Jover
874a0e51d3
Update arc4random module from OpenBSD and LibreSSL
...
Rework arc4random_stir() and arc4random_addrandom() code over the new
internal API, and documentation in the man page. Adapt the code to the
local build system.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85827
2015-11-30 23:48:50 +01:00
Guillem Jover
9a9a8b2dba
Add private getentropy module from OpenBSD and LibreSSL
...
Adapt the code to the local build system.
2015-11-30 23:48:50 +01:00
Guillem Jover
5f9265f816
Add private SHA512 module from FreeBSD
2015-11-30 23:48:50 +01:00
Marek Vasut
1f77cdb40a
Add NIOS2 support to nlist()
...
Add support for the NIOS2 soft-core CPU provided by Altera.
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Thomas Chou <thomas@wytron.com.tw>
Cc: Walter Goossens <waltergoossens@home.nl>
2015-11-30 23:48:50 +01:00
Guillem Jover
f3b115540c
man: Rename funopen.3 to funopen.3bsd to avoid clash with funtools
...
The funtools project ships a man page with the same, name. And although
it mith probably make more sense to rename the man page there, as BSD
systems will certainly not do so, this is the easiest and fastest way
to avoid a file conflict.
2015-11-30 23:48:50 +01:00
Guillem Jover
877732ef4d
test: Check asprintf() return code
2015-11-30 23:48:50 +01:00
Guillem Jover
02bccb0a01
test: Add unit test for strmode()
2015-11-30 23:02:23 +01:00
Guillem Jover
58bef83f41
test: Add unit test for arc4random()
2015-11-30 23:02:23 +01:00
Guillem Jover
6e074a2bdc
build: Make git log invocation immune to local configuration
2015-11-30 23:02:23 +01:00
Guillem Jover
0871daf7b0
build: Move hash/helper.c into new libbsd_la_included_sources
...
Use this variable in EXTRA_DIST and libbsd_la_DEPENDENCIES.
2015-11-30 04:12:02 +01:00
Guillem Jover
02c33d5022
build: Move proctitle_LDFLAGS inside BUILD_LIBBSD_CTOR conditional
2015-11-30 04:10:23 +01:00
Guillem Jover
45443583df
Add explicit_bzero() function from OpenBSD
2015-09-24 05:47:58 +02:00
Guillem Jover
8641d8aed7
Make closefrom_procfs() fail when reallocarray() fails
2015-09-24 05:28:58 +02:00
Guillem Jover
0982dcd98b
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.
2015-09-23 07:59:34 +02:00
Guillem Jover
ee26e59e72
Mark functions handling format strings with __printflike
2015-09-23 07:59:34 +02:00
Guillem Jover
151bc71d64
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.
2015-09-23 07:59:34 +02:00
Guillem Jover
41ff37bbcc
build: Add support for linker warnings
2015-09-23 07:59:34 +02:00
Guillem Jover
53d989a223
Switch fparseln() implementation from fgetln() to getline()
2015-09-23 07:59:34 +02:00
Guillem Jover
f50b197ea5
test: Add fparseln() unit test
2015-09-23 07:59:34 +02:00
Guillem Jover
54f153414a
test: Refactor stream testing functions into a new module
2015-09-23 07:59:34 +02:00
Brent Cook
9688ab26b9
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>
2015-09-23 07:59:34 +02:00
Guillem Jover
025b44800e
Make mergesort setup() static
2015-09-23 07:59:34 +02:00
Guillem Jover
a6a101effa
Use ANSI C prototypes
2015-09-23 07:59:34 +02:00
Guillem Jover
32388fe59f
Use reallocarray() instead of malloc() or realloc()
2015-09-23 07:59:34 +02:00
Guillem Jover
30e328cbf1
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
2015-09-23 07:59:34 +02:00
Guillem Jover
4cc43915f2
Move procfs based implementation into a new closefrom_procfs() function
2015-09-23 07:59:34 +02:00
Guillem Jover
34df142665
Refactor file descriptor closure into a new closefrom_close()
2015-09-23 07:59:34 +02:00
Guillem Jover
3881c4fc68
Update closefrom() function
...
Import from sudo. Adapt the build system to detect the required features.
2015-09-23 07:59:34 +02:00
Guillem Jover
3a3d87d730
test: Add closefrom() unit test
2015-09-23 07:59:34 +02:00
Guillem Jover
d62f7d8fac
test: Add test case for fpurge(NULL)
2015-09-23 07:59:34 +02:00
Guillem Jover
cfb4d462a9
test: Move and activate fpurge() test case from module to a dedicated file
2015-09-23 07:59:34 +02:00
Guillem Jover
205827a2dd
build: Centralize testsuite LDADD setting in a single variable
2015-09-23 07:59:34 +02:00
Guillem Jover
c7e01e9884
Sync queue(3) from FreeBSD
...
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85147
2015-09-23 07:59:34 +02:00
Guillem Jover
3267114483
Add __offsetof, __rangeof and __containerof to sys/cdefs.h
...
Import and adapt from FreeBSD.
2015-09-23 07:59:27 +02:00
Guillem Jover
0e4e3ab269
Add __DECONST, __DEVOLATILE and __DEQUALIFY macros to sys/cdefs.h
...
Import from FreeBSD.
2015-09-23 07:59:24 +02:00
Guillem Jover
a6fe103c1b
Add new man page for reallocarray(3)
...
Import man page from OpenBSD.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85622
2015-09-23 07:14:24 +02:00
Guillem Jover
02b55488c5
Use stdint integer types instead of BSD legacy ones
2015-09-23 07:14:21 +02:00