obnox/cwrap/uid_wrapper.git
4 years agoAdd README.install - instructions for building and installing. master
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>
4 years agocmake: Fix policy check.
Andreas Schneider [Fri, 25 Apr 2014 12:00:39 +0000 (14:00 +0200)]
cmake: Fix policy check.

5 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.

5 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.

5 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>
5 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>
5 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>
5 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>
5 years agoBump version to 1.0.1.
Andreas Schneider [Tue, 4 Feb 2014 11:39:33 +0000 (12:39 +0100)]
Bump version to 1.0.1.

5 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.

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

5 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.

5 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.

5 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>
5 years agotests: Use a bool for the test_uwrap_enabled test.
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>
5 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>
5 years agoAdd ChangeLog.
Andreas Schneider [Thu, 30 Jan 2014 17:15:14 +0000 (18:15 +0100)]
Add ChangeLog.

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

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

5 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.

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

5 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().

5 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().

5 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.

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

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

5 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().

5 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.

5 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.

5 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.

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

5 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!

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

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

5 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.

5 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().

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

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

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

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

5 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.

5 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().

5 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.

5 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().

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

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

5 years agouwrap: Add libc_getgroups().
Andreas Schneider [Tue, 17 Dec 2013 12:35:21 +0000 (13:35 +0100)]
uwrap: Add libc_getgroups().

5 years agouwrap: Add libc_getegid().
Andreas Schneider [Tue, 17 Dec 2013 12:33:57 +0000 (13:33 +0100)]
uwrap: Add libc_getegid().

5 years agouwrap: Add libc_setregid().
Andreas Schneider [Tue, 17 Dec 2013 12:31:28 +0000 (13:31 +0100)]
uwrap: Add libc_setregid().

5 years agouwrap: Add libc_setregid().
Andreas Schneider [Tue, 17 Dec 2013 12:28:37 +0000 (13:28 +0100)]
uwrap: Add libc_setregid().

5 years agouwrap: Add libc_setgeid().
Andreas Schneider [Tue, 17 Dec 2013 12:27:12 +0000 (13:27 +0100)]
uwrap: Add libc_setgeid().

5 years agouwarp: Add libc_getgid().
Andreas Schneider [Tue, 17 Dec 2013 12:26:04 +0000 (13:26 +0100)]
uwarp: Add libc_getgid().

5 years agouwrap: Add libc_setgid().
Andreas Schneider [Tue, 17 Dec 2013 12:24:59 +0000 (13:24 +0100)]
uwrap: Add libc_setgid().

5 years agouwrap: Add libc_geteuid().
Andreas Schneider [Tue, 17 Dec 2013 12:20:02 +0000 (13:20 +0100)]
uwrap: Add libc_geteuid().

5 years agouwrap: Add libc_setresuid().
Andreas Schneider [Tue, 17 Dec 2013 12:10:08 +0000 (13:10 +0100)]
uwrap: Add libc_setresuid().

5 years agouwrap: Add libc_setreuid().
Andreas Schneider [Tue, 17 Dec 2013 12:08:16 +0000 (13:08 +0100)]
uwrap: Add libc_setreuid().

5 years agouwrap: Add libc_seteuid().
Andreas Schneider [Tue, 17 Dec 2013 12:06:49 +0000 (13:06 +0100)]
uwrap: Add libc_seteuid().

5 years agouwrap: Add libc_getuid().
Andreas Schneider [Tue, 17 Dec 2013 12:05:34 +0000 (13:05 +0100)]
uwrap: Add libc_getuid().

5 years agouwrap: Add libc_setuid().
Andreas Schneider [Tue, 17 Dec 2013 12:03:40 +0000 (13:03 +0100)]
uwrap: Add libc_setuid().

5 years agouwrap: Add uwrap_load_lib_function().
Andreas Schneider [Tue, 17 Dec 2013 11:59:49 +0000 (12:59 +0100)]
uwrap: Add uwrap_load_lib_function().

5 years agouwrap: Add uwrap_load_lib_handle().
Andreas Schneider [Tue, 17 Dec 2013 11:57:29 +0000 (12:57 +0100)]
uwrap: Add uwrap_load_lib_handle().

