uid_wrapper.git
8 years agotests: Move set(re)uid function to own test
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>
8 years agocmake: Do not optimize the code by default
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>
8 years agotests: Add test_uwrap_syscall_setresuid()
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>
8 years agotests: Fix syscall detection
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>
8 years agotests: Add test for syscall SYS_setresgid
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>
8 years agotests: Update to new cmocka test runner
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>
8 years agouwrap: Fix build if getres(uid|gid) are not available.
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>
9 years agocmake: Drop test results via https.
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>
9 years agoBump version to 1.1.0. uid_wrapper-1.1.0
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>
9 years agouwrap: Make sure we leave if the id is NULL.
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>
9 years agotests: Add new test_thread_create_thread_setgid.
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>
9 years agouwrap: Support scenario where threads fork or creates threads.
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>
9 years agouwrap: Prepare for overload of libpthread functions.
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>
9 years agouwrap: Introduce UWRAP_LOCK_ALL and UWRAP_UNLOCK_ALL macros
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>
9 years agouwrap: Rewrite uwrap_libc_fns struct to pass strict aliasing rules.
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>
9 years agouwrap: Fix wrong data types in syscalls switch.
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>
9 years agotests: Add new test_uwrap_getresuid().
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>
9 years agouwrap: Add support for getresuid() and getresgid() glibc/syscall.
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>
9 years agotests: Add new test test_sync_setgroups().
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>
9 years agouwrap: Extend support for (set|get)groups libc functions and syscalls.
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>
9 years agotests: Fix test_uwrap_getgroups.
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>
9 years agotests: Add test_real_sync_setuid().
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>
9 years agouwrap: Extend support for syscalls called from threads or main process.
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>
9 years agouwrap: Small uwrap_init optimalization.
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>
9 years agouwrap: Add more authors to AUTHORS file.
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>
9 years agotests: Enable test_glibc_thread_support.c on MacOSX.
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>
9 years agosrc: Add support for running with address sanitizer.
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>
9 years agouwrap: Reflect changes of uid/gid in threads to main process.
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>
9 years agotests: Extend test_sync_setgid in test_glibc_thread_support.c
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>
9 years agouwrap: Small optimalization of uwrap_init().
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>
9 years agotests: test_glibc_thread_support: Add bigger load.
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>
9 years agotests: Added two new tests aimed to setgid() and getgid() functions.
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>
9 years agotests: Small phtread_attr cleanup.
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>
9 years agotests: Get rid of malloc calls in test_glibc_thread_support.c.
Robin Hack [Fri, 26 Sep 2014 12:31:39 +0000 (14:31 +0200)]
tests: Get rid of malloc calls in test_glibc_thread_support.c.

Thread structures are allocated on stack now.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agouwrap: Optimalization of uid_wrapper_enabled() function.
Robin Hack [Fri, 26 Sep 2014 12:00:27 +0000 (14:00 +0200)]
uwrap: Optimalization of uid_wrapper_enabled() function.

Check only bool variable inside uwrap structure instead
of calling whole uid_init().

In the best case only one mutex lock is need when check.

NOTES:
 * This patch uses __atomic_load gcc builtin function.
 * uid_init() were moved outside uid_wrapper_enabled() function.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agouid_wrapper: Fix race condition - uwrap_init.
Robin Hack [Fri, 26 Sep 2014 11:26:17 +0000 (13:26 +0200)]
uid_wrapper: Fix race condition - uwrap_init.

Patch moves uwrap_id_mutex before if (uwrap.initialised) statement
which can be passed by concurrent threads.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agouwrap: Fix race condition - glibc lookups.
Robin Hack [Fri, 26 Sep 2014 11:05:43 +0000 (13:05 +0200)]
uwrap: Fix race condition - glibc lookups.

Patch adds libc_symbol_binding_mutex which guards global table of libc
functions and their lookup.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agouwrap: Add library constructor and move pthread_atfork inside.
Robin Hack [Fri, 26 Sep 2014 10:33:21 +0000 (12:33 +0200)]
uwrap: Add library constructor and move pthread_atfork inside.

Library constructor is used for pthread_atfork call. Moved here because
pthread_atfork is cumulative and should be called only once.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agouwrap: Use UWRAP_LOCK/UNLOCK macros instead of pthread_mutex_lock/unlock calls.
Robin Hack [Fri, 26 Sep 2014 10:08:58 +0000 (12:08 +0200)]
uwrap: Use UWRAP_LOCK/UNLOCK macros instead of pthread_mutex_lock/unlock calls.

