debian/0000755000000000000000000000000011752417725007201 5ustar debian/libnss-mysql-bg.dirs0000644000000000000000000000001011103006654013057 0ustar etc lib debian/compat0000644000000000000000000000000211743504664010376 0ustar 9 debian/lintian-overrides0000644000000000000000000000015711743254755012567 0ustar # This shared library is only for NSS. libnss-mysql-bg binary: package-name-doesnt-match-sonames libnss-mysql2 debian/copyright0000644000000000000000000000231311103006654011114 0ustar This package was debianized by Emmanuel Lacour on Sun, 21 Sep 2003 15:35:49 +0200. It was downloaded from http://easynews.dl.sourceforge.net/sourceforge/libnss-mysql/ Upstream Author: Ben Goodwin Copyright: libnss-mysql-bg is Copyright (C) 2002 Ben Goodwin It was created in May 2002, based upon much earlier, non-NSS code. So far, no one else has contributed. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. see /usr/share/common-licenses/GPL for all details. debian/rules0000755000000000000000000000124611743506476010266 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ --with quilt,autotools-dev,autoreconf override_dh_install: dh_install rm -f debian/*/usr/lib/libnss_mysql.la rm -f debian/*/usr/lib/*/libnss_mysql.la rm -f debian/*/usr/lib/libnss_mysql.so rm -f debian/*/usr/lib/*/libnss_mysql.so debian/libnss-mysql-bg.docs0000644000000000000000000000007011103006654013054 0ustar AUTHORS DEBUGGING FAQ NEWS README THANKS TODO UPGRADING debian/libnss-mysql-bg.files0000644000000000000000000000002211103006654013223 0ustar etc/* lib/*.so.2* debian/changelog0000644000000000000000000000471111743507735011057 0ustar libnss-mysql-bg (1.5-3) unstable; urgency=low * Add patch from Harald Weidner to follow the Debian policy in the way shadow passwords are handled (make use of group shadow) (closes: #641404) * Remove deprecated dpatch and upgrade to packaging format "3.0 quilt" (closes: #664438) * Update to Standards-Version to 3.9.3 and debhelper to 9. * Use mysql_config to find mysql libdir when libmysqlclient is multi-arch (closes: #649938) * Lintian cleanup (ancient-autotools-helper-file, debhelper-but-no-misc-depends, package-name-doesnt-match-sonames, spelling-error-in-description) -- Emmanuel Lacour Wed, 18 Apr 2012 11:49:33 +0200 libnss-mysql-bg (1.5-2) unstable; urgency=low * debian/rules: add binary-indep target (closes: #395712) * debian/control: update Standards-Version * debian/compat, debian/control: update debhelper compat * debian/patchs/02_autotools.dpatch: update libtool/autoconf/aclocal files (closes: #542076) -- Emmanuel Lacour Wed, 19 Aug 2009 09:58:05 +0200 libnss-mysql-bg (1.5-1) unstable; urgency=low * New upstream release * debian/control: built with libmysqlclient15-dev (closes: #343773) * debian/control: typo (closes: #300017) -- Emmanuel Lacour Sun, 12 Feb 2006 21:03:46 +0100 libnss-mysql-bg (1.3-2) unstable; urgency=high * debian/control: built with libmysqlclient12-dev. (for libmysqlclient10 -> libmysqlclient12 transition) * debian/control: move "Section" from "Package" to "Source" section. -- Emmanuel Lacour Sun, 6 Mar 2005 19:49:59 +0100 libnss-mysql-bg (1.3-1) unstable; urgency=low * New upstream release -- Emmanuel Lacour Mon, 22 Nov 2004 19:35:00 +0100 libnss-mysql-bg (1.2-3) unstable; urgency=low * Built with libmysqlclient10-dev. closes: #274492 -- Emmanuel Lacour Sun, 3 Oct 2004 22:55:43 +0200 libnss-mysql-bg (1.2-2) unstable; urgency=low * debian/control: fix Standards-Version and description * debian/rules: cleanup config.log on in "clean" target -- Emmanuel Lacour Sun, 29 Aug 2004 11:44:28 +0200 libnss-mysql-bg (1.2-1) unstable; urgency=low * New upstream release -- Emmanuel Lacour Sat, 28 Aug 2004 18:51:16 +0200 libnss-mysql-bg (1.0-1) unstable; urgency=low * Initial Release. -- Emmanuel Lacour Sun, 21 Sep 2003 15:35:49 +0200 debian/control0000644000000000000000000000163111743506442010600 0ustar Source: libnss-mysql-bg Section: admin Priority: optional Maintainer: Emmanuel Lacour Build-Depends: debhelper (>= 9), libmysqlclient15-dev, quilt (>= 0.40), autotools-dev, dh-autoreconf Standards-Version: 3.9.3 Package: libnss-mysql-bg Architecture: any Pre-Depends: multiarch-support Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: mysql-server, libpam-mysql Conflicts: libnss-mysql Description: NSS module for using MySQL as a naming service libnss-mysql-bg provides a Name Service Switch module that allows MySQL to act as a name service. . Its configuration is very flexible by allowing to set an SQL query per NSS call (getpwnam, getpwuid, ...). You would use it instead of the other "libnss-mysql" package for building an NSS over an existing database (used for another purpose like groupware, ...). . It currently supports storage of passwd, group and shadow information. debian/libnss-mysql-bg.examples0000644000000000000000000000007111103006654013743 0ustar sample/README sample/linux sample/minimal sample/complex debian/patches/0000755000000000000000000000000011743511221010612 5ustar debian/patches/05_fix_acinclude0000644000000000000000000000151711743511215013645 0ustar From: Subject: Use mysql_config to find mysql multi-arch libs Index: libnss-mysql-bg-1.5/acinclude.m4 =================================================================== --- libnss-mysql-bg-1.5.orig/acinclude.m4 2012-04-18 10:20:01.205313859 +0200 +++ libnss-mysql-bg-1.5/acinclude.m4 2012-04-18 11:18:19.681344131 +0200 @@ -80,6 +80,19 @@ fi done +dnl Get dir from mysql_config (for multi-arch libs) +MYSQL_CONFIG=`which mysql_config` +if test -n "$MYSQL_CONFIG" -a -x "$MYSQL_CONFIG" +then + MYSQL_LIB_DIR=`$MYSQL_CONFIG --variable=pkglibdir` +dnl Old versions of mysql_config does not have "--variable" option + if test $? -ne 0 + then + MYSQL_LIB_DIR=`mysql_config --libs | sed 's/^.*-L\([[^ ]]\+\).*$/\1/'` + fi +fi + + if test -n "$MYSQL_LIB_DIR" then AC_MSG_RESULT([$MYSQL_LIB_DIR]) debian/patches/04_shadow.diff0000755000000000000000000000254411743505145013254 0ustar From: Subject: Add check for egid to properly works like "shadow" enabled authentications --- libnss-mysql-bg-1.5/src/lookup.c 2011-09-13 09:28:30.000000000 +0200 +++ libnss-mysql-bg-1.5/src/lookup.c 2011-09-13 09:47:16.000000000 +0200 @@ -21,6 +21,8 @@ #include "nss_mysql.h" #include /* snprintf () */ #include /* strcpy () */ +#include +#include extern conf_t conf; @@ -131,12 +133,22 @@ int attempts = MAX_QUERY_ATTEMPTS; /* Attempt # (countdown) */ static uid_t euid = -1; /* Last known euid for change detect */ uid_t cur_euid; /* CURRENT euid */ + gid_t cur_egid; /* CURRENT egid */ + gid_t shadow_gid; /* gid for group shadow (usually 42 on Debian) */ DENTER cur_euid = geteuid (); + + /* Get shadow gid, if needed */ + if(cur_euid != 0) { + cur_egid = getegid (); + struct group *grp = getgrnam("shadow"); + shadow_gid = (grp ? grp->gr_gid : -1); + } + D ("%s: restricted = %d, cur_euid = %u", FUNCNAME, restricted, cur_euid); - if (restricted == ntrue && cur_euid != 0) + if (restricted == ntrue && cur_euid != 0 && (shadow_gid == -1 || cur_egid != shadow_gid)) DSRETURN (NSS_NOTFOUND) /* Make sure euid hasn't changed, thus changing our access abilities */ debian/patches/03_config.diff0000755000000000000000000000063011743505062013223 0ustar From: Subject: Update configuration file to debian layout --- ./sample/linux/libnss-mysql.cfg 2005-01-31 03:16:46.000000000 +0100 +++ ./sample/linux/libnss-mysql.cfg 2008-11-05 14:43:20.000000000 +0100 @@ -35,6 +35,6 @@ database auth username nss-user password userpass -#socket /var/lib/mysql/mysql.sock +#socket /var/run/mysqld/mysqld.sock #port 3306 debian/patches/series0000644000000000000000000000010511743504074012033 0ustar 01_mkinstalldirs.diff 03_config.diff 04_shadow.diff 05_fix_acinclude debian/patches/01_mkinstalldirs.diff0000644000000000000000000000143611743505035014636 0ustar From: Subject: Fix bad mkinstalldirs call --- ./Makefile.am +++ ./Makefile.am @@ -27,12 +27,12 @@ EXTRA_DIST = FAQ UPGRADING DEBUGGING libnss-mysql.spec src/*.sym \ install-data-hook: @if test ! -f ${DESTDIR}${sysconfdir}/libnss-mysql.cfg; then \ - ${srcdir}/aux/mkinstalldirs ${DESTDIR}${sysconfdir}; \ + $(mkinstalldirs) ${DESTDIR}${sysconfdir}; \ ${INSTALL_DATA} ${srcdir}/sample/@OS@/libnss-mysql.cfg \ ${DESTDIR}${sysconfdir}/libnss-mysql.cfg; \ fi @if test ! -f ${DESTDIR}${sysconfdir}/libnss-mysql-root.cfg; then \ - ${srcdir}/aux/mkinstalldirs ${DESTDIR}${sysconfdir}; \ + $(mkinstalldirs) ${DESTDIR}${sysconfdir}; \ ${INSTALL_DATA} -m 600 ${srcdir}/sample/@OS@/libnss-mysql-root.cfg \ ${DESTDIR}${sysconfdir}/libnss-mysql-root.cfg; \ fi debian/libnss-mysql-bg.postinst0000644000000000000000000000221211656253555014030 0ustar #! /bin/sh # postinst script for libnss-mysql-bg # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package # case "$1" in configure) # Make sur /etc/libnss-mysql-root.cfg is only root:shadow readable if [ -f /etc/libnss-mysql-root.cfg ] then chmod 0640 /etc/libnss-mysql-root.cfg chown root:shadow /etc/libnss-mysql-root.cfg fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/source/0000755000000000000000000000000011743505534010475 5ustar debian/source/format0000644000000000000000000000001411743505534011703 0ustar 3.0 (quilt)