5 years agotests: Add a test for getgroups().
Andreas Schneider [Wed, 4 Dec 2013 17:07:54 +0000 (18:07 +0100)]
tests: Add a test for getgroups().

5 years agotests: Add a test for setgroups().
Andreas Schneider [Wed, 4 Dec 2013 16:58:44 +0000 (17:58 +0100)]
tests: Add a test for setgroups().

5 years agotests: Add a test for setgid().
Andreas Schneider [Wed, 4 Dec 2013 16:44:53 +0000 (17:44 +0100)]
tests: Add a test for setgid().

5 years agocmake: Set _FORTIFY_SOURCE only for optimized builds.
Andreas Schneider [Wed, 4 Dec 2013 16:38:52 +0000 (17:38 +0100)]
cmake: Set _FORTIFY_SOURCE only for optimized builds.

5 years agotests: Use SYS_gettimeofday for testing.
Andreas Schneider [Wed, 4 Dec 2013 16:08:19 +0000 (17:08 +0100)]
tests: Use SYS_gettimeofday for testing.

SYS_stat is a bad idea cause you need to know kernel internals.

5 years agotests: Fix testsuite on Solaris.
Andreas Schneider [Wed, 20 Nov 2013 15:27:25 +0000 (16:27 +0100)]
tests: Fix testsuite on Solaris.

5 years agouwrap: Fix build on Solaris.
Andreas Schneider [Wed, 20 Nov 2013 15:24:22 +0000 (16:24 +0100)]
uwrap: Fix build on Solaris.

5 years agocmake: Fix dashboard drop location.
Andreas Schneider [Wed, 20 Nov 2013 15:07:48 +0000 (16:07 +0100)]
cmake: Fix dashboard drop location.

5 years agocmake: Detect OSX.
Andreas Schneider [Fri, 15 Nov 2013 09:23:27 +0000 (10:23 +0100)]
cmake: Detect OSX.

5 years agoconfig: Add missing define for APPLE.
Andreas Schneider [Fri, 15 Nov 2013 09:21:20 +0000 (10:21 +0100)]
config: Add missing define for APPLE.

5 years agouwrap: Move pthread_atfork() to correct position.
Andreas Schneider [Fri, 15 Nov 2013 09:19:06 +0000 (10:19 +0100)]
uwrap: Move pthread_atfork() to correct position.

5 years agouwarp: Load libc functions on OSX.
Andreas Schneider [Fri, 15 Nov 2013 09:07:14 +0000 (10:07 +0100)]
uwarp: Load libc functions on OSX.

5 years agocmake: Add environment variables for OSX.
Andreas Schneider [Fri, 15 Nov 2013 08:47:32 +0000 (09:47 +0100)]
cmake: Add environment variables for OSX.

5 years agocmake: Build getuids only on Linux.
Andreas Schneider [Fri, 15 Nov 2013 08:44:19 +0000 (09:44 +0100)]
cmake: Build getuids only on Linux.

5 years agouwrap: Fix build on OSX.
Andreas Schneider [Fri, 15 Nov 2013 08:43:06 +0000 (09:43 +0100)]
uwrap: Fix build on OSX.

5 years agocmake: Add check for syscall prototype.
Andreas Schneider [Fri, 15 Nov 2013 08:41:41 +0000 (09:41 +0100)]
cmake: Add check for syscall prototype.

5 years agocmake: Add check for setgroups prototype.
Andreas Schneider [Fri, 15 Nov 2013 08:36:54 +0000 (09:36 +0100)]
cmake: Add check for setgroups prototype.

5 years agouwrap: Prevent deadlocks if the application forks.
Andreas Schneider [Mon, 11 Nov 2013 18:43:02 +0000 (19:43 +0100)]
uwrap: Prevent deadlocks if the application forks.

5 years agotests: Test the threading support of the syscalls.
Andreas Schneider [Mon, 11 Nov 2013 16:31:46 +0000 (17:31 +0100)]
tests: Test the threading support of the syscalls.

5 years agouwrap: Add UID_WRAPPER_ROOT=2 mode.
Andreas Schneider [Thu, 7 Nov 2013 18:15:55 +0000 (19:15 +0100)]
uwrap: Add UID_WRAPPER_ROOT=2 mode.