New macros UWRAP_LOCK/UNLOCK has been created and all calls to
pthread_mutex_lock/unlock has been replaced by these macros.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agouwrap: Fix the handle loop for older gcc versions.
Andreas Schneider [Wed, 1 Oct 2014 15:17:43 +0000 (17:17 +0200)]
uwrap: Fix the handle loop for older gcc versions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoTESTS: SYS_gettimeofday behaves differently on OS X
Jakub Hrozek [Sat, 23 Aug 2014 22:52:26 +0000 (00:52 +0200)]
TESTS: SYS_gettimeofday behaves differently on OS X

SYS_gettimeofday returns the number of seconds on OS X and doesn't set
the tz parameter.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoTESTS: add -DOSX if building on OS X
Jakub Hrozek [Sat, 23 Aug 2014 22:50:18 +0000 (00:50 +0200)]
TESTS: add -DOSX if building on OS X

We need some OS X specific branch in the tests.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotestsuite: Fix comparison
Jakub Hrozek [Sat, 23 Aug 2014 22:54:18 +0000 (00:54 +0200)]
testsuite: Fix comparison

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Remove test with legacy "access" system call.
Marcin Juszkiewicz [Mon, 4 Aug 2014 09:56:50 +0000 (11:56 +0200)]
tests: Remove test with legacy "access" system call.

AArch64 architecture does not implement legacy system calls and as a
result SYS_access is not defined (as it got replaced with "accessat"
syscall).

Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoBump version to 1.0.2. uid_wrapper-1.0.2
Andreas Schneider [Wed, 30 Jul 2014 12:48:04 +0000 (14:48 +0200)]
Bump version to 1.0.2.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agouwrap: Support dropping all supplemetary groups with setgroups()
Jakub Hrozek [Tue, 29 Jul 2014 17:20:07 +0000 (19:20 +0200)]
uwrap: Support dropping all supplemetary groups with setgroups()

Dropping all supplementary groups is a common practice when changing
UIDs. This patch adds support for dropping all supplementary groups when
setgroups is called with size=0.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
tests: Fix test for dopping supplementary groups.

Signed-off-by: Andreas Schneider <asn@samba.org>
9 years agodoc: Add a manpage for uid_wrapper.
Andreas Schneider [Thu, 10 Jul 2014 15:09:50 +0000 (17:09 +0200)]
doc: Add a manpage for uid_wrapper.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agouwrap: Add logging if uwrap is enabled correctly.
Andreas Schneider [Fri, 30 May 2014 13:52:19 +0000 (15:52 +0200)]
uwrap: Add logging if uwrap is enabled correctly.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agouwrap: Log error if we are out of memory.
Andreas Schneider [Fri, 30 May 2014 13:52:00 +0000 (15:52 +0200)]
uwrap: Log error if we are out of memory.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agouwrap: Add a better logging function.
Andreas Schneider [Fri, 30 May 2014 13:44:39 +0000 (15:44 +0200)]
uwrap: Add a better logging function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agocmake: Check for HAVE_FUNCTION_ATTRIBUTE_FORMAT.
Andreas Schneider [Fri, 30 May 2014 13:59:17 +0000 (15:59 +0200)]
cmake: Check for HAVE_FUNCTION_ATTRIBUTE_FORMAT.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agouwrap: Fall back to RTLD_NEXT if we can't find libc.
Andreas Schneider [Tue, 29 Apr 2014 13:11:40 +0000 (15:11 +0200)]
uwrap: Fall back to RTLD_NEXT if we can't find libc.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agouwrap: Add mutex in uwrap_destructor().
Andreas Schneider [Fri, 9 May 2014 15:10:57 +0000 (17:10 +0200)]
uwrap: Add mutex in uwrap_destructor().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agocmake: Fix a typo in uid_wrapper-config.cmake.in.
Andreas Schneider [Wed, 28 May 2014 14:13:22 +0000 (16:13 +0200)]
cmake: Fix a typo in uid_wrapper-config.cmake.in.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoAdd README.install - instructions for building and installing.
Michael Adam [Tue, 27 May 2014 21:23:58 +0000 (23:23 +0200)]
Add README.install - instructions for building and installing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agocmake: Fix policy check.
Andreas Schneider [Fri, 25 Apr 2014 12:00:39 +0000 (14:00 +0200)]
cmake: Fix policy check.

10 years agocmake: Install cmake config into the correct directory.
Andreas Schneider [Wed, 16 Apr 2014 13:47:34 +0000 (15:47 +0200)]
cmake: Install cmake config into the correct directory.

10 years agocmake: Use 2.8.13 as version to check.
Andreas Schneider [Wed, 9 Apr 2014 10:00:25 +0000 (12:00 +0200)]
cmake: Use 2.8.13 as version to check.

