debian/0000755000000000000000000000000013726742316007201 5ustar debian/changelog0000644000000000000000000000741713726742316011064 0ustar nss-wrapper (1.1.11-1ubuntu2) groovy; urgency=medium * d/t/tests: fix order of cmake arguments. -- Lucas Kanashiro Fri, 11 Sep 2020 15:41:18 -0300 nss-wrapper (1.1.11-1ubuntu1) groovy; urgency=medium * Make autopkgtests cross-test-friendly. -- Steve Langasek Wed, 10 Jun 2020 14:04:28 -0700 nss-wrapper (1.1.11-1) unstable; urgency=medium [ Simon McVittie ] * control: Update VCS URLs for salsa.debian.org * Allow installation for more than one architecture at the same time - d/control: Set Multi-Arch: same (Closes: #946902) [ Helmut Grohne ] * Fix FTCBFS: Let dh_auto_configure pass cross flags to cmake. (Closes: #940693) [ Timo Aaltonen ] * New upstream release. * patches: Refreshed. * control: Use debhelper-compat, bump to 12. * rules: Migrate to dh. (Closes: #940693) * control: Bump policy to 4.5.0. -- Timo Aaltonen Thu, 02 Apr 2020 21:45:05 +0300 nss-wrapper (1.1.3-1) unstable; urgency=medium * New upstream release. * control: Add versioned build-depends on libcmocka-dev. (Closes: #838445) * control: Use https vcs urls. * control: Bump policy to 3.9.8, no changes. * no-soname.diff: Refreshed. -- Timo Aaltonen Sat, 03 Dec 2016 01:40:21 +0200 nss-wrapper (1.1.2-1) unstable; urgency=medium * New upstream release. -- Timo Aaltonen Mon, 22 Feb 2016 08:22:42 +0200 nss-wrapper (1.1.1-1) unstable; urgency=medium * New upstream release. * patches: Refreshed, reproducible-manpage.diff dropped being upstream. -- Timo Aaltonen Wed, 09 Dec 2015 23:25:07 +0200 nss-wrapper (1.0.3-4) unstable; urgency=medium * control: New maintainer. (Closes: #770375) * control: Add Vcs fields. * rules: Bump verbosity for tests. -- Timo Aaltonen Fri, 04 Sep 2015 12:28:53 +0300 nss-wrapper (1.0.3-3) unstable; urgency=low * Add patch (reproducible-manpage.diff) to make the builds reproducible. -- Jakub Wilk Sat, 27 Jun 2015 21:29:52 +0200 nss-wrapper (1.0.3-2) unstable; urgency=low * Upload to unstable. * Drop “XS-Testsuite: autopkgtest”. * Bump standards version to 3.9.6 (no changes needed). -- Jakub Wilk Mon, 25 May 2015 13:46:29 +0200 nss-wrapper (1.0.3-1) experimental; urgency=low * New upstream release. + Add a nss_wrapper manpage. + Fix cmake find_package configs. + Fix resolving hostnames with a trailing dot. + Fix an overflow when checking if a IPv6 address is IPv4. * Drop fix-cmp0026.diff; applied upstream. * Drop tests-fix-ai_flags.diff; applied upstream. * Rebuild the nss_wrapper manpage from source: + Add asciidoc, libxml2-utils, xsltproc, docbook-xml, docbook-xsl to Build-Depends. + Add the manpage to extend-diff-ignore in debian/source/options. + Run a2x in debian/rules. -- Jakub Wilk Wed, 01 Oct 2014 18:19:30 +0200 nss-wrapper (1.0.2-1) experimental; urgency=low * Initial release (closes: #746583). * libnss_wrapper is a preloadable library. We do not support directly linking to it, so it doesn't need the SONAME. Add patch (no-soname.diff) to remove it. * Add Lintian override for sharedobject-in-library-directory-missing-soname. * Cherry-pick upstream patch (fix-cmp0026.diff) to fix check for the CMP0026 cmake policy. * Cherry-pick upstream patch (tests-fix-ai_flags.diff) to fix test failure on systems with only IPv4 addresses. * Add patch (use-gnu-lib-names.diff) to use the LIBC_SO and LIBNSL_SO macros to discover SONAMEs. Thanks to Pino Toscano. * Don't install /usr/bin/nss_wrapper.pl for the time being. -- Jakub Wilk Sun, 08 Jun 2014 23:53:33 +0200 debian/control0000644000000000000000000000264313670245334010605 0ustar Source: nss-wrapper Section: devel Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian SSSD Team Uploaders: Timo Aaltonen Build-Depends: debhelper-compat (= 12), dh-buildinfo, cmake (>= 2.8.8-3~), libcmocka-dev (>= 1.0.1), netbase, asciidoc, libxml2-utils, xsltproc, docbook-xml, docbook-xsl Standards-Version: 4.5.0 Vcs-Git: https://salsa.debian.org/sssd-team/nss-wrapper.git Vcs-Browser: https://salsa.debian.org/sssd-team/nss-wrapper Homepage: http://cwrap.org/nss_wrapper.html Package: libnss-wrapper Architecture: any Multi-Arch: same Depends: ${misc:Depends}, ${shlibs:Depends} Description: NSS wrapper library There are projects which provide daemons needing to be able to create, modify and delete unix users. Or just switch user ids to interact with the system, for example a user space file server. To be able to test that you need the privilege to modify the passwd and groups file. With nss_wrapper it is possible to define your own passwd and groups file which will be used by software to act correctly while under test. . If you have a client and server under test they normally use functions to resolve network names to addresses (DNS) or vice versa. The nss_wrappers allow you to create a hosts file to setup name resolution for the addresses you use with socket_wrapper. debian/copyright0000644000000000000000000000441713641417603011134 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: nss_wrapper Source: https://ftp.samba.org/pub/cwrap/ Files: * Copyright: 2007, Stefan Metzmacher 2009, Guenther Deschner 2013, Andreas Schneider License: BSD-3-clauses Files: cmake/Modules/CheckCCompilerFlagSSP.cmake cmake/Modules/MacroEnsureOutOfSourceBuild.cmake Copyright: 2006, Alexander Neundorf License: BSD-3-clauses Files: cmake/Modules/FindCMocka.cmake Copyright: 2011-2012, Andreas Schneider License: BSD-3-clauses Files: cmake/Modules/AddCMockaTest.cmake Copyright: 2007, Daniel Gollub 2007-2010, Andreas Schneider License: BSD-3-clauses Files: debian/* Copyright: 2014, Jakub Wilk License: BSD-3-clauses License: BSD-3-clauses Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . 3. Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/docs0000644000000000000000000000002713641423041010036 0ustar AUTHORS README.md TODO debian/libnss-wrapper.lintian-overrides0000644000000000000000000000032313641420242015512 0ustar # libnss_wrapper is a preloadable library. # We do not support directly linking to it, so it doesn't need the SONAME. libnss-wrapper: sharedobject-in-library-directory-missing-soname usr/lib/*/libnss_wrapper.so debian/patches/0000755000000000000000000000000013641421605010617 5ustar debian/patches/no-soname.diff0000644000000000000000000000242613641421572013354 0ustar Description: remove SONAME libnss_wrapper is a preloadable library. We do not support directly linking to it, so it doesn't need the SONAME. Let's remove it. Author: Jakub Wilk Last-Update: 2014-06-01 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,10 +17,7 @@ target_link_libraries(nss_wrapper ${NWRA set_target_properties( nss_wrapper PROPERTIES - VERSION - ${LIBRARY_VERSION} - SOVERSION - ${LIBRARY_SOVERSION} + NO_SONAME ON ) install(TARGETS nss_wrapper --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,11 +23,11 @@ set(APPLICATION_NAME ${PROJECT_NAME}) # Increment MINOR. Set PATCH to 0 # If the source code was changed, but there were no interface changes: # Increment PATCH. -set(LIBRARY_VERSION_MAJOR 0) -set(LIBRARY_VERSION_MINOR 3) -set(LIBRARY_VERSION_PATCH 1) -set(LIBRARY_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}") -set(LIBRARY_SOVERSION ${LIBRARY_VERSION_MAJOR}) +#set(LIBRARY_VERSION_MAJOR 0) +#set(LIBRARY_VERSION_MINOR 3) +#set(LIBRARY_VERSION_PATCH 1) +#set(LIBRARY_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}") +#set(LIBRARY_SOVERSION ${LIBRARY_VERSION_MAJOR}) # add definitions include(DefineCMakeDefaults) debian/patches/series0000644000000000000000000000004613641417603012037 0ustar no-soname.diff use-gnu-lib-names.diff debian/patches/use-gnu-lib-names.diff0000644000000000000000000000357213641421605014710 0ustar Description: use the LIBC_SO and LIBNSL_SO macros to discover SONAMEs Author: Pino Toscano Bug: https://bugzilla.samba.org/show_bug.cgi?id=10572 Last-Update: 2014-06-01 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -54,6 +54,7 @@ check_include_file(shadow.h HAVE_SHADOW_ check_include_file(grp.h HAVE_GRP_H) check_include_file(nss.h HAVE_NSS_H) check_include_file(nss_common.h HAVE_NSS_COMMON_H) +check_include_file(gnu/lib-names.h HAVE_GNU_LIB_NAMES_H) # FUNCTIONS check_function_exists(strncpy HAVE_STRNCPY) --- a/config.h.cmake +++ b/config.h.cmake @@ -20,6 +20,7 @@ #cmakedefine HAVE_GRP_H 1 #cmakedefine HAVE_NSS_H 1 #cmakedefine HAVE_NSS_COMMON_H 1 +#cmakedefine HAVE_GNU_LIB_NAMES_H 1 /*************************** FUNCTIONS ***************************/ --- a/src/nss_wrapper.c +++ b/src/nss_wrapper.c @@ -60,6 +60,10 @@ #include #include +#ifdef HAVE_GNU_LIB_NAMES_H +#include +#endif + /* * Defining _POSIX_PTHREAD_SEMANTICS before including pwd.h and grp.h gives us * the posix getpwnam_r(), getpwuid_r(), getgrnam_r and getgrgid_r calls on @@ -1130,6 +1134,13 @@ static void *nwrap_load_lib_handle(enum case NWRAP_LIBNSL: #ifdef HAVE_LIBNSL handle = nwrap_main_global->libc->nsl_handle; +#ifdef LIBNSL_SO + if (handle == NULL) { + handle = dlopen(LIBNSL_SO, flags); + + nwrap_main_global->libc->nsl_handle = handle; + } +#endif if (handle == NULL) { for (i = 10; i >= 0; i--) { char soname[256] = {0}; @@ -1167,6 +1178,13 @@ static void *nwrap_load_lib_handle(enum /* FALL TROUGH */ case NWRAP_LIBC: handle = nwrap_main_global->libc->handle; +#ifdef LIBC_SO + if (handle == NULL) { + handle = dlopen(LIBC_SO, flags); + + nwrap_main_global->libc->handle = handle; + } +#endif if (handle == NULL) { for (i = 10; i >= 0; i--) { char soname[256] = {0}; debian/rules0000755000000000000000000000043213641430740010247 0ustar #!/usr/bin/make -f %: dh $@ --builddirectory=build override_dh_clean: dh_clean rm -f compile_commands.json override_dh_auto_build: dh_auto_build a2x --doctype manpage --format manpage doc/nss_wrapper.1.txt override_dh_install: dh_install rm -rf debian/*-wrapper/usr/bin/ debian/source/0000755000000000000000000000000013641417603010473 5ustar debian/source/format0000644000000000000000000000001413641417603011701 0ustar 3.0 (quilt) debian/source/options0000644000000000000000000000010013641417603012100 0ustar compression = gzip extend-diff-ignore = "^doc/nss_wrapper[.]1$" debian/tests/0000755000000000000000000000000013726742311010336 5ustar debian/tests/adequate0000755000000000000000000000005313641417603012052 0ustar #!/bin/sh exec adequate libnss-wrapper >&2 debian/tests/control0000644000000000000000000000031013670245214011731 0ustar Tests: tests Depends: libnss-wrapper, build-essential, libc6-dev, cmake (>= 2.8.8-3~), libcmocka-dev, netbase Restrictions: allow-stderr Tests: adequate Depends: libnss-wrapper, adequate:native debian/tests/tests0000755000000000000000000000105613726741512011432 0ustar #!/bin/sh set -e -u cp -a . "$ADTTMP" cd "$ADTTMP" rm -rf obj debian mkdir obj cd obj if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then cat < "$ADTTMP/toolchain.cmake" set(CMAKE_C_COMPILER $DEB_HOST_GNU_TYPE-gcc) set(CMAKE_CXX_COMPILER $DEB_HOST_GNU_TYPE-g++) set(PKG_CONFIG_EXECUTABLE $DEB_HOST_GNU_TYPE-pkg-config) EOF CCFILE=-DCMAKE_TOOLCHAIN_FILE="$ADTTMP/toolchain.cmake" else CCFILE= fi cmake "$CCFILE" -DUNIT_TESTING=1 .. make -C tests/ cd tests sed -e 's#\(LD_PRELOAD=\)[^;]*/\(libnss_wrapper.so\)#\1\2#' -i CTestTestfile.cmake make test debian/watch0000644000000000000000000000011413641417603010220 0ustar version=3 https://ftp.samba.org/pub/cwrap/ nss_wrapper-([0-9.]+)[.]tar[.]gz