nss_wrapper.git
22 months agoBump version to 1.1.12 nss_wrapper-1.1.12
Andreas Schneider [Fri, 24 Jun 2022 07:54:21 +0000 (09:54 +0200)]
Bump version to 1.1.12

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
22 months agonwrap: Fix endpwent and setgrent to call the functions
Pavel Filipenský [Thu, 23 Jun 2022 17:29:29 +0000 (19:29 +0200)]
nwrap: Fix endpwent and setgrent to call the functions

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agonss_wrapper: fall back to pragma init/fini for constructor/destructor if possible
Björn Jacke [Fri, 30 Oct 2020 14:11:54 +0000 (15:11 +0100)]
nss_wrapper: fall back to pragma init/fini for constructor/destructor if possible

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoconfigure: check for pragma init/fini for constructors/destructors
Björn Jacke [Fri, 30 Oct 2020 14:05:36 +0000 (15:05 +0100)]
configure: check for pragma init/fini for constructors/destructors

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agonwrap_files_cache_reload: add close for ebadf fd just incase
TJ Miller [Wed, 28 Oct 2020 20:55:59 +0000 (13:55 -0700)]
nwrap_files_cache_reload: add close for ebadf fd just incase

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agonwrap_files_cache_reload: add test for closed handles error
TJ Miller [Wed, 28 Oct 2020 20:54:48 +0000 (13:54 -0700)]
nwrap_files_cache_reload: add test for closed handles error

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agonwrap_files_cache_reload: avoid error on EBADF during stat
TJ Miller [Thu, 15 Oct 2020 19:07:17 +0000 (12:07 -0700)]
nwrap_files_cache_reload: avoid error on EBADF during stat

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agonwrap_files_getaddrinfo: avoid crash on empty name
Douglas Bagnall [Sun, 17 May 2020 01:14:08 +0000 (13:14 +1200)]
nwrap_files_getaddrinfo: avoid crash on empty name

When name is "", we would deref name[-1]. If by chance name[-1] was
'.', we also tried to copy all of memory from one place to another.

Rather than just guard the immediate next branch, let's assume the
empty name is never found.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoBump version 1.1.11 nss_wrapper-1.1.11
Andreas Schneider [Thu, 2 Apr 2020 10:08:35 +0000 (12:08 +0200)]
Bump version 1.1.11

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agocpack: Ignore compile_commands.json file
Andreas Schneider [Thu, 2 Apr 2020 07:30:42 +0000 (09:30 +0200)]
cpack: Ignore compile_commands.json file

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agogitignore: Ignore all obj directories
Andreas Schneider [Thu, 2 Apr 2020 07:30:07 +0000 (09:30 +0200)]
gitignore: Ignore all obj directories

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Correctly handle realloc() in nwrap_module_init()
Andreas Schneider [Thu, 2 Apr 2020 07:51:22 +0000 (09:51 +0200)]
nwrap: Correctly handle realloc() in nwrap_module_init()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Always fully initialze an nwrap_backend
Andreas Schneider [Thu, 2 Apr 2020 07:37:54 +0000 (09:37 +0200)]
nwrap: Always fully initialze an nwrap_backend

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Rewrite symbol binding for nss modules
Andreas Schneider [Wed, 1 Apr 2020 16:32:59 +0000 (18:32 +0200)]
nwrap: Rewrite symbol binding for nss modules

Fixes strict aliasing.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Add mutex for nss module symbol binding
Andreas Schneider [Wed, 1 Apr 2020 16:22:50 +0000 (18:22 +0200)]
nwrap: Add mutex for nss module symbol binding

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Rewrite symbol binding for libc, libnsl and libsocket
Andreas Schneider [Wed, 1 Apr 2020 16:32:32 +0000 (18:32 +0200)]
nwrap: Rewrite symbol binding for libc, libnsl and libsocket

