summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-02-28nlist: Remove repeated shadowing variable declarationHEADmasterGuillem Jover1-1/+0
Warned-by: gcc
2021-02-28getentropy: Fix function cast for getauxval()Guillem Jover1-3/+3
Warned-by: gcc
2021-02-28test: Add proper prototypes for main() functionGuillem Jover6-6/+6
Warned-by: gcc
2021-02-28Mark local functions as staticGuillem Jover3-6/+6
Warned-by: gcc
2021-02-28Add link-time warnings to MD5 wrapper functionsGuillem Jover1-0/+19
Let's get the word out that these functions are deprecated and should be switched away from.
2021-02-28Require a semicolon for libbsd_link_warning() macroGuillem Jover3-3/+3
Remove the semicolon in the macro definition to force adding one on the call sites, to make the code look like an actual function.
2021-02-28man: Call the libbsd-ctor library by its name instead of bsd-ctorGuillem Jover1-1/+1
2021-02-28man: Fix pkg-config(1) references in libbsd(7) man pageGuillem Jover1-5/+5
2021-02-28build: Add code coverage support in the GitLab CIGuillem Jover2-5/+16
2021-02-28build: Use apt-get instead of apt in the GitLab CIGuillem Jover1-2/+3
The former is to be used programmatically, while the latter is intended for interactive use.
2021-02-09build: Add a Libs.private field to overlay pkg-config fileGuillem Jover1-0/+1
We need to list all internal libraries there so that we can statically link. Fixes: commit 2374f409defb380d0c5c07f28b9c166ef8bdc742
2021-02-09Release libbsd 0.11.30.11.3Guillem Jover1-1/+1
2021-02-09Switch libmd wrapper to use dlsym()Guillem Jover3-32/+66
Switch from the previous versioned symbol implementation which required users to also link against the message digest provider explicitly, or they would fail to find the symbols, to an implementation that loads the symbols from the linked library providing the functions using dlsym(), thus preserving backwards compatibility.
2021-02-09build: Add a Libs.private field to pkg-config fileGuillem Jover1-0/+1
We need to list all internal libraries there so that we can statically link.
2021-02-09build: Use a single variable to track libraries to link againstGuillem Jover2-7/+7
Using various variables means we have to keep these in sync in various places. Just use a single variable that we can use anywhere where this is needed.
2021-02-09build: Fix message digest library checksGuillem Jover1-3/+10
They were not failing when not finding the SHA-2 functions and were hardcoding -lmd regardless of what library had been found.
2021-02-09Use uintptr_t and size_t instead of __-prefixed types in <sys/cdefs.h>Guillem Jover1-5/+5
The __-prefixed types cannot be assumed to be defined. Use the standard types instead. Closes: #6
2021-02-08Release libbsd 0.11.20.11.2Guillem Jover1-1/+1
2021-02-08closefrom: Use close_range() on Linux when availableGuillem Jover1-1/+20
Closes: !11 Based-on-patch-by: cptpcrd <cptpcrd.git@gmail.com> Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-02-08closefrom: Handle lowfd < 0 properlycptpcrd1-0/+3
More important if close_range() is going to be used, since casting negative values to 'unsigned int' might hide the errors. [guillem@hadrons.org: Minor coding style fix. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-02-08closefrom: Import some changes from sudoGuillem Jover1-44/+49
Take most of the changes done in sudo, but preserve the existing local changes and refactoring. In addition, refactor pstat implementation into closefrom_pstat(), so that the code is easier to read, and requires no conditional declarations.
2021-02-08Update <sys/queue.h> from FreeBSDFaidon Liambotis12-51/+356
This brings <sys/queue.h> to the most up-to-date version from FreeBSD, incorporating 18 commits from the past 5 years (2015-02-24 - 2021-01-25): $ git log --oneline 9090a24aed70..8d55837dc133 sys/sys/queue.h share/man/man3/queue.3 Only minimal changes compared to the FreeBSD version have been applied (queue.3 -> queue.3bsd, _LIBBSD_ prefix). [guillem@hadrons.org: Remove reference to kernel mode in man page. ] Closes: !12 Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-02-07test: Improve code coverage for strnstr(3) unit testsGuillem Jover1-0/+4
2021-02-07man: Update libbsd(7) man page with updates in 0.11.0Guillem Jover1-0/+43
2021-02-07build: Install libmd-dev in the gitlab CIGuillem Jover1-1/+1
2021-02-07build: Switch gitlab CI to use a Debian busterGuillem Jover1-1/+1
2021-02-07Release libbsd 0.11.10.11.1Guillem Jover1-1/+1
2021-02-07Add support for new LIBBSD_VIS_OPENBSD selection macroGuillem Jover2-4/+6
This will make it possible to explicitly select the OpenBSD vis implementation (the current default) for code of OpenBSD origins.
2021-02-07Release libbsd 0.11.00.11.0Guillem Jover1-1/+1
2021-02-07Update copyright claimsGuillem Jover4-4/+4
2021-02-07Use libmd hashing function implementations instead of embedding our ownGuillem Jover20-831/+163
This splits the implementation responsibilities, and reduces embedded code copies, which was one of the driving points with this project to start with, so it's nice to give a good example.
2021-02-07Provide a default progname on WindowsAaron Dierking1-1/+71
[guillem@hadrons.org: - Remove .exe extension from default program name. - Call reallocarray() once by switching to a «do {} while» loop. - Minor coding style fixes. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-02-07Import pwcache module from OpenBSDGuillem Jover18-1/+757
2021-02-07man: Remove empty line in reallocarray(3bsd)Guillem Jover1-1/+0
Warned-by: lintian Fixes: commit 01f0d1ea1e71f1018a009ebd9203dd48e6d90c45
2021-01-01Add recallocarray() and freezero() from OpenBSDFaidon Liambotis10-35/+346
Add recallocarray(), introduced in OpenBSD 6.1, and freezero(), introduced in OpenBSD 6.2. The former is imported as-is from OpenBSD, while the latter is the non-malloc-internal branch of the same code (and also the OpenSSH portable variant). Both of these originated in OpenBSD, but have also been implemented by IllumOS, cf. https://www.illumos.org/issues/8546 Documentation for these functions is in malloc(3) upstream, the relevant parts of which were previously imported in reallocarray(3bsd). Update reallocarray(3bsd) with the changes that were introduced since, and add the relevant bits for recallocarray() and freezero(), plus aliases. [guillem@hadrons.org: Update copyright in COPYING. ] Closes: !10 Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-01-01Fix ELF detection on Intel compilersSeth R Johnson1-1/+1
The Intel compiler does not define __amd64__ on x86_64 platforms; instead, like other compilers, it defines __x86_64__ . Closes: !8 Signed-off-by: Guillem Jover <guillem@hadrons.org>
2020-12-21man: Add a timespec(3bsd) alias to timeval(3bsd)Guillem Jover2-0/+2
Even though man-pages project now includes man pages for system data types, we still include these for any other system that does not have them, to provide a self-contained project with code and documentation.
2020-12-21man: Add missing LIBRARY sectionGuillem Jover4-0/+16
2020-12-21Fix coding styleGuillem Jover1-1/+1
2020-12-21test: Fix short lived memory leaksGuillem Jover2-6/+27
These are non-issues, but having a clean ASAN test suite makes it possible to detect actual problems in the tested code. Warned-by: gcc ASAN
2020-12-21funopen: Fix memory leak in funopen_close() when closefn is NULLGuillem Jover1-4/+4
We need to free the cookiewrap even when the closefn method is NULL. Warned-by: gcc ASAN
2020-12-21build: Detect support for --version-script in ldGuillem Jover2-1/+23
2020-12-21Do not define SIZE_T_MAX if already definedGuillem Jover1-0/+2
2020-12-21man: Add missing doc-operating-system-NetBSD string variableGuillem Jover1-0/+1
Fixes: commit 99320b9168ffb0112def1a712e8d59441d1b46d9.
2020-12-21Add missing strnvisx() to the symbols scriptGuillem Jover1-0/+4
Fixes: commit 2d7de186e9cb19a756c0630ee85cb3f2d29b3484.
2019-08-08Release libbsd 0.10.00.10.0Guillem Jover1-2/+2
2019-08-08err: Add err(), warn(), errx() and warnx() familiy of functionsGuillem Jover3-0/+113
Some systems such as Windows or musl-libc based ones do not have these BSD extensions. In addition libbsd itself is making use of the warnx() functions, so we better provide these interfaces in case they are missing.
2019-08-08err: Rewrite warnc() and errc() family functions to be standaloneGuillem Jover3-20/+28
Do not depend on the system vwarn() and verr() functions to implement the *c() variants, as the system might actually lack any of the <err.h> BSD extensions.
2019-08-08err: Mark error functions as non-returning with __dead2Guillem Jover1-2/+3
2019-08-08Add e2k support for nlist()Michael Shigorin1-0/+6
This is a Russian 64-bit LE VLIW architecture named Elbrus (formerly Elbrus 2000). [guillem@hadrons.org: - Place the entry in alphabetical order. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>