priv_wrapper.git
14 months agocmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode main
Andreas Schneider [Fri, 17 Feb 2023 16:51:27 +0000 (17:51 +0100)]
cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
17 months agoBump version to 1.0.1 priv_wrapper-1.0.1
Andreas Schneider [Tue, 15 Nov 2022 12:08:13 +0000 (13:08 +0100)]
Bump version to 1.0.1

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
17 months agoAvoid dclose(RTLD_NEXT)
Samuel Thibault [Thu, 10 Nov 2022 18:39:23 +0000 (18:39 +0000)]
Avoid dclose(RTLD_NEXT)

In case the libc was not found and RTLD_NEXT is used instead, we should not
dlclose it, otherwise mayhem happens.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15228

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
17 months agoFix prctl on ppc64le
Pavel Filipenský [Thu, 10 Nov 2022 12:41:04 +0000 (13:41 +0100)]
Fix prctl on ppc64le

There is a fortify abort on ppc64le in test_prctl:

Program received signal SIGABRT, Aborted.
0x00007ffff7cbc72c in __pthread_kill_implementation () from /lib64/libc.so.6
(gdb) bt

Some backround from Florian Weimer <fweimer@redhat.com>:

You've got this type definition, and I think that's the function pointer
you use for the call:

| #ifdef HAVE_PRCTL
| typedef int (*__libc_prctl)(int option,
|                             unsigned long arg2,
|                             unsigned long arg3,
|                             unsigned long arg4,
|                             unsigned long arg5);
| #endif

That's not a variadic prototype, so the callee doesn't set up the
parameter save area.