This fixes strict aliasing issues which cause segfaults at least on
armhfp.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Add mutex for libc symbol binding
Andreas Schneider [Wed, 1 Apr 2020 16:21:55 +0000 (18:21 +0200)]
nwrap: Add mutex for libc symbol binding

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agotests: Add a basic test to check if the NSS module works
Andreas Schneider [Thu, 2 Apr 2020 08:41:47 +0000 (10:41 +0200)]
tests: Add a basic test to check if the NSS module works

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agogitlab-ci: Add Ubuntu runner
Andreas Schneider [Tue, 24 Mar 2020 09:45:45 +0000 (10:45 +0100)]
gitlab-ci: Add Ubuntu runner

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agogitlab-ci: Remove debian cross mips build
Andreas Schneider [Tue, 24 Mar 2020 09:44:38 +0000 (10:44 +0100)]
gitlab-ci: Remove debian cross mips build

This isn't supported by Debian anymore.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agoBump version to 1.1.10 nss_wrapper-1.1.10
Andreas Schneider [Thu, 19 Mar 2020 09:08:16 +0000 (10:08 +0100)]
Bump version to 1.1.10

The library version is set to 0.3.0 because gethostbyname2_r() is
provided now.

This wasn't exported due to a missing configure check for it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agotests: Add tests for gethostbyname2_r, IPv4 and IPv6
Samuel Cabrero [Wed, 18 Mar 2020 12:19:28 +0000 (13:19 +0100)]
tests: Add tests for gethostbyname2_r, IPv4 and IPv6

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agonwrap: Account for ending NULL pointer when checking the buffer length
Samuel Cabrero [Wed, 18 Mar 2020 12:43:23 +0000 (13:43 +0100)]
nwrap: Account for ending NULL pointer when checking the buffer length

The hostent->h_addr_list ends with a NULL pointer, take it into account
when checking the provided buffer length.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agonwrap: Forward ERANGE error to caller in gethostbyname[2]_r
Samuel Cabrero [Wed, 18 Mar 2020 12:18:49 +0000 (13:18 +0100)]
nwrap: Forward ERANGE error to caller in gethostbyname[2]_r

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agonwrap: Filter by family in gethostbyname2_r
Samuel Cabrero [Wed, 18 Mar 2020 12:18:17 +0000 (13:18 +0100)]
nwrap: Filter by family in gethostbyname2_r

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agotests: Check that gethostbyname_r() zeros return values
Andreas Schneider [Thu, 19 Mar 2020 08:53:30 +0000 (09:53 +0100)]
tests: Check that gethostbyname_r() zeros return values

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Check paramters and make sure return values are zeored
Andreas Schneider [Thu, 19 Mar 2020 08:16:24 +0000 (09:16 +0100)]
nwrap: Check paramters and make sure return values are zeored

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Zero the result in case we return with an error
Andreas Schneider [Thu, 19 Mar 2020 08:45:09 +0000 (09:45 +0100)]
nwrap: Zero the result in case we return with an error