10 years agouwrap: Fix memory leak on error.
Andreas Schneider [Tue, 8 Apr 2014 07:24:42 +0000 (09:24 +0200)]
uwrap: Fix memory leak on error.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agocmake: Only set policy in cmake 3.0.
Andreas Schneider [Tue, 8 Apr 2014 07:24:21 +0000 (09:24 +0200)]
cmake: Only set policy in cmake 3.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
10 years agocmake: Fix configure warning with cmake 3.0.
Andreas Schneider [Mon, 7 Apr 2014 10:17:16 +0000 (12:17 +0200)]
cmake: Fix configure warning with cmake 3.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
10 years agocmake: Create the compile command database by default.
Andreas Schneider [Mon, 7 Apr 2014 10:17:01 +0000 (12:17 +0200)]
cmake: Create the compile command database by default.

Signed-off-by: Andreas Schneider <asn@samba.org>
10 years agoBump version to 1.0.1. uid_wrapper-1.0.1
Andreas Schneider [Tue, 4 Feb 2014 11:39:33 +0000 (12:39 +0100)]
Bump version to 1.0.1.

10 years agocmake: Add uid_wrapper-config.cmake.
Andreas Schneider [Tue, 4 Feb 2014 11:37:30 +0000 (12:37 +0100)]
cmake: Add uid_wrapper-config.cmake.

10 years agocmake: Use UID_WRAPPER_LOCATION.
Andreas Schneider [Tue, 4 Feb 2014 11:35:11 +0000 (12:35 +0100)]
cmake: Use UID_WRAPPER_LOCATION.

10 years agocmake: Add --libs output for pkg-config.
Andreas Schneider [Tue, 4 Feb 2014 11:32:49 +0000 (12:32 +0100)]
cmake: Add --libs output for pkg-config.

10 years agocpack: Don't package the obj directory.
Andreas Schneider [Tue, 4 Feb 2014 11:38:11 +0000 (12:38 +0100)]
cpack: Don't package the obj directory.

10 years agotests: Use bool in the prototype too.
Andreas Schneider [Mon, 3 Feb 2014 21:16:15 +0000 (22:16 +0100)]
tests: Use bool in the prototype too.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agotests: Use a bool for the test_uwrap_enabled test. uid_wrapper-1.0.0
Andreas Schneider [Sun, 2 Feb 2014 07:54:27 +0000 (08:54 +0100)]
tests: Use a bool for the test_uwrap_enabled test.

Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agosrc: Use a bool for uid_wrapper_enabled().
Andreas Schneider [Sat, 1 Feb 2014 13:32:03 +0000 (14:32 +0100)]
src: Use a bool for uid_wrapper_enabled().

Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoAdd ChangeLog.
Andreas Schneider [Thu, 30 Jan 2014 17:15:14 +0000 (18:15 +0100)]
Add ChangeLog.

10 years agoAdd TODO
Andreas Schneider [Fri, 24 Jan 2014 09:47:09 +0000 (10:47 +0100)]
Add TODO

10 years agocmake: Add cmake version file.
Andreas Schneider [Mon, 20 Jan 2014 11:43:21 +0000 (12:43 +0100)]
cmake: Add cmake version file.

10 years agocmake: Add a pkg-config file.
Andreas Schneider [Mon, 20 Jan 2014 11:43:08 +0000 (12:43 +0100)]
cmake: Add a pkg-config file.

10 years agoUpdate README.
Andreas Schneider [Sun, 19 Jan 2014 19:23:01 +0000 (20:23 +0100)]
Update README.

10 years agouwrap: Rename uwrap_enabled() to uid_wrapper_enabled().
Andreas Schneider [Fri, 17 Jan 2014 14:30:32 +0000 (15:30 +0100)]
uwrap: Rename uwrap_enabled() to uid_wrapper_enabled().

10 years agouwrap: Rename the variable to get myuid from geteuid().
Andreas Schneider [Tue, 7 Jan 2014 12:31:58 +0000 (13:31 +0100)]
uwrap: Rename the variable to get myuid from geteuid().

10 years agouwrap: Make uwrap_enabled public so we can use it.
Andreas Schneider [Tue, 7 Jan 2014 12:30:06 +0000 (13:30 +0100)]
uwrap: Make uwrap_enabled public so we can use it.

10 years agotests: Fix some memory leaks.
Andreas Schneider [Fri, 20 Dec 2013 12:18:46 +0000 (13:18 +0100)]
tests: Fix some memory leaks.

