summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-02-13 05:18:04 +0000
committerMike Frysinger <vapier@gentoo.org>2012-02-13 05:18:04 +0000
commite5e7dcd74bcb92e582e9113a36360222409aeb56 (patch)
tree5fbb33245a46c4234bec3bfdbe1bd867b8474b5b /sys-apps/shadow
parentAdd KEYWORD love, and move group install to pkg_preinst since we only need th... (diff)
downloadgentoo-2-e5e7dcd74bcb92e582e9113a36360222409aeb56.tar.gz
gentoo-2-e5e7dcd74bcb92e582e9113a36360222409aeb56.tar.bz2
gentoo-2-e5e7dcd74bcb92e582e9113a36360222409aeb56.zip
Version bump.
(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/shadow')
-rw-r--r--sys-apps/shadow/ChangeLog12
-rw-r--r--sys-apps/shadow/files/shadow-4.1.5-nscd-ignore-exit-1.patch30
-rw-r--r--sys-apps/shadow/files/shadow-4.1.5-nscd-newline-msg.patch38
-rw-r--r--sys-apps/shadow/files/shadow-4.1.5-stdarg.patch37
-rw-r--r--sys-apps/shadow/metadata.xml3
-rw-r--r--sys-apps/shadow/shadow-4.1.5.ebuild200
6 files changed, 317 insertions, 3 deletions
diff --git a/sys-apps/shadow/ChangeLog b/sys-apps/shadow/ChangeLog
index 440177aa57de..7c6ff0f22372 100644
--- a/sys-apps/shadow/ChangeLog
+++ b/sys-apps/shadow/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-apps/shadow
-# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/ChangeLog,v 1.264 2011/12/31 07:40:41 vapier Exp $
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/ChangeLog,v 1.265 2012/02/13 05:18:04 vapier Exp $
+
+*shadow-4.1.5 (13 Feb 2012)
+
+ 13 Feb 2012; Mike Frysinger <vapier@gentoo.org> +shadow-4.1.5.ebuild,
+ +files/shadow-4.1.5-nscd-ignore-exit-1.patch,
+ +files/shadow-4.1.5-nscd-newline-msg.patch, +files/shadow-4.1.5-stdarg.patch,
+ metadata.xml:
+ Version bump.
31 Dec 2011; Mike Frysinger <vapier@gentoo.org> shadow-4.1.4.3.ebuild:
Add more arm consoles to securetty #396011 by Raúl Porcel.
diff --git a/sys-apps/shadow/files/shadow-4.1.5-nscd-ignore-exit-1.patch b/sys-apps/shadow/files/shadow-4.1.5-nscd-ignore-exit-1.patch
new file mode 100644
index 000000000000..49f75e049818
--- /dev/null
+++ b/sys-apps/shadow/files/shadow-4.1.5-nscd-ignore-exit-1.patch
@@ -0,0 +1,30 @@
+From 357ff92218a68f2ea74b9d08867c662571012bbe Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 12 Feb 2012 23:37:04 -0500
+Subject: [PATCH 3/3] nscd: ignore exit 1 code
+
+If nscd is installed but not in use, then running `nscd -i` will exit(1).
+We shouldn't warn in this case since this is not abnormal behavior.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ lib/nscd.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/lib/nscd.c b/lib/nscd.c
+index ea1dc55..7adb58f 100644
+--- a/lib/nscd.c
++++ b/lib/nscd.c
+@@ -39,6 +39,9 @@ int nscd_flush_cache (const char *service)
+ /* nscd is not installed, or it is installed but uses an
+ interpreter that is missing. Probably the former. */
+ return 0;
++ } else if (code == 1) {
++ /* nscd is installed, but it isn't active. */
++ return 0;
+ } else if (code != 0) {
+ (void) fprintf (stderr, _("%s: nscd exited with status %d\n"),
+ Prog, code);
+--
+1.7.8.4
+
diff --git a/sys-apps/shadow/files/shadow-4.1.5-nscd-newline-msg.patch b/sys-apps/shadow/files/shadow-4.1.5-nscd-newline-msg.patch
new file mode 100644
index 000000000000..2df107fc0921
--- /dev/null
+++ b/sys-apps/shadow/files/shadow-4.1.5-nscd-newline-msg.patch
@@ -0,0 +1,38 @@
+From 360351b9b99bba0a278923c4237d158cbd726df5 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 12 Feb 2012 23:08:42 -0500
+Subject: [PATCH 1/3] nscd: add missing newline to warning msg
+
+Trying to run `passwd` without nscd running shows the messages:
+...
+Re-enter new password:
+passwd: nscd exited with status 1passwd: Failed to flush the nscd cache.
+passwd: nscd exited with status 1passwd: Failed to flush the nscd cache.
+passwd: nscd exited with status 1passwd: Failed to flush the nscd cache.
+passwd: nscd exited with status 1passwd: Failed to flush the nscd cache.
+passwd: password changed.
+...
+
+You can see the status message missing a newline, so add it.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ lib/nscd.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/lib/nscd.c b/lib/nscd.c
+index 227c205..ea1dc55 100644
+--- a/lib/nscd.c
++++ b/lib/nscd.c
+@@ -40,7 +40,7 @@ int nscd_flush_cache (const char *service)
+ interpreter that is missing. Probably the former. */
+ return 0;
+ } else if (code != 0) {
+- (void) fprintf (stderr, _("%s: nscd exited with status %d"),
++ (void) fprintf (stderr, _("%s: nscd exited with status %d\n"),
+ Prog, code);
+ (void) fprintf (stderr, _(MSG_NSCD_FLUSH_CACHE_FAILED), Prog);
+ return -1;
+--
+1.7.8.4
+
diff --git a/sys-apps/shadow/files/shadow-4.1.5-stdarg.patch b/sys-apps/shadow/files/shadow-4.1.5-stdarg.patch
new file mode 100644
index 000000000000..4ed370c7e63b
--- /dev/null
+++ b/sys-apps/shadow/files/shadow-4.1.5-stdarg.patch
@@ -0,0 +1,37 @@
+From 04d19a920ea0cf74f977006e3f8241bf77cbc16b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 12 Feb 2012 22:41:05 -0500
+Subject: [PATCH] copydir: include stdarg.h for va_* funcs
+
+Building on newer systems fails due to using stdargs but not including
+the header file:
+
+copydir.c: In function 'error_acl':
+copydir.c:126:2: warning: implicit declaration of function 'va_start' [-Wimplicit-function-declaration]
+copydir.c:132:2: warning: implicit declaration of function 'va_end' [-Wimplicit-function-declaration]
+...
+libmisc/copydir.c:126: undefined reference to 'va_start'
+libmisc/copydir.c:132: undefined reference to 'va_end'
+...
+make[2]: *** [useradd] Error 1
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ libmisc/copydir.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/libmisc/copydir.c b/libmisc/copydir.c
+index 7cb5f56..c6cbe6b 100644
+--- a/libmisc/copydir.c
++++ b/libmisc/copydir.c
+@@ -40,6 +40,7 @@
+ #include <sys/time.h>
+ #include <fcntl.h>
+ #include <stdio.h>
++#include <stdarg.h>
+ #include "prototypes.h"
+ #include "defines.h"
+ #ifdef WITH_SELINUX
+--
+1.7.8.4
+
diff --git a/sys-apps/shadow/metadata.xml b/sys-apps/shadow/metadata.xml
index 668ffaa63d8e..182ab3c94323 100644
--- a/sys-apps/shadow/metadata.xml
+++ b/sys-apps/shadow/metadata.xml
@@ -4,6 +4,7 @@
<herd>base-system</herd>
<herd>pam</herd> <!-- only for USE=pam -->
<use>
- <flag name='audit'>Enable support for <pkg>sys-process/audit</pkg></flag>
+ <flag name='audit'>Enable support for <pkg>sys-process/audit</pkg></flag>
+ <flag name='tcb'>Enable support for <pkg>sys-auth/tcb</pkg></flag>
</use>
</pkgmetadata>
diff --git a/sys-apps/shadow/shadow-4.1.5.ebuild b/sys-apps/shadow/shadow-4.1.5.ebuild
new file mode 100644
index 000000000000..e66c878d7748
--- /dev/null
+++ b/sys-apps/shadow/shadow-4.1.5.ebuild
@@ -0,0 +1,200 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/shadow-4.1.5.ebuild,v 1.1 2012/02/13 05:18:04 vapier Exp $
+
+inherit eutils libtool toolchain-funcs pam multilib
+
+DESCRIPTION="Utilities to deal with user accounts"
+HOMEPAGE="http://shadow.pld.org.pl/ http://pkg-shadow.alioth.debian.org/"
+SRC_URI="http://pkg-shadow.alioth.debian.org/releases/${P}.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="acl audit cracklib nls pam selinux skey tcb xattr"
+
+RDEPEND="acl? ( sys-apps/acl )
+ audit? ( sys-process/audit )
+ cracklib? ( >=sys-libs/cracklib-2.7-r3 )
+ pam? ( virtual/pam )
+ skey? ( sys-auth/skey )
+ selinux? ( >=sys-libs/libselinux-1.28 )
+ nls? ( virtual/libintl )
+ tcb? ( sys-auth/tcb )
+ xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+RDEPEND="${RDEPEND}
+ pam? ( >=sys-auth/pambase-20080219.1 )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-4.1.3-dots-in-usernames.patch #22920
+ epatch "${FILESDIR}"/${PN}-4.1.5-stdarg.patch
+ epatch "${FILESDIR}"/${PN}-4.1.5-nscd-newline-msg.patch
+ epatch "${FILESDIR}"/${PN}-4.1.5-nscd-ignore-exit-1.patch
+ elibtoolize
+ epunt_cxx
+}
+
+src_compile() {
+ tc-is-cross-compiler && export ac_cv_func_setpgrp_void=yes
+ econf \
+ --without-group-name-max-length \
+ --enable-shared=no \
+ --enable-static=yes \
+ $(use_with acl) \
+ $(use_with audit) \
+ $(use_with cracklib libcrack) \
+ $(use_with pam libpam) \
+ $(use_with skey) \
+ $(use_with selinux) \
+ $(use_enable nls) \
+ $(use_with elibc_glibc nscd) \
+ $(use_with tcb) \
+ $(use_with xattr attr)
+ emake || die
+}
+
+set_login_opt() {
+ local comment="" opt=$1 val=$2
+ [[ -z ${val} ]] && comment="#"
+ sed -i -r \
+ -e "/^#?${opt}/s:.*:${comment}${opt} ${val}:" \
+ "${D}"/etc/login.defs
+ local res=$(grep "^${comment}${opt}" "${D}"/etc/login.defs)
+ einfo ${res:-Unable to find ${opt} in /etc/login.defs}
+}
+
+src_install() {
+ emake DESTDIR="${D}" suidperms=4711 install || die
+
+ # Remove libshadow and libmisc; see bug 37725 and the following
+ # comment from shadow's README.linux:
+ # Currently, libshadow.a is for internal use only, so if you see
+ # -lshadow in a Makefile of some other package, it is safe to
+ # remove it.
+ rm -f "${D}"/{,usr/}$(get_libdir)/lib{misc,shadow}.{a,la}
+
+ insinto /etc
+ # Using a securetty with devfs device names added
+ # (compat names kept for non-devfs compatibility)
+ insopts -m0600 ; doins "${FILESDIR}"/securetty
+ if ! use pam ; then
+ insopts -m0600
+ doins etc/login.access etc/limits
+ fi
+ # Output arch-specific cruft
+ local devs
+ case $(tc-arch) in
+ ppc*) devs="hvc0 hvsi0 ttyPSC0";;
+ hppa) devs="ttyB0";;
+ arm) devs="ttyFB0 ttySAC0 ttySAC1 ttymxc0 ttymxc1 ttyO0 ttyO1 ttyO2";;
+ sh) devs="ttySC0 ttySC1";;
+ esac
+ [[ -n ${devs} ]] && printf '%s\n' ${devs} >> "${D}"/etc/securetty
+
+ # needed for 'useradd -D'
+ insinto /etc/default
+ insopts -m0600
+ doins "${FILESDIR}"/default/useradd
+
+ # move passwd to / to help recover broke systems #64441
+ mv "${D}"/usr/bin/passwd "${D}"/bin/
+ dosym /bin/passwd /usr/bin/passwd
+
+ cd "${S}"
+ insinto /etc
+ insopts -m0644
+ newins etc/login.defs login.defs
+
+ if ! use pam ; then
+ set_login_opt MAIL_CHECK_ENAB no
+ set_login_opt SU_WHEEL_ONLY yes
+ set_login_opt CRACKLIB_DICTPATH /usr/$(get_libdir)/cracklib_dict
+ set_login_opt LOGIN_RETRIES 3
+ set_login_opt ENCRYPT_METHOD SHA512
+ else
+ dopamd "${FILESDIR}/pam.d-include/"{su,shadow}
+
+ newpamd "${FILESDIR}/login.pamd.3" login
+
+ for x in passwd chpasswd chgpasswd; do
+ newpamd "${FILESDIR}"/pam.d-include/passwd ${x} || die
+ done
+
+ for x in chage chsh chfn newusers \
+ user{add,del,mod} group{add,del,mod} ; do
+ newpamd "${FILESDIR}"/pam.d-include/shadow ${x} || die
+ done
+
+ # comment out login.defs options that pam hates
+ local opt
+ for opt in \
+ CHFN_AUTH \
+ CRACKLIB_DICTPATH \
+ ENV_HZ \
+ ENVIRON_FILE \
+ FAILLOG_ENAB \
+ FTMP_FILE \
+ LASTLOG_ENAB \
+ MAIL_CHECK_ENAB \
+ MOTD_FILE \
+ NOLOGINS_FILE \
+ OBSCURE_CHECKS_ENAB \
+ PASS_ALWAYS_WARN \
+ PASS_CHANGE_TRIES \
+ PASS_MIN_LEN \
+ PORTTIME_CHECKS_ENAB \
+ QUOTAS_ENAB \
+ SU_WHEEL_ONLY
+ do
+ set_login_opt ${opt}
+ done
+
+ sed -i -f "${FILESDIR}"/login_defs_pam.sed \
+ "${D}"/etc/login.defs
+
+ # remove manpages that pam will install for us
+ # and/or don't apply when using pam
+ find "${D}"/usr/share/man \
+ '(' -name 'limits.5*' -o -name 'suauth.5*' ')' \
+ -exec rm {} +
+ fi
+
+ # Remove manpages that are handled by other packages
+ find "${D}"/usr/share/man \
+ '(' -name id.1 -o -name passwd.5 -o -name getspnam.3 ')' \
+ -exec rm {} +
+
+ cd "${S}"
+ dodoc ChangeLog NEWS TODO
+ newdoc README README.download
+ cd doc
+ dodoc HOWTO README* WISHLIST *.txt
+}
+
+pkg_preinst() {
+ rm -f "${ROOT}"/etc/pam.d/system-auth.new \
+ "${ROOT}/etc/login.defs.new"
+
+ use pam && pam_epam_expand "${D}"/etc/pam.d/login
+}
+
+pkg_postinst() {
+ # Enable shadow groups (we need ROOT=/ here, as grpconv only
+ # operate on / ...).
+ local re="${ROOT}/etc"
+ if [ ! -f "${re}"/gshadow ] ; then
+ if grpck -r "${re}"/group "${re}"/gshadow 2>/dev/null ; then
+ # Would be nice to add --root option to the *conv utils ...
+ [ "${ROOT}" = "/" ] && grpconv
+ else
+ ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
+ ewarn "run 'grpconv' afterwards!"
+ fi
+ fi
+
+ einfo "The 'adduser' symlink to 'useradd' has been dropped."
+}