This fixes a crash bug in OpenLDAP libraries which do not check the
return value of gethostbyname_r().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Use SAFE_FREE() in nwrap_files_gethostbyname2_r()
Andreas Schneider [Thu, 19 Mar 2020 08:39:16 +0000 (09:39 +0100)]
nwrap: Use SAFE_FREE() in nwrap_files_gethostbyname2_r()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Use calloc() to allocate addr_list vector
Andreas Schneider [Tue, 17 Mar 2020 19:13:19 +0000 (20:13 +0100)]
nwrap: Use calloc() to allocate addr_list vector

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Add missing check for gethostbyname2_r()
Andreas Schneider [Tue, 17 Mar 2020 17:07:44 +0000 (18:07 +0100)]
nwrap: Add missing check for gethostbyname2_r()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agonwrap: Fix build if system doesn't provide gethostbyname2
Andreas Schneider [Mon, 16 Mar 2020 16:43:20 +0000 (17:43 +0100)]
nwrap: Fix build if system doesn't provide gethostbyname2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
4 years agoBump version to 1.1.9 nss_wrapper-1.1.9
Andreas Schneider [Mon, 16 Mar 2020 15:55:57 +0000 (16:55 +0100)]
Bump version to 1.1.9

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agocmake: Make setting LIBRARY_VERSION easier
Andreas Schneider [Mon, 16 Mar 2020 15:55:38 +0000 (16:55 +0100)]
cmake: Make setting LIBRARY_VERSION easier

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agocmake: Add a link to the compile database for .clangd
Andreas Schneider [Mon, 16 Mar 2020 15:53:11 +0000 (16:53 +0100)]
cmake: Add a link to the compile database for .clangd

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agocmake: Add a dist target to create source tarball
Andreas Schneider [Mon, 16 Mar 2020 15:52:24 +0000 (16:52 +0100)]
cmake: Add a dist target to create source tarball

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agonwrap: Only warn if we can't find a symbol in an nss module
Andreas Schneider [Mon, 17 Feb 2020 11:44:26 +0000 (12:44 +0100)]
nwrap: Only warn if we can't find a symbol in an nss module

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agonwrap: Some code cleanup for nwrap_load_module_fn()
Andreas Schneider [Mon, 17 Feb 2020 10:56:38 +0000 (11:56 +0100)]
nwrap: Some code cleanup for nwrap_load_module_fn()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agoBump version to 1.1.8 nss_wrapper-1.1.8
Andreas Schneider [Mon, 17 Feb 2020 08:37:17 +0000 (09:37 +0100)]
Bump version to 1.1.8

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
4 years agoRename to CHANGELOG
Andreas Schneider [Mon, 17 Feb 2020 08:38:04 +0000 (09:38 +0100)]
Rename to CHANGELOG

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
4 years agonwrap: Fix memory leak on error in nwrap_module_gethostbyname2()
Andreas Schneider [Mon, 17 Feb 2020 08:49:54 +0000 (09:49 +0100)]
nwrap: Fix memory leak on error in nwrap_module_gethostbyname2()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
4 years agonwrap: Fix memory leak on error in nwrap_module_gethostbyname()
Andreas Schneider [Mon, 17 Feb 2020 08:48:44 +0000 (09:48 +0100)]
nwrap: Fix memory leak on error in nwrap_module_gethostbyname()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
4 years agonwrap: Fix memory leak on error in nwrap_module_gethostbyaddr()
Andreas Schneider [Mon, 17 Feb 2020 08:46:56 +0000 (09:46 +0100)]
nwrap: Fix memory leak on error in nwrap_module_gethostbyaddr()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
4 years agotests: Make sure that current_grp is initialized
Andreas Schneider [Mon, 17 Feb 2020 08:34:31 +0000 (09:34 +0100)]
tests: Make sure that current_grp is initialized

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
4 years agonwrap: Use size_t for iterations, can't be negative
Samuel Cabrero [Mon, 11 Nov 2019 17:31:17 +0000 (18:31 +0100)]
nwrap: Use size_t for iterations, can't be negative

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agonwrap: Try different backends for gethostbyname[2][_r]
Samuel Cabrero [Thu, 10 Oct 2019 16:12:08 +0000 (18:12 +0200)]
nwrap: Try different backends for gethostbyname[2][_r]

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agonwrap: Try different backends in gethostbyaddr
Samuel Cabrero [Thu, 10 Oct 2019 11:47:06 +0000 (13:47 +0200)]
nwrap: Try different backends in gethostbyaddr

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agopkgconfig: Fix path to library in nss_wrapper.pc
Andreas Schneider [Thu, 14 Nov 2019 09:35:27 +0000 (10:35 +0100)]
pkgconfig: Fix path to library in nss_wrapper.pc

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org
4 years agoBump version to 1.1.7
Andreas Schneider [Mon, 11 Nov 2019 14:46:08 +0000 (15:46 +0100)]
Bump version to 1.1.7

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agonwrap: Improve logging function
Andreas Schneider [Wed, 6 Nov 2019 17:33:59 +0000 (18:33 +0100)]
nwrap: Improve logging function

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Check for getprogname() and getexecname()
Andreas Schneider [Wed, 6 Nov 2019 17:33:43 +0000 (18:33 +0100)]
cmake: Check for getprogname() and getexecname()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agonwrap: Always provide logging
Andreas Schneider [Wed, 6 Nov 2019 17:29:27 +0000 (18:29 +0100)]
nwrap: Always provide logging

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocmake: Fix path to nss_wrapper library
Andreas Schneider [Wed, 6 Nov 2019 17:43:29 +0000 (18:43 +0100)]
cmake: Fix path to nss_wrapper library

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoUpdate TODO
Andreas Schneider [Thu, 13 Jun 2019 15:09:15 +0000 (17:09 +0200)]
Update TODO

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agodoc: Add description for NSS_WRAPPER_DISABLE_DEEPBIND
Andreas Schneider [Tue, 21 May 2019 06:29:12 +0000 (08:29 +0200)]
doc: Add description for NSS_WRAPPER_DISABLE_DEEPBIND

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agonwrap: Add NSS_WRAPPER_DISABLE_DEEPBIND env variable
Andreas Schneider [Tue, 21 May 2019 06:30:53 +0000 (08:30 +0200)]
nwrap: Add NSS_WRAPPER_DISABLE_DEEPBIND env variable

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoBump version to 1.1.6 nss_wrapper-1.1.6
Andreas Schneider [Fri, 17 May 2019 05:44:30 +0000 (07:44 +0200)]
Bump version to 1.1.6

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agocpack: Fix description and vendor
Andreas Schneider [Tue, 7 May 2019 09:58:49 +0000 (11:58 +0200)]
cpack: Fix description and vendor

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agogitlab-ci: Setup CI for nss_wrapper
Andreas Schneider [Fri, 15 Feb 2019 12:29:08 +0000 (13:29 +0100)]
gitlab-ci: Setup CI for nss_wrapper

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Use GNUInstallDirs
Andreas Schneider [Wed, 20 Feb 2019 09:35:27 +0000 (10:35 +0100)]
cmake: Use GNUInstallDirs

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Do not run test_nwrap_disabled with sanitizers
Andreas Schneider [Fri, 15 Feb 2019 12:54:31 +0000 (13:54 +0100)]
cmake: Do not run test_nwrap_disabled with sanitizers

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Disable source code execution when cross compiling
Andreas Schneider [Fri, 15 Feb 2019 12:46:32 +0000 (13:46 +0100)]
cmake: Disable source code execution when cross compiling

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Put defines in config.h
Andreas Schneider [Fri, 15 Feb 2019 12:45:12 +0000 (13:45 +0100)]
cmake: Put defines in config.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Fix configure check for libdl
Andreas Schneider [Fri, 15 Feb 2019 12:26:42 +0000 (13:26 +0100)]
cmake: Fix configure check for libdl

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Use target_include_directories()
Andreas Schneider [Fri, 15 Feb 2019 12:24:31 +0000 (13:24 +0100)]
cmake: Use target_include_directories()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Update AddCMockaTest.cmake
Andreas Schneider [Fri, 15 Feb 2019 11:13:18 +0000 (12:13 +0100)]
cmake: Update AddCMockaTest.cmake

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Update cmocka requirement
Andreas Schneider [Fri, 15 Feb 2019 11:05:18 +0000 (12:05 +0100)]
cmake: Update cmocka requirement

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Support running the tests with AddressSanitizer
Andreas Schneider [Fri, 15 Feb 2019 11:04:20 +0000 (12:04 +0100)]
cmake: Support running the tests with AddressSanitizer

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Add AddressSanitizer and UndefinedSanitizer
Andreas Schneider [Fri, 15 Feb 2019 10:57:38 +0000 (11:57 +0100)]
cmake: Add AddressSanitizer and UndefinedSanitizer

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Move Compiler flags to new file
Andreas Schneider [Fri, 15 Feb 2019 10:57:11 +0000 (11:57 +0100)]
cmake: Move Compiler flags to new file

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Remove obsolete DefineCompilerFlags.cmake
Andreas Schneider [Fri, 15 Feb 2019 10:54:55 +0000 (11:54 +0100)]
cmake: Remove obsolete DefineCompilerFlags.cmake

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Improve checks for compiler flags
Andreas Schneider [Fri, 15 Feb 2019 10:54:22 +0000 (11:54 +0100)]
cmake: Improve checks for compiler flags

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Update CMake defaults
Andreas Schneider [Fri, 15 Feb 2019 10:46:23 +0000 (11:46 +0100)]
cmake: Update CMake defaults

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Do not misuse CMAKE_REQUIRED_LIBRARIES
Andreas Schneider [Fri, 15 Feb 2019 10:44:39 +0000 (11:44 +0100)]
cmake: Do not misuse CMAKE_REQUIRED_LIBRARIES

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agocmake: Require at least cmake 3.5.0
Andreas Schneider [Fri, 15 Feb 2019 10:40:10 +0000 (11:40 +0100)]
cmake: Require at least cmake 3.5.0