This is essentially the same issue that you had a while back with
open/openat.
(https://gitlab.com/cwrap/socket_wrapper/-/commit/c7774174beffe9a8d29dd4fb38bbed43ece1cecd)

Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoBump version to 1.0.0 priv_wrapper-1.0.0
Andreas Schneider [Fri, 21 Oct 2022 09:10:18 +0000 (11:10 +0200)]
Bump version to 1.0.0

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agoAdd CHANGELOG.md file
Andreas Schneider [Fri, 21 Oct 2022 09:09:45 +0000 (11:09 +0200)]
Add CHANGELOG.md file

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agoFix markdown in README
Andreas Schneider [Fri, 21 Oct 2022 09:12:02 +0000 (11:12 +0200)]
Fix markdown in README

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agoUpdate manpage for pledge()
Pavel Filipenský [Wed, 14 Sep 2022 09:50:05 +0000 (11:50 +0200)]
Update manpage for pledge()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAdd pledge() unit test
Pavel Filipenský [Wed, 14 Sep 2022 09:40:47 +0000 (11:40 +0200)]
Add pledge() unit test

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAdd pledge() wrapper for OpenBSD
Pavel Filipenský [Wed, 14 Sep 2022 07:16:57 +0000 (09:16 +0200)]
Add pledge() wrapper for OpenBSD

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoFix failing test on OpenBSD
Pavel Filipenský [Wed, 14 Sep 2022 07:21:55 +0000 (09:21 +0200)]
Fix failing test on OpenBSD

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agogitlab-ci: Enable freebsd runner
Andreas Schneider [Mon, 12 Sep 2022 06:44:24 +0000 (08:44 +0200)]
gitlab-ci: Enable freebsd runner

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agotests: Fix test_chroot on FreeBSD
Andreas Schneider [Mon, 12 Sep 2022 08:02:36 +0000 (10:02 +0200)]
tests: Fix test_chroot on FreeBSD

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agotests: Fix test_setrlimit fsize on FreeBSD
Andreas Schneider [Mon, 12 Sep 2022 08:06:25 +0000 (10:06 +0200)]
tests: Fix test_setrlimit fsize on FreeBSD

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agotests: Fix test_setrlimit combination test on FreeBSD
Andreas Schneider [Mon, 12 Sep 2022 07:09:33 +0000 (09:09 +0200)]
tests: Fix test_setrlimit combination test on FreeBSD

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agotests: Only add prctl test if we have support for it
Andreas Schneider [Mon, 12 Sep 2022 07:03:14 +0000 (09:03 +0200)]
tests: Only add prctl test if we have support for it

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agopwrap: Fix setrlmit() on FreeBSD
Andreas Schneider [Mon, 12 Sep 2022 06:43:53 +0000 (08:43 +0200)]
pwrap: Fix setrlmit() on FreeBSD

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agocmake: Check setrlimit() prototype
Andreas Schneider [Mon, 12 Sep 2022 06:43:46 +0000 (08:43 +0200)]
cmake: Check setrlimit() prototype

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agotests: Fix linking with cmocka
Andreas Schneider [Mon, 12 Sep 2022 07:12:58 +0000 (09:12 +0200)]
tests: Fix linking with cmocka

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
18 months agoFix 'doc/priv_wrapper.1' and use 'asciidoctor -b manpage doc/priv_wrapper.1.txt'...
Pavel Filipenský [Mon, 12 Sep 2022 09:52:10 +0000 (11:52 +0200)]
Fix 'doc/priv_wrapper.1' and use 'asciidoctor -b manpage doc/priv_wrapper.1.txt' to generate the manpage

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoFix install dirs to use CMAKE_INSTALL
Pavel Filipenský [Mon, 12 Sep 2022 09:41:05 +0000 (11:41 +0200)]
Fix install dirs to use CMAKE_INSTALL

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoDO_NOT_SANITIZE_ADDRESS_ATTRIBUTE
Pavel Filipenský [Fri, 9 Sep 2022 08:57:02 +0000 (10:57 +0200)]
DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAdd pwrap_bind_symbol_all()
Pavel Filipenský [Fri, 9 Sep 2022 12:48:51 +0000 (14:48 +0200)]
Add pwrap_bind_symbol_all()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoUncomment: "-Wcast-qual" SUPPORTED_COMPILER_FLAGS
Pavel Filipenský [Fri, 9 Sep 2022 09:38:00 +0000 (11:38 +0200)]
Uncomment: "-Wcast-qual" SUPPORTED_COMPILER_FLAGS

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoadd_library(defaults INTERFACE) instead of DEFAULT_C_COMPILE_FLAGS
Pavel Filipenský [Fri, 9 Sep 2022 08:43:25 +0000 (10:43 +0200)]
add_library(defaults INTERFACE) instead of DEFAULT_C_COMPILE_FLAGS

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAdd PRIV_WRAPPER_DISABLE_DEEPBIND
Pavel Filipenský [Fri, 9 Sep 2022 09:04:18 +0000 (11:04 +0200)]
Add PRIV_WRAPPER_DISABLE_DEEPBIND

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoSync with socket_wrapper: tests/CMakeLists.txt
Pavel Filipenský [Wed, 7 Sep 2022 08:15:54 +0000 (10:15 +0200)]
Sync with socket_wrapper: tests/CMakeLists.txt

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoDefineInstallationPaths -> GNUInstallDirs
Pavel Filipenský [Wed, 7 Sep 2022 06:27:16 +0000 (08:27 +0200)]
DefineInstallationPaths -> GNUInstallDirs

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoSync with socket_wrapper: CompilerChecks.cmake
Pavel Filipenský [Wed, 7 Sep 2022 08:09:06 +0000 (10:09 +0200)]
Sync with socket_wrapper: CompilerChecks.cmake

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoGitLab CI: limit commit history: ~20 -> ~10
Pavel Filipenský [Fri, 9 Sep 2022 07:37:50 +0000 (09:37 +0200)]
GitLab CI: limit commit history: ~20 -> ~10

Fix fedora/csbuild:
/usr/bin/csbuild: fatal error: pathspec 'f1dea519a459b21e1616fb1d2c620c72f8c07714~20' did not match any file(s) known to git

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAdd gitlab CI
Pavel Filipenský [Mon, 5 Sep 2022 11:45:19 +0000 (13:45 +0200)]
Add gitlab CI

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAdd test_setrlimit
Pavel Filipenský [Thu, 1 Sep 2022 10:59:57 +0000 (12:59 +0200)]
Add test_setrlimit

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAdd test_prctl
Pavel Filipenský [Wed, 31 Aug 2022 13:41:57 +0000 (15:41 +0200)]
Add test_prctl

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAdd test_chroot
Pavel Filipenský [Wed, 31 Aug 2022 11:35:05 +0000 (13:35 +0200)]
Add test_chroot

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoHowto: Steps to run unit tests
Pavel Filipenský [Wed, 31 Aug 2022 14:56:34 +0000 (16:56 +0200)]
Howto: Steps to run unit tests

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAdd comments explaining the behavior of some prctl options
Pavel Filipenský [Thu, 1 Sep 2022 12:53:22 +0000 (14:53 +0200)]
Add comments explaining the behavior of some prctl options

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agodoc: Update manpage source priv_wrapper.1.txt and generate the manpage via "a2x ...
Pavel Filipenský [Fri, 2 Sep 2022 13:09:28 +0000 (15:09 +0200)]
doc: Update manpage source priv_wrapper.1.txt and generate the manpage via "a2x --format manpage doc/priv_wrapper.1.txt"

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoUpdate date in priv_wrapper.1*
Pavel Filipenský [Mon, 5 Sep 2022 11:59:39 +0000 (13:59 +0200)]
Update date in priv_wrapper.1*

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAUTHORS
Pavel Filipenský [Wed, 7 Sep 2022 08:09:06 +0000 (10:09 +0200)]
AUTHORS

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoAdd editorconfig
Pavel Filipenský [Wed, 31 Aug 2022 13:06:29 +0000 (15:06 +0200)]
Add editorconfig

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoFix initial commit: Remove priv_handle
Pavel Filipenský [Fri, 9 Sep 2022 09:03:40 +0000 (11:03 +0200)]
Fix initial commit: Remove priv_handle

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoFix initial commit: !priv_wrapper_enabled() in privwrap_setrlimit()
Pavel Filipenský [Thu, 1 Sep 2022 10:59:57 +0000 (12:59 +0200)]
Fix initial commit: !priv_wrapper_enabled() in privwrap_setrlimit()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoFix initial commit: s/HAVE_PRCTL/HAVE_SETRLIMIT/
Pavel Filipenský [Wed, 31 Aug 2022 19:46:24 +0000 (21:46 +0200)]
Fix initial commit: s/HAVE_PRCTL/HAVE_SETRLIMIT/

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agoFix initial commit: Rename various 'socket' based names to 'priv'.
Pavel Filipenský [Mon, 29 Aug 2022 12:34:30 +0000 (14:34 +0200)]
Fix initial commit: Rename various 'socket' based names to 'priv'.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
19 months agoBig bang!
Andreas Schneider [Fri, 26 Oct 2018 09:07:34 +0000 (11:07 +0200)]
Big bang!

Pair-Programmed-With: Nikos Mavrogiannopoulos
Signed-off-by: Andreas Schneider <asn@samba.org>