10 years agocmake: Add valgrind suppression file.
Andreas Schneider [Fri, 20 Dec 2013 12:18:34 +0000 (13:18 +0100)]
cmake: Add valgrind suppression file.

10 years agouwrap: Pass bool values to uwrap_new_id().
Andreas Schneider [Fri, 20 Dec 2013 12:03:04 +0000 (13:03 +0100)]
uwrap: Pass bool values to uwrap_new_id().

10 years agouwrap: Fix a memory leak when we reuse an allocated id.
Andreas Schneider [Fri, 20 Dec 2013 12:02:37 +0000 (13:02 +0100)]
uwrap: Fix a memory leak when we reuse an allocated id.

10 years agouwrap: Add a destructor to free resources.
Andreas Schneider [Fri, 20 Dec 2013 12:02:03 +0000 (13:02 +0100)]
uwrap: Add a destructor to free resources.

10 years agocmake: Add check for HAVE_DESTRUCTOR_ATTRIBUTE.
Andreas Schneider [Fri, 20 Dec 2013 12:01:27 +0000 (13:01 +0100)]
cmake: Add check for HAVE_DESTRUCTOR_ATTRIBUTE.

10 years agouwrap: Use realloc for setgroups().
Andreas Schneider [Fri, 20 Dec 2013 11:54:14 +0000 (12:54 +0100)]
uwrap: Use realloc for setgroups().

10 years agouwrap: Fix loading the system libraries.
Andreas Schneider [Fri, 20 Dec 2013 10:09:15 +0000 (11:09 +0100)]
uwrap: Fix loading the system libraries.

Thanks metze!

10 years agotests: Add test_uwrap_disabled.
Andreas Schneider [Thu, 19 Dec 2013 08:52:22 +0000 (09:52 +0100)]
tests: Add test_uwrap_disabled.

10 years agotestsuite: Add missing include.
Andreas Schneider [Thu, 19 Dec 2013 08:52:05 +0000 (09:52 +0100)]
testsuite: Add missing include.

10 years agocmake: Fix HAVE_SETRESUID and HAVE_SETRESGID.
Andreas Schneider [Thu, 19 Dec 2013 07:46:45 +0000 (08:46 +0100)]
cmake: Fix HAVE_SETRESUID and HAVE_SETRESGID.

10 years agotests: Add test_uwrap_syscall_setgroups().
Andreas Schneider [Wed, 18 Dec 2013 16:23:31 +0000 (17:23 +0100)]
tests: Add test_uwrap_syscall_setgroups().

10 years agotests: Add test_uwrap_setresuid().
Andreas Schneider [Wed, 18 Dec 2013 16:11:14 +0000 (17:11 +0100)]
tests: Add test_uwrap_setresuid().

10 years agotests: Add test_uwrap_setreuid().
Andreas Schneider [Wed, 18 Dec 2013 16:09:15 +0000 (17:09 +0100)]
tests: Add test_uwrap_setreuid().

10 years agotests: Add test_uwrap_setresgid().
Andreas Schneider [Wed, 18 Dec 2013 16:06:46 +0000 (17:06 +0100)]
tests: Add test_uwrap_setresgid().

10 years agotests: Add test_uwrap_setregid().
Andreas Schneider [Wed, 18 Dec 2013 15:59:54 +0000 (16:59 +0100)]
tests: Add test_uwrap_setregid().

10 years agotests: The tests should always be executed with uid_wrapper.
Andreas Schneider [Wed, 18 Dec 2013 15:53:17 +0000 (16:53 +0100)]
tests: The tests should always be executed with uid_wrapper.

10 years agonwrap: Fix prototype of libc_setresuid().
Andreas Schneider [Wed, 18 Dec 2013 16:05:57 +0000 (17:05 +0100)]
nwrap: Fix prototype of libc_setresuid().

10 years agocmake: Fix defines for setres(u|g)id.
Andreas Schneider [Wed, 18 Dec 2013 16:02:08 +0000 (17:02 +0100)]
cmake: Fix defines for setres(u|g)id.

10 years agouwrap: Remove obsolete uwrap_libc_fn().
Andreas Schneider [Tue, 17 Dec 2013 12:39:42 +0000 (13:39 +0100)]
uwrap: Remove obsolete uwrap_libc_fn().

10 years agouwrap: Load libc_syscall correctly.
Andreas Schneider [Tue, 17 Dec 2013 12:38:30 +0000 (13:38 +0100)]
uwrap: Load libc_syscall correctly.

10 years agouwrap: Add libc_getgroups().
Andreas Schneider [Tue, 17 Dec 2013 12:36:15 +0000 (13:36 +0100)]
uwrap: Add libc_getgroups().