aboutsummaryrefslogtreecommitdiff
path: root/compat
AgeCommit message (Collapse)Author
2024-06-17comment out stravis instead of adding -Wno-* for stupid gccOmar Polo
gcc has a broken error checking for 'use-after-free' that can be triggered by perfectly valid code. Since it's in a function (stravis) we don't use, comment it out.
2024-06-06libtls: add missing includeOmar Polo
2024-01-07mark private function as staticOmar Polo
2024-01-07remove explicit #include endian.hOmar Polo
unfortunately that's not portable. config.h will include the right stuff however.
2024-01-07sync libtlsOmar Polo
2024-01-07sync imsgOmar Polo
2023-08-23fix previous; check for getentropy only when arc4random is missingOmar Polo
on macos we have the situation where we have arc4random available but no getentropy().
2023-08-23comment out seed_from_prngdOmar Polo
it's not used (we define OPENSSL_PRNG_ONLY) and fails the build with -Werror. Keep the function commented instead of deleting it just in case we need to undefine OPENSSL_PRNG_ONLY in the future.
2023-08-23bundle libtlsOmar Polo
gmid (like all other daemons that want to do privsep crypto) has a very close relationship with libtls and need to stay in sync with it. OpenBSD' libtls was recently changed to use OpenSSL' EC_KEY_METHOD instead of the older ECDSA_METHOD, on the gmid side we have to do the same otherwise failures happens at runtime. In a similar manner, privsep crypto is silently broken in the current libretls (next version should fix it.) The proper solution would be to complete the signer APIs so that applications don't need to dive into the library' internals, but that's a mid-term goal, for the immediate bundling the 'little' libtls is the lesser evil. The configure script has gained a new (undocumented for the time being) flag `--with-libtls=bundled|system' to control which libtls to use. It defaults to `bundled' except for OpenBSD where it uses the `system' one. Note that OpenBSD versions before 7.3 (inclusive) ought to use --with-libtls=bundled too since they still do ECDSA_METHOD.
2023-08-07add missing include of config.h in vis.cOmar Polo
2023-08-07drop the __bounded__ attributeOmar Polo
breaks the build with -Werror depending on the compiler.
2023-08-07drop #include <sys/cdefs.h> from vis.hOmar Polo
Doesn't seem to be available on many systems. It is also not strictly needed since we include vis.h only after headers like stdlib.h that already pulls in the type it needs.
2023-08-07address the strnvis(3) portability fiascoOmar Polo
strnvis originates on OpenBSD. When NetBSD added it to their libc they decided to swap the argument. Without starting a holy war on the "best" argument order, adding an implementation of a function that's widely available and making its signature purposefully incompatible is beyond justification. FreeBSD (and so macos too?) followed NetBSD in this, so we end up with *two* major and incompatible strnvis implementations. libbsd is in a limbo, they started with the OpenBSD version but they'll probably switch to the NetBSD version in the future. That's why we can't have nice things. Do the right thing(tm) and check for the presence of the original strnvis(3), if not available or broken use the bundled one.
2023-07-02update imsgOmar Polo
2023-06-23add missing include of ../config.h in regress/*.cOmar Polo
otherwise we get a nice 'no previous prototype' due to -Wmissing-prototypes.
2023-06-13rework the configure scriptOmar Polo
now it resembles less oconfigure and more the configure scripts I'm using in my recent projects. I'd argue it's more easy to use it.
2022-12-02add tests and compat for setresuid and setresgidOmar Polo
2022-10-31add memmem compatOmar Polo
2022-10-31rework `make dist'Omar Polo
2022-07-04fix getprogname shimOmar Polo
HAVE_PROGRAM_INVOCATION_SHORT_NAME is always defined; look at wether it's zero or not.
2022-03-19sync imsg-buffer.cOmar Polo
original commit from eric@: change the barrier so that fd's are always passed and received with the first byte of the imsg they belong to. idea, tweaks and ok claudio@
2022-03-19sync recallocarary.cOmar Polo
original commit from claudio@: Type-cast getpagesize() from int to size_t for the comparison with d. getpagesize() will only return positive numbers (there is no negative page size system) and it can not fail. Should fix some compiler warnings seen in -portable projects. OK otto@
2022-01-28only memcpy into imsg->data if datalen is not zeroOmar Polo
Passing a NULL pointer to memcpy is UB no matter if len is 0 (commit by claudio@, backporting for gmid.)
2021-10-07add compat for sys/tree.hOmar Polo
2021-04-25add compat for reallocarrayOmar Polo
2021-02-23fix various error in compat/err.cOmar Polo
2021-02-23tests and compat for imsgOmar Polo
2021-02-12include config.h firstOmar Polo
2021-02-11improve compat/getprogname on GNU libcOmar Polo
but why'd they called it program_invocation_short_name? They couldn't find a longer name?
2021-02-04add compat for setproctitleOmar Polo
This adds a check for setproctitle and for the (linux) prctl PR_SET_NAME. If setproctitle is not available, on linux we provide an implementation that use prctl (taken from tmux compat layer.)
2021-01-22fixing compat compilationOmar Polo
include headers if needed and include config.h
2021-01-21more OpenBSD goodiesOmar Polo
2021-01-21typoOmar Polo
2021-01-21don't include config.h thereOmar Polo
2021-01-21add a configure script and some compatOmar Polo
tested on openbsd, alpine and void