We should use modern cmake.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agotests: Fix strict aliasing issues in test_nwrap_disabled
Andreas Schneider [Fri, 15 Feb 2019 14:20:35 +0000 (15:20 +0100)]
tests: Fix strict aliasing issues in test_nwrap_disabled

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agotests: Fix sockaddr alignment issues in test_getaddrinfo
Andreas Schneider [Fri, 15 Feb 2019 13:51:07 +0000 (14:51 +0100)]
tests: Fix sockaddr alignment issues in test_getaddrinfo

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agotests: Fix passwd entry for alice
Andreas Schneider [Fri, 15 Feb 2019 15:00:30 +0000 (16:00 +0100)]
tests: Fix passwd entry for alice

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agonwrap: Fix copying 'struct passwd' on FreeBSD
Andreas Schneider [Fri, 15 Feb 2019 17:44:43 +0000 (18:44 +0100)]
nwrap: Fix copying 'struct passwd' on FreeBSD

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agonwrap: Rewrite nwrap_gr_copy_r() to take memory alignment into account
Andreas Schneider [Fri, 15 Feb 2019 17:03:51 +0000 (18:03 +0100)]
nwrap: Rewrite nwrap_gr_copy_r() to take memory alignment into account

Found by UndefinedSanitizer

tests/testsuite.c:288:43: runtime error: load of misaligned address
0x7fff50a89199 for type 'char *', which requires 8 byte alignment
0x7fff50a89199: note: pointer points here
 79 00 78  00 00 00 00 00 00 00 00  00 fe 00 00 00 00 00 00  0c dc 8e e6 7a 7f 00 00  00 00 00 00 00
              ^

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agonwrap: Also check for NUL-byte in group loop
Andreas Schneider [Fri, 15 Feb 2019 15:16:50 +0000 (16:16 +0100)]
nwrap: Also check for NUL-byte in group loop

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agonwrap: Fix strict aliasing issue with sockaddr
Andreas Schneider [Fri, 15 Feb 2019 13:19:07 +0000 (14:19 +0100)]
nwrap: Fix strict aliasing issue with sockaddr

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agonwrap: Fix strict aliasing issues
Andreas Schneider [Fri, 15 Feb 2019 13:04:43 +0000 (14:04 +0100)]
nwrap: Fix strict aliasing issues

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agonwrap: Use memcpy instead of strncpy
Andreas Schneider [Fri, 15 Feb 2019 13:00:15 +0000 (14:00 +0100)]
nwrap: Use memcpy instead of strncpy