5 years agouwrap: Add a nwrap_setgroup which syncs all threads.
Andreas Schneider [Tue, 30 Jul 2013 15:17:24 +0000 (17:17 +0200)]
uwrap: Add a nwrap_setgroup which syncs all threads.

5 years agouwrap: Make initialization check faster.
Andreas Schneider [Tue, 30 Jul 2013 15:10:38 +0000 (17:10 +0200)]
uwrap: Make initialization check faster.

5 years agouwrap: Add mutexes to make it thread safe.
Andreas Schneider [Tue, 30 Jul 2013 14:56:12 +0000 (16:56 +0200)]
uwrap: Add mutexes to make it thread safe.

5 years agouwrap: Add support for thread safe functions.
Andreas Schneider [Tue, 30 Jul 2013 13:04:34 +0000 (15:04 +0200)]
uwrap: Add support for thread safe functions.

This is not fully working yet, but a start.

5 years agotests: Add test for setuid().
Andreas Schneider [Tue, 30 Jul 2013 13:59:01 +0000 (15:59 +0200)]
tests: Add test for setuid().

5 years agotests: Fix the testsuite to correctly work.
Andreas Schneider [Tue, 30 Jul 2013 13:05:09 +0000 (15:05 +0200)]
tests: Fix the testsuite to correctly work.

5 years agouwrap: Remove wrong SYS_initgroups.
Andreas Schneider [Mon, 29 Jul 2013 16:38:10 +0000 (18:38 +0200)]
uwrap: Remove wrong SYS_initgroups.

5 years agouwrap: Check the value of UID_WRAPPER env variable.
Andreas Schneider [Mon, 29 Jul 2013 10:07:01 +0000 (12:07 +0200)]
uwrap: Check the value of UID_WRAPPER env variable.

5 years agouwrap: Fix a typo in getgid().
Andreas Schneider [Mon, 29 Jul 2013 10:06:49 +0000 (12:06 +0200)]
uwrap: Fix a typo in getgid().

5 years agouwrap: Add UID_WRAPPER_ROOT environment variable.
Andreas Schneider [Fri, 26 Jul 2013 06:27:06 +0000 (08:27 +0200)]
uwrap: Add UID_WRAPPER_ROOT environment variable.

If UID_WRAPPER_ROOT is set then uid_wrapper is initialized with root.
This mean we fake that the process is started as root.

5 years agouwrap: Refactor uid and gid initialization.
Andreas Schneider [Fri, 26 Jul 2013 06:25:19 +0000 (08:25 +0200)]
uwrap: Refactor uid and gid initialization.

5 years agouwrap: Add support for real/save uid/gid changing.
Andreas Schneider [Thu, 25 Jul 2013 16:23:42 +0000 (18:23 +0200)]
uwrap: Add support for real/save uid/gid changing.

5 years agouwrap: Add ruid, suid, rgid and sgid.
Andreas Schneider [Thu, 25 Jul 2013 16:05:12 +0000 (18:05 +0200)]
uwrap: Add ruid, suid, rgid and sgid.

5 years agotests: Add a getuids helper.
Andreas Schneider [Thu, 25 Jul 2013 16:04:34 +0000 (18:04 +0200)]
tests: Add a getuids helper.

5 years agouwrap: Add error handling for seteuid().
Andreas Schneider [Thu, 25 Jul 2013 14:57:43 +0000 (16:57 +0200)]
uwrap: Add error handling for seteuid().

5 years agouwrap: Remove unneeded gid wrappers.
Andreas Schneider [Wed, 24 Jul 2013 10:00:57 +0000 (12:00 +0200)]
uwrap: Remove unneeded gid wrappers.

5 years agouwrap: Remove unneeded uid wrappers.
Andreas Schneider [Wed, 24 Jul 2013 09:58:27 +0000 (11:58 +0200)]
uwrap: Remove unneeded uid wrappers.

5 years agocmake: Check for thread local storage support.
Andreas Schneider [Wed, 24 Jul 2013 08:39:26 +0000 (10:39 +0200)]
cmake: Check for thread local storage support.

5 years agouwrap: Make sure we have the id syscalls.
Andreas Schneider [Wed, 24 Jul 2013 08:38:35 +0000 (10:38 +0200)]
uwrap: Make sure we have the id syscalls.