debian/0000775000000000000000000000000013020403436007163 5ustar debian/source/0000775000000000000000000000000013020402165010461 5ustar debian/source/options0000664000000000000000000000010013020402165012066 0ustar compression = gzip extend-diff-ignore = "^doc/nss_wrapper[.]1$" debian/source/format0000664000000000000000000000001413020402165011667 0ustar 3.0 (quilt) debian/changelog0000664000000000000000000000545413020403436011045 0ustar 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/tests/0000775000000000000000000000000013020402165010323 5ustar debian/tests/control0000664000000000000000000000027113020402165011726 0ustar Tests: tests Depends: libnss-wrapper, gcc, libc-dev, cmake (>= 2.8.8-3~), make, libcmocka-dev, netbase Restrictions: allow-stderr Tests: adequate Depends: libnss-wrapper, adequate debian/tests/adequate0000775000000000000000000000005313020402165012040 0ustar #!/bin/sh exec adequate libnss-wrapper >&2 debian/tests/tests0000775000000000000000000000034513020402165011415 0ustar #!/bin/sh set -e -u cp -a . "$ADTTMP" cd "$ADTTMP" rm -rf obj debian mkdir obj cd obj cmake .. -DUNIT_TESTING=1 make -C tests/ cd tests sed -e 's#\(LD_PRELOAD=\)[^;]*/\(libnss_wrapper.so\)#\1\2#' -i CTestTestfile.cmake make test debian/rules0000775000000000000000000000254113020402165010243 0ustar #!/usr/bin/make -f cflags = $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) ldflags = $(shell dpkg-buildflags --get LDFLAGS) cmake_options = \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_BUILD_TYPE=None \ -DCMAKE_C_FLAGS="$(cflags)" \ -DCMAKE_SHARED_LINKER_FLAGS="$(ldflags)" \ -DCMAKE_EXE_LINKER_FLAGS="$(ldflags)" \ ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" "" cmake_options += \ -DUNIT_TESTING=1 endif parallel = -j$(or $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))),1) .PHONY: clean clean: debian/control dh_clean rm -rf obj .PHONY: build build-arch build-indep build: build-arch build-arch: obj/stamp obj/stamp: CMakeLists.txt mkdir -p obj cd obj && cmake $(cmake_options) .. $(MAKE) $(parallel) -C obj/ ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" "" $(MAKE) -C obj/ test ARGS="-V" endif a2x --doctype manpage --format manpage doc/nss_wrapper.1.txt touch $(@) .PHONY: binary binary-arch binary-indep binary: binary-arch binary-arch: obj/stamp dh_testroot dh_prep $(MAKE) -C obj/ install DESTDIR=../debian/libnss-wrapper/ rm -rf debian/*-wrapper/usr/bin/ dh_lintian dh_installchangelogs dh_installdocs AUTHORS README TODO dh_buildinfo dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb # vim:ts=4 sw=4 noet debian/copyright0000664000000000000000000000441713020402165011122 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/control0000664000000000000000000000250113020403047010562 0ustar Source: nss-wrapper Homepage: http://cwrap.org/nss_wrapper.html Section: devel Priority: optional Maintainer: Debian SSSD Team Uploaders: Timo Aaltonen Build-Depends: debhelper (>= 7), dh-buildinfo, cmake (>= 2.8.8-3~), libcmocka-dev (>= 1.0.1), netbase, asciidoc, libxml2-utils, xsltproc, docbook-xml, docbook-xsl Standards-Version: 3.9.8 Vcs-Git: https://anonscm.debian.org/git/pkg-sssd/nss-wrapper.git Vcs-Browser: https://anonscm.debian.org/git/pkg-sssd/nss-wrapper.git Package: libnss-wrapper Architecture: any 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/libnss-wrapper.lintian-overrides0000664000000000000000000000032113020402165015505 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/watch0000664000000000000000000000011413020402165010206 0ustar version=3 https://ftp.samba.org/pub/cwrap/ nss_wrapper-([0-9.]+)[.]tar[.]gz debian/patches/0000775000000000000000000000000013020403356010613 5ustar debian/patches/series0000664000000000000000000000004613020402165012025 0ustar no-soname.diff use-gnu-lib-names.diff debian/patches/use-gnu-lib-names.diff0000664000000000000000000000356613020402165014704 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 @@ -53,6 +53,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 @@ -57,6 +57,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 @@ -831,6 +835,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}; @@ -868,6 +879,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/patches/no-soname.diff0000664000000000000000000000167113020403356013346 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 @@ -11,10 +11,7 @@ endif (BSD) set_target_properties( nss_wrapper PROPERTIES - VERSION - ${LIBRARY_VERSION} - SOVERSION - ${LIBRARY_SOVERSION} + NO_SONAME ON ) install( --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,8 @@ set(APPLICATION_VERSION "${APPLICATION_V # Increment AGE. Set REVISION to 0 # If the source code was changed, but there were no interface changes: # Increment REVISION. -set(LIBRARY_VERSION "0.2.3") -set(LIBRARY_SOVERSION "0") +#set(LIBRARY_VERSION "0.2.3") +#set(LIBRARY_SOVERSION "0") # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked set(CMAKE_MODULE_PATH debian/compat0000664000000000000000000000000213020402165010357 0ustar 7