This fixes compiler/analyzer warnings that the use of strncpy() is
unsafe.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoREADME: Rename to a markdown file
Andreas Schneider [Mon, 18 Feb 2019 10:14:59 +0000 (11:14 +0100)]
README: Rename to a markdown file

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoBump version to 1.1.5 nss_wrapper-1.1.5
Andreas Schneider [Wed, 31 Oct 2018 12:23:30 +0000 (13:23 +0100)]
Bump version to 1.1.5

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agonwrap: Do not call nwrap_init() in the constructor
Andreas Schneider [Wed, 31 Oct 2018 10:11:05 +0000 (11:11 +0100)]
nwrap: Do not call nwrap_init() in the constructor

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agonwrap: Call exit() if something goes wrong during initialization
Andreas Schneider [Wed, 31 Oct 2018 10:10:37 +0000 (11:10 +0100)]
nwrap: Call exit() if something goes wrong during initialization

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agonwrap: Use calloc in nwrap_libc_init()
Andreas Schneider [Wed, 31 Oct 2018 10:10:08 +0000 (11:10 +0100)]
nwrap: Use calloc in nwrap_libc_init()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agoBump version to 1.1.4 nss_wrapper-1.1.4
Andreas Schneider [Tue, 30 Oct 2018 09:04:41 +0000 (10:04 +0100)]
Bump version to 1.1.4

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agonwrap: Don't do a deep bind if we run with libasan
Andreas Schneider [Sat, 1 Sep 2018 17:41:46 +0000 (19:41 +0200)]
nwrap: Don't do a deep bind if we run with libasan

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotests: Check pointers of get(pw|gr)(nam|uid|gid)_r functions
Andreas Schneider [Tue, 30 Oct 2018 10:04:22 +0000 (11:04 +0100)]
tests: Check pointers of get(pw|gr)(nam|uid|gid)_r functions

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agonwrap: fix nwrap_module_getgrent_r
Ralph Wuerthner [Fri, 19 Oct 2018 13:24:21 +0000 (15:24 +0200)]
nwrap: fix nwrap_module_getgrent_r

