Andreas Schneider [Fri, 14 Jul 2017 07:07:19 +0000 (09:07 +0200)]
uwrap: Do not leak groups_str
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 12 Jul 2017 11:03:35 +0000 (13:03 +0200)]
Bump version to 1.2.2
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 12 Jul 2017 07:16:30 +0000 (09:16 +0200)]
tests: Add a fork and exec test
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 11 Jul 2017 09:59:33 +0000 (11:59 +0200)]
uwrap: Add support to initialize groups while forking
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Michael Adam [Thu, 22 Sep 2016 00:29:34 +0000 (02:29 +0200)]
tests: fix a comment typo
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Matt Turner [Tue, 5 Apr 2016 20:28:56 +0000 (13:28 -0700)]
tests: Use alpha-specific syscalls.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11821
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Matt Turner [Tue, 5 Apr 2016 20:28:30 +0000 (13:28 -0700)]
uwrap: Use alpha-specific syscalls.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11821
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Matt Turner [Tue, 5 Apr 2016 20:41:13 +0000 (13:41 -0700)]
uwrap: Attempt to dlopen libc.so.*.1 as a fallback.
glibc on Alpha and IA64 is libc.so.6.1.
Without this, uwrap.libc.handle is set to RTLD_NEXT, leading to a
segmentation fault in the unit tests when dlclose() is called.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11821
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Andreas Schneider [Wed, 16 Mar 2016 13:53:37 +0000 (14:53 +0100)]
Bump version to 1.2.1
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 13 Nov 2015 12:46:24 +0000 (13:46 +0100)]
uwrap: Make sure prefix is not used uninitialized
Signed-off-by: Andreas Schneider <asn@samba.org>
Andreas Schneider [Tue, 3 Nov 2015 09:54:07 +0000 (10:54 +0100)]
doc: Document missing options
Signed-off-by: Andreas Schneider <asn@samba.org>
Andreas Schneider [Thu, 29 Oct 2015 07:21:21 +0000 (08:21 +0100)]
Bump version to 1.2.0
Signed-off-by: Andreas Schneider <asn@samba.org>
Andreas Schneider [Thu, 29 Oct 2015 07:16:32 +0000 (08:16 +0100)]
tests: Add checks for return values in test_thread_setreuid
CID #131817
Signed-off-by: Andreas Schneider <asn@samba.org>
Andreas Schneider [Wed, 28 Oct 2015 08:34:18 +0000 (09:34 +0100)]
tests: Rename test_syscall_gid32 to test_syscall_setgroups32
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 28 Oct 2015 08:33:16 +0000 (09:33 +0100)]
tests: Move syscall setregid32 test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 28 Oct 2015 08:23:23 +0000 (09:23 +0100)]
tests: Move syscall setregid32 test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 28 Oct 2015 07:36:53 +0000 (08:36 +0100)]
tests: Move syscall setgid32 test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 28 Oct 2015 07:26:32 +0000 (08:26 +0100)]
tests: Rename syscall setresuid32 test and improve it
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 28 Oct 2015 07:19:43 +0000 (08:19 +0100)]
tests: Move syscall setreuid32 test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 28 Oct 2015 07:15:37 +0000 (08:15 +0100)]
tests: Move syscall setuid32 test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 28 Oct 2015 07:05:11 +0000 (08:05 +0100)]
uwrap: Fix build warning with release build
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 28 Oct 2015 08:24:08 +0000 (09:24 +0100)]
Ignore build and all obj* directories
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Mon, 12 Oct 2015 16:41:16 +0000 (18:41 +0200)]
cmake: Run threaded tests also on BSD and Solaris
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Thu, 8 Oct 2015 15:03:48 +0000 (17:03 +0200)]
tests: Get the tests working on BSD
The setuid and seteuid behaviour is different to Linux and Solaris.
The setuid euid tests on BSD look like a bug?
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 9 Oct 2015 11:22:35 +0000 (13:22 +0200)]
tests: Rename test_gid to test_setgroups
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 27 Oct 2015 09:42:35 +0000 (10:42 +0100)]
tests: Add setresgid unprivileged user test
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 9 Oct 2015 11:21:20 +0000 (13:21 +0200)]
tests: Move setresgid test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 9 Oct 2015 11:10:23 +0000 (13:10 +0200)]
tests: Move setregid test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 9 Oct 2015 07:40:14 +0000 (09:40 +0200)]
tests: Move setegid test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 9 Oct 2015 07:31:10 +0000 (09:31 +0200)]
tests: Move setgid test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Thu, 8 Oct 2015 13:23:24 +0000 (15:23 +0200)]
tests: Add new test_setuid_euid1 and test_setuid_euid2
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 27 Oct 2015 09:19:57 +0000 (10:19 +0100)]
tests: Create a test for threaded SYS_setuid
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 27 Oct 2015 09:18:54 +0000 (10:18 +0100)]
tests: Fix test_syscall_setuid to work with privilege checks
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 23 Sep 2015 12:06:20 +0000 (14:06 +0200)]
tests: Create a test for threaded sync SYS_setreuid
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 27 Oct 2015 09:21:26 +0000 (10:21 +0100)]
tests: Create a test for threaded SYS_setreuid
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 27 Oct 2015 09:20:53 +0000 (10:20 +0100)]
tests: Fix test_syscall_setreuid to work with privilege checks
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 22 Sep 2015 15:41:04 +0000 (17:41 +0200)]
tests: Make syscall setresuid test from test_syscall_uid
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 22 Sep 2015 15:33:04 +0000 (17:33 +0200)]
tests: Move syscall setreuid test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 22 Sep 2015 15:21:11 +0000 (17:21 +0200)]
tests: Add test_getresuid out of test_uid
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 22 Sep 2015 14:55:43 +0000 (16:55 +0200)]
tests: Move setresuid test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 22 Sep 2015 12:29:49 +0000 (14:29 +0200)]
tests: Move setreuid test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 22 Sep 2015 12:21:17 +0000 (14:21 +0200)]
tests: Move seteuid test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 22 Sep 2015 12:17:28 +0000 (14:17 +0200)]
tests: Move setuid test to own executable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 18 Sep 2015 14:23:17 +0000 (16:23 +0200)]
cmake: Always set UID_WRAPPER_ROOT=1 for tests
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 9 Oct 2015 07:14:34 +0000 (09:14 +0200)]
uwrap: Add the EINVAL check to setegid()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 9 Oct 2015 07:17:16 +0000 (09:17 +0200)]
uwrap: Allow setgid calls only for privileged users
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 9 Oct 2015 07:13:27 +0000 (09:13 +0200)]
uwrap: Allow setregid calls only for privileged users
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 9 Oct 2015 07:08:21 +0000 (09:08 +0200)]
uwrap: Allow setresgid calls only for privileged users
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Thu, 8 Oct 2015 14:52:00 +0000 (16:52 +0200)]
uwrap: Move the EINVAL check down in seteuid()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Thu, 8 Oct 2015 14:55:01 +0000 (16:55 +0200)]
uwrap: Allow setuid calls only for privileged users
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Thu, 8 Oct 2015 14:50:01 +0000 (16:50 +0200)]
uwrap: Allow setreuid calls only for privileged users
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Thu, 8 Oct 2015 14:46:27 +0000 (16:46 +0200)]
uwrap: Allow setresuid calls only for privileged users
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 20 Oct 2015 13:06:02 +0000 (15:06 +0200)]
uwrap: Fix a possible null pointer dereference
If uid_wrapper is loaded but not enabled (UID_WRAPPER environment
variable not set), then we dereference a NULL pointer while forking.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 22 Sep 2015 15:11:57 +0000 (17:11 +0200)]
uwrap: Improve debug output
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 22 Sep 2015 15:06:01 +0000 (17:06 +0200)]
uwrap: Fix debug line in uwrap_init()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Thu, 20 Aug 2015 08:20:31 +0000 (10:20 +0200)]
Bump version to 1.1.1
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Tue, 18 Aug 2015 10:32:03 +0000 (12:32 +0200)]
doc: Make the manpage reproducible
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Andreas Schneider [Tue, 18 Aug 2015 08:10:41 +0000 (10:10 +0200)]
tests: Fix tests on Solaris
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Andreas Schneider [Mon, 17 Aug 2015 08:43:55 +0000 (10:43 +0200)]
uwrap: Removed double newline
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 14 Aug 2015 07:04:13 +0000 (09:04 +0200)]
tests: Add 32bit syscall gid tests
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 14 Aug 2015 07:01:02 +0000 (09:01 +0200)]
tests: Improve syscall gid tests
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 14 Aug 2015 06:52:08 +0000 (08:52 +0200)]
tests: Add 32bit syscall uid tests
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 14 Aug 2015 06:43:55 +0000 (08:43 +0200)]
tests: Improve syscall uid tests
The plan is to have a 32bit version compiled dependent on the support
for it.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 14 Aug 2015 06:27:14 +0000 (08:27 +0200)]
tests: Rename testsuite to test_syscall_gid
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 14 Aug 2015 06:26:17 +0000 (08:26 +0200)]
tests: Move syscall uid tests to own test
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 14 Aug 2015 06:20:57 +0000 (08:20 +0200)]
tests: Move syscall test to own test
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 14 Aug 2015 06:17:34 +0000 (08:17 +0200)]
tests: Move set(re)gid function to own test
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 14 Aug 2015 06:11:58 +0000 (08:11 +0200)]
tests: Move set(re)uid function to own test
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Wed, 12 Aug 2015 08:21:36 +0000 (10:21 +0200)]
cmake: Do not optimize the code by default
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Fri, 31 Jul 2015 12:25:21 +0000 (14:25 +0200)]
tests: Add test_uwrap_syscall_setresuid()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Fri, 31 Jul 2015 12:11:45 +0000 (14:11 +0200)]
tests: Fix syscall detection
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Fri, 31 Jul 2015 12:07:20 +0000 (14:07 +0200)]
tests: Add test for syscall SYS_setresgid
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Fri, 31 Jul 2015 12:03:19 +0000 (14:03 +0200)]
tests: Update to new cmocka test runner
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Fri, 23 Jan 2015 15:01:49 +0000 (16:01 +0100)]
uwrap: Fix build if getres(uid|gid) are not available.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Wed, 25 Feb 2015 10:21:19 +0000 (11:21 +0100)]
cmake: Drop test results via https.
Signed-off-by: Andreas Schneider <asn@samba.org>
Andreas Schneider [Mon, 19 Jan 2015 16:06:10 +0000 (17:06 +0100)]
Bump version to 1.1.0.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Andreas Schneider [Thu, 8 Jan 2015 09:10:52 +0000 (10:10 +0100)]
uwrap: Make sure we leave if the id is NULL.
CID #97616
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Fri, 5 Dec 2014 09:51:15 +0000 (10:51 +0100)]
tests: Add new test_thread_create_thread_setgid.
Test aims case where thread change uid/gid and then create new thread.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Tue, 21 Oct 2014 06:55:56 +0000 (08:55 +0200)]
uwrap: Support scenario where threads fork or creates threads.
When fork() is called here there is no need to disable uwrap as a whole.
This change disables only uwrap for the thread which called fork().
uwrap catches calls of pthread_create() and pthread_exit() functions
from libpthread library now.
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Tue, 16 Dec 2014 11:09:55 +0000 (12:09 +0100)]
uwrap: Prepare for overload of libpthread functions.
uwrap_bind_symbol are now renamed to uwrap_bind_symbol_libc
and simlilar uwrap_bind_symbol_libpthread are introduced.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Tue, 16 Dec 2014 11:00:31 +0000 (12:00 +0100)]
uwrap: Introduce UWRAP_LOCK_ALL and UWRAP_UNLOCK_ALL macros
Introduce UWRAP_LOCK_ALL and UWRAP_UNLOCK_ALL which make
locking easier.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Wed, 29 Oct 2014 09:29:27 +0000 (10:29 +0100)]
uwrap: Rewrite uwrap_libc_fns struct to pass strict aliasing rules.
Now uwrap is compiled with -O2 -fstrict-aliasing -Wstrict-aliasing=2
C compiler flags.
Also rename struct uwrap_libc_fns fns to uwrap_libc_symbols and
uwrap_load_lib_function to uwrap_bind_symbol (same for _uwrap_load_...
variant.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Thu, 16 Oct 2014 10:23:53 +0000 (12:23 +0200)]
uwrap: Fix wrong data types in syscalls switch.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Tue, 21 Oct 2014 06:54:04 +0000 (08:54 +0200)]
tests: Add new test_uwrap_getresuid().
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Tue, 21 Oct 2014 06:53:32 +0000 (08:53 +0200)]
uwrap: Add support for getresuid() and getresgid() glibc/syscall.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Tue, 21 Oct 2014 06:36:52 +0000 (08:36 +0200)]
tests: Add new test test_sync_setgroups().
This test is almost same as test_sync_setgid but covers the setgroups
function.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Tue, 21 Oct 2014 06:35:45 +0000 (08:35 +0200)]
uwrap: Extend support for (set|get)groups libc functions and syscalls.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Wed, 15 Oct 2014 08:20:31 +0000 (10:20 +0200)]
tests: Fix test_uwrap_getgroups.
This test doesn't run on machines if there are more than one
supplementary group.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Tue, 21 Oct 2014 06:34:16 +0000 (08:34 +0200)]
tests: Add test_real_sync_setuid().
This also extends test_syscall_setreuid().
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Tue, 21 Oct 2014 06:33:24 +0000 (08:33 +0200)]
uwrap: Extend support for syscalls called from threads or main process.
We need to distinguish if the syscall is called from main process or
from a thread.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Thu, 2 Oct 2014 13:45:09 +0000 (15:45 +0200)]
uwrap: Small uwrap_init optimalization.
Don't call libc_getuid/getgid function twice.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Wed, 1 Oct 2014 07:08:02 +0000 (09:08 +0200)]
uwrap: Add more authors to AUTHORS file.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Tue, 30 Sep 2014 11:58:40 +0000 (13:58 +0200)]
tests: Enable test_glibc_thread_support.c on MacOSX.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Andreas Schneider [Mon, 20 Oct 2014 07:22:42 +0000 (09:22 +0200)]
src: Add support for running with address sanitizer.
It address sanitzer will complain about our hack with variable function
attributes. This disables the checking of it.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Mon, 29 Sep 2014 07:53:21 +0000 (09:53 +0200)]
uwrap: Reflect changes of uid/gid in threads to main process.
When thread changes uid/gid this change must be reflected to main
process.
Syscalls changes only uid/gid of thread. Call of libc functions changes
also uid/gid of main process.
TESTS: Fix test_sync_setgid_syscall in test_glibc_thread_support.c
When changes of gid (and uid of course) is reflected to main process
test must check if call of setgid syscall changes gid of thread ONLY.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Sun, 28 Sep 2014 19:19:13 +0000 (21:19 +0200)]
tests: Extend test_sync_setgid in test_glibc_thread_support.c
Extend test to case when thread changes gid of main process.
After this change main process start new thread which should have
same gid set as a main process.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Fri, 26 Sep 2014 14:25:58 +0000 (16:25 +0200)]
uwrap: Small optimalization of uwrap_init().
Don't call getenv("UID_WRAPPER") on start of uwrap_init().
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Fri, 26 Sep 2014 14:19:09 +0000 (16:19 +0200)]
tests: test_glibc_thread_support: Add bigger load.
This can help (and helped) with revealing race conditions.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Fri, 26 Sep 2014 14:17:18 +0000 (16:17 +0200)]
tests: Added two new tests aimed to setgid() and getgid() functions.
New tests:
* test_sync_setgid - test if call of setgid() in thread changes gid
of main process
* test_sync_setgid_syscall - test setgid() syscall
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Robin Hack [Fri, 26 Sep 2014 13:25:09 +0000 (15:25 +0200)]
tests: Small phtread_attr cleanup.
This change should make valgrind happy.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>