On success *grdstp must point to grdst, on error return NULL instead.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agonwrap: fix nwrap_module_getgrgid_r
Ralph Wuerthner [Fri, 19 Oct 2018 13:22:23 +0000 (15:22 +0200)]
nwrap: fix nwrap_module_getgrgid_r

On success *grdstp must point to grdst, on error return NULL instead.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agonwrap: fix nwrap_module_getgrnam_r
Ralph Wuerthner [Fri, 19 Oct 2018 13:19:28 +0000 (15:19 +0200)]
nwrap: fix nwrap_module_getgrnam_r

On success *grdstp must point to grdst, on error return NULL instead.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agonwrap: fix nwrap_module_getpwent_r
Ralph Wuerthner [Fri, 19 Oct 2018 10:19:17 +0000 (12:19 +0200)]
nwrap: fix nwrap_module_getpwent_r

On success *pwdstp must point to pwdst, on error return NULL instead.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agonwrap: fix nwrap_module_getpwuid_r
Ralph Wuerthner [Fri, 19 Oct 2018 10:15:53 +0000 (12:15 +0200)]
nwrap: fix nwrap_module_getpwuid_r

On success *pwdstp must point to pwdst, on error return NULL instead.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agonwrap: fix nwrap_module_getpwnam_r
Ralph Wuerthner [Fri, 19 Oct 2018 09:27:04 +0000 (11:27 +0200)]
nwrap: fix nwrap_module_getpwnam_r

On success *pwdstp must point to pwdst, on error return NULL instead.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoctest: Move to new dashboard
Andreas Schneider [Thu, 5 Jul 2018 08:15:11 +0000 (10:15 +0200)]
ctest: Move to new dashboard

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agonwrap: Update header
Andreas Schneider [Fri, 22 Jun 2018 06:46:06 +0000 (08:46 +0200)]
nwrap: Update header

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>