diff options
author | Ned Ludd <solar@gentoo.org> | 2005-07-25 12:02:21 +0000 |
---|---|---|
committer | Ned Ludd <solar@gentoo.org> | 2005-07-25 12:02:21 +0000 |
commit | da9f7def3b673ab592ffbf884ab13b0c1149c2e4 (patch) | |
tree | 4de55a0173a3c945bf3cc732316142eb7d6be528 /sys-apps | |
parent | Added to ~ppc (diff) | |
download | gentoo-2-da9f7def3b673ab592ffbf884ab13b0c1149c2e4.tar.gz gentoo-2-da9f7def3b673ab592ffbf884ab13b0c1149c2e4.tar.bz2 gentoo-2-da9f7def3b673ab592ffbf884ab13b0c1149c2e4.zip |
- added no /usr/bin suid option as local use flag nousuid for single user systems
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/shadow/ChangeLog | 9 | ||||
-rw-r--r-- | sys-apps/shadow/Manifest | 105 | ||||
-rw-r--r-- | sys-apps/shadow/files/digest-shadow-4.0.7-r4 | 1 | ||||
-rw-r--r-- | sys-apps/shadow/files/shadow-4.0.7-perms.patch | 49 | ||||
-rw-r--r-- | sys-apps/shadow/shadow-4.0.10.ebuild | 15 | ||||
-rw-r--r-- | sys-apps/shadow/shadow-4.0.7-r4.ebuild | 243 |
6 files changed, 358 insertions, 64 deletions
diff --git a/sys-apps/shadow/ChangeLog b/sys-apps/shadow/ChangeLog index 2999502ce3f0..f4b5e810affc 100644 --- a/sys-apps/shadow/ChangeLog +++ b/sys-apps/shadow/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-apps/shadow # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/ChangeLog,v 1.114 2005/07/19 22:53:10 kloeri Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/ChangeLog,v 1.115 2005/07/25 12:02:21 solar Exp $ + +*shadow-4.0.7-r4 (25 Jul 2005) + + 25 Jul 2005; <solar.@gentoo.org> +files/shadow-4.0.7-perms.patch, + shadow-4.0.10.ebuild, +shadow-4.0.7-r4.ebuild: + - added no /usr/bin suid option as local use flag nousuid for single user + systems 19 Jul 2005; Bryan Østergaard <kloeri@gentoo.org> shadow-4.0.7-r3.ebuild: Stable on alpha. diff --git a/sys-apps/shadow/Manifest b/sys-apps/shadow/Manifest index 169b58dc4fe8..2f7d76b87cf1 100644 --- a/sys-apps/shadow/Manifest +++ b/sys-apps/shadow/Manifest @@ -1,73 +1,66 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -MD5 ac3c5c29460f248d06d4ef83c96ca912 shadow-4.0.7-r1.ebuild 6602 -MD5 2581b4daddefcf73a30d69ac42fdfd1a shadow-4.0.5-r3.ebuild 5614 -MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164 MD5 c2ab407aa2ff8ce76a2600f2d4c6a3b2 shadow-4.0.7-r3.ebuild 7074 -MD5 a51d02eb155feb33913816239bb3cf57 shadow-4.0.7.ebuild 5602 MD5 06049e2959c62c88aee32422a37bf07f shadow-4.0.6-r1.ebuild 5641 -MD5 fad39eceb7fd04f2805c6acc16c59d57 shadow-4.0.5-r2.ebuild 5440 -MD5 a051c07b3475da163b2bd0e6aa20a11a ChangeLog 21076 MD5 db870979ea0f600d0bd8137520e2251a shadow-4.0.4.1-r4.ebuild 5961 -MD5 47d8280522d86e12c3cd5b5c6decc792 shadow-4.0.10.ebuild 6740 -MD5 962e753a4789598d75532745e1f3e6cf files/digest-shadow-4.0.10 67 -MD5 e32464f2df5a85f4f6c67bc78e9a23d1 files/shadow-4.0.7-nscd-socket-path.patch 1081 -MD5 20fd2dc35b8671b91e120b90281b4cf3 files/shadow-4.0.5-hack-X-envvars.patch 521 -MD5 8bf11ce0e8ee683fe290462473871dab files/shadow-4.0.6-long-groupnames.patch 1625 -MD5 020e030c2d09b206e88cf9051ced6244 files/shadow-4.0.4.1-nonis.patch 1504 -MD5 aaf16ddabef285df169e37254b13561c files/shadow-4.0.4.1-selinux.diff 4296 +MD5 2581b4daddefcf73a30d69ac42fdfd1a shadow-4.0.5-r3.ebuild 5614 +MD5 6da02b1a1fa674b120fbcc01b4687fc0 shadow-4.0.7-r4.ebuild 7207 +MD5 a51d02eb155feb33913816239bb3cf57 shadow-4.0.7.ebuild 5602 +MD5 ac3c5c29460f248d06d4ef83c96ca912 shadow-4.0.7-r1.ebuild 6602 +MD5 464e69da659e18ce42c7ba266867feb4 ChangeLog 21312 +MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164 +MD5 89e3e590c3ff98b423ecc9a9323d776f shadow-4.0.10.ebuild 6754 +MD5 fad39eceb7fd04f2805c6acc16c59d57 shadow-4.0.5-r2.ebuild 5440 MD5 c5e9081ed43837797e2f1617b7ce1c24 files/shadow-4.0.5-fix-adding-of-pam_env-set-env-vars.patch 285 -MD5 7becc41b4f7264483ee3ff0ca8277084 files/shadow-4.0.4.1-passwd-typo.patch 438 -MD5 f9846ea2aeefba54443ef5d6796f0bbc files/shadow-4.0.10-nls-manpages.patch 367 +MD5 13cddd2e24cbcaf5164e13f9105c222c files/shadow-4.0.7-perms.patch 1768 MD5 b8efca60a25e256eebe54c3d0db0760f files/shadow-4.0.4.1-gcc34-xmalloc.patch 361 -MD5 90e2ab53494f677dc23b5137d6e39110 files/shadow-4.0.6-fix-configure.patch 3047 -MD5 46c2be2ed8b26ec007e3ed1f476491d8 files/digest-shadow-4.0.7-r1 66 -MD5 fdb23bff28b70bd53f200379c33dd27c files/shadow-4.0.10-nonis.patch 1434 -MD5 cef6788bc7c8c5468c1b1f68df77ed9e files/digest-shadow-4.0.4.1-r4 67 -MD5 a99f871c88548d503bad935d2aa6f412 files/shadow-4.0.4.1-nls-manpages.patch 355 -MD5 d14e133da535d64d1b397784e17c213a files/shadow-4.0.5-login.defs.patch 766 -MD5 058f760e522ab65e270293003805fe61 files/shadow-4.0.4.1-userdel-missing-brackets.patch 380 -MD5 aaedecd7edcccff66f962fd82928eec9 files/shadow-4.0.10-long-groupnames.patch 1205 MD5 a744152ec905f4c06f3b92142b7fec8a files/securetty 253 -MD5 b4d0fc0f54800978591791493d6b2ec3 files/shadow-4.0.6-dots-in-usernames.patch 1993 -MD5 bb55107c3a9354ef2d1977547fdb5a83 files/shadow-4.0.4.1-useradd-manpage-update.patch 958 -MD5 e9ac6a566b65499773437ce98911a046 files/digest-shadow-4.0.6-r1 66 -MD5 d8b8542a7bc013011a293732ca504a50 files/digest-shadow-4.0.5-r2 66 +MD5 020e030c2d09b206e88cf9051ced6244 files/shadow-4.0.4.1-nonis.patch 1504 +MD5 70b7c7f1725841e335e5f2361fc9ebab files/shadow-4.0.7-nscd-EPIPE-failure.patch 947 +MD5 aaedecd7edcccff66f962fd82928eec9 files/shadow-4.0.10-long-groupnames.patch 1205 +MD5 95f7b8980169e81352229bd548909ea7 files/shadow-4.0.10-fix-configure.patch 579 +MD5 aaf16ddabef285df169e37254b13561c files/shadow-4.0.4.1-selinux.diff 4296 +MD5 fda41657b856ffaeec5a2734b312409b files/shadow-4.0.5-fix-mail-configure.patch 5452 MD5 201f1321262da41ccd1a0283216ae9a7 files/shadow-4.0.4.1-su-pam_open_session.patch 4886 -MD5 d15398f7d8c06b906abdf73ae3a55f54 files/shadow-4.0.6-manpages.patch 564 +MD5 fdb23bff28b70bd53f200379c33dd27c files/shadow-4.0.10-nonis.patch 1434 MD5 636f233fa173a998195016c3808173d4 files/shadow-4.0.5-skey.patch 395 +MD5 20fd2dc35b8671b91e120b90281b4cf3 files/shadow-4.0.5-hack-X-envvars.patch 521 +MD5 bb55107c3a9354ef2d1977547fdb5a83 files/shadow-4.0.4.1-useradd-manpage-update.patch 958 +MD5 8bf11ce0e8ee683fe290462473871dab files/shadow-4.0.6-long-groupnames.patch 1625 +MD5 d8b8542a7bc013011a293732ca504a50 files/digest-shadow-4.0.5-r2 66 MD5 d8b8542a7bc013011a293732ca504a50 files/digest-shadow-4.0.5-r3 66 +MD5 e9ac6a566b65499773437ce98911a046 files/digest-shadow-4.0.6-r1 66 +MD5 46c2be2ed8b26ec007e3ed1f476491d8 files/digest-shadow-4.0.7-r1 66 +MD5 46c2be2ed8b26ec007e3ed1f476491d8 files/digest-shadow-4.0.7-r3 66 +MD5 46c2be2ed8b26ec007e3ed1f476491d8 files/digest-shadow-4.0.7-r4 66 +MD5 058f760e522ab65e270293003805fe61 files/shadow-4.0.4.1-userdel-missing-brackets.patch 380 MD5 391991f50203bd8b7738474051befdee files/shadow-4.0.5-remove-else.patch 531 -MD5 c31db5c71b0cdfca75346abc2887aa02 files/shadow-4.0.5-nls-manpages.patch 362 -MD5 6355d65b618395c4adf46f733269546c files/shadow-4.0.10-dots-in-usernames.patch 1894 -MD5 fda41657b856ffaeec5a2734b312409b files/shadow-4.0.5-fix-mail-configure.patch 5452 -MD5 70b7c7f1725841e335e5f2361fc9ebab files/shadow-4.0.7-nscd-EPIPE-failure.patch 947 -MD5 d06833980d79d4f001b6064a3f52f938 files/shadow-4.0.7-iswheel.patch 416 MD5 a63ee37286c486567191c7c6b24432e2 files/shadow-4.0.7-lastlog.patch 455 -MD5 95f7b8980169e81352229bd548909ea7 files/shadow-4.0.10-fix-configure.patch 579 -MD5 46c2be2ed8b26ec007e3ed1f476491d8 files/digest-shadow-4.0.7-r3 66 +MD5 6355d65b618395c4adf46f733269546c files/shadow-4.0.10-dots-in-usernames.patch 1894 MD5 46c2be2ed8b26ec007e3ed1f476491d8 files/digest-shadow-4.0.7 66 +MD5 d15398f7d8c06b906abdf73ae3a55f54 files/shadow-4.0.6-manpages.patch 564 +MD5 cef6788bc7c8c5468c1b1f68df77ed9e files/digest-shadow-4.0.4.1-r4 67 +MD5 b4d0fc0f54800978591791493d6b2ec3 files/shadow-4.0.6-dots-in-usernames.patch 1993 +MD5 d14e133da535d64d1b397784e17c213a files/shadow-4.0.5-login.defs.patch 766 +MD5 a99f871c88548d503bad935d2aa6f412 files/shadow-4.0.4.1-nls-manpages.patch 355 +MD5 7becc41b4f7264483ee3ff0ca8277084 files/shadow-4.0.4.1-passwd-typo.patch 438 +MD5 90e2ab53494f677dc23b5137d6e39110 files/shadow-4.0.6-fix-configure.patch 3047 +MD5 f9846ea2aeefba54443ef5d6796f0bbc files/shadow-4.0.10-nls-manpages.patch 367 +MD5 c31db5c71b0cdfca75346abc2887aa02 files/shadow-4.0.5-nls-manpages.patch 362 +MD5 e32464f2df5a85f4f6c67bc78e9a23d1 files/shadow-4.0.7-nscd-socket-path.patch 1081 +MD5 d06833980d79d4f001b6064a3f52f938 files/shadow-4.0.7-iswheel.patch 416 +MD5 962e753a4789598d75532745e1f3e6cf files/digest-shadow-4.0.10 67 MD5 6e0bc0211949c624da0ea08d994a7038 files/default/useradd 96 -MD5 4b7d75b12f1bea9f349dff4c48c18b8b files/pam.d-include/login 245 -MD5 97b4f01b65fd3b8caa8983489e9b6848 files/pam.d-include/su 1059 -MD5 33d9efd092b6999143ea42c99a59bfb1 files/pam.d-include/system-auth-1.1 365 -MD5 e3a7d5b7abee1ba6e7f09ee607da87ba files/pam.d-include/su-openpam 249 -MD5 5df27e06de913de76e24790642eecfd2 files/pam.d-include/passwd 104 -MD5 5bff4f2134b72dabc4afa5bb296e874d files/pam.d-include/other 142 -MD5 caa5f36d54cb7a75ce5728f7f1badafb files/pam.d-include/system-auth 380 -MD5 50d7c96eab701fd6ddbf4b283e493b4c files/pam.d-include/shadow 152 -MD5 987d0bd2e5dd1f96dc28ae2963054022 files/pam.d/login 333 MD5 a1fc81dbd0d41face776fba4ca929d8f files/pam.d/su 1142 +MD5 987d0bd2e5dd1f96dc28ae2963054022 files/pam.d/login 333 +MD5 5bff4f2134b72dabc4afa5bb296e874d files/pam.d/other 142 MD5 33d9efd092b6999143ea42c99a59bfb1 files/pam.d/system-auth-1.1 365 MD5 8a59937d720a19824db6e4a8cd173a4b files/pam.d/passwd 172 -MD5 5bff4f2134b72dabc4afa5bb296e874d files/pam.d/other 142 -MD5 deed69f8fa52ca844f3669414bd5cf01 files/pam.d/system-auth 373 MD5 a5721c39446539b751dceae4b054542b files/pam.d/shadow 171 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.1 (GNU/Linux) - -iD8DBQFC3aI4gIKl8Uu19MoRAqC+AJ0WaYCPLpZX7RvTckkXbqr8e9vdkQCfcXRD -c68wPgOG5hubpqVdlEYULY0= -=iYAK ------END PGP SIGNATURE----- +MD5 deed69f8fa52ca844f3669414bd5cf01 files/pam.d/system-auth 373 +MD5 97b4f01b65fd3b8caa8983489e9b6848 files/pam.d-include/su 1059 +MD5 4b7d75b12f1bea9f349dff4c48c18b8b files/pam.d-include/login 245 +MD5 5bff4f2134b72dabc4afa5bb296e874d files/pam.d-include/other 142 +MD5 e3a7d5b7abee1ba6e7f09ee607da87ba files/pam.d-include/su-openpam 249 +MD5 33d9efd092b6999143ea42c99a59bfb1 files/pam.d-include/system-auth-1.1 365 +MD5 5df27e06de913de76e24790642eecfd2 files/pam.d-include/passwd 104 +MD5 50d7c96eab701fd6ddbf4b283e493b4c files/pam.d-include/shadow 152 +MD5 caa5f36d54cb7a75ce5728f7f1badafb files/pam.d-include/system-auth 380 diff --git a/sys-apps/shadow/files/digest-shadow-4.0.7-r4 b/sys-apps/shadow/files/digest-shadow-4.0.7-r4 new file mode 100644 index 000000000000..57cfe54be85e --- /dev/null +++ b/sys-apps/shadow/files/digest-shadow-4.0.7-r4 @@ -0,0 +1 @@ +MD5 89ebec0d1c0d861a5bd5c4c63e5cb0cc shadow-4.0.7.tar.bz2 1019749 diff --git a/sys-apps/shadow/files/shadow-4.0.7-perms.patch b/sys-apps/shadow/files/shadow-4.0.7-perms.patch new file mode 100644 index 000000000000..f754ca3f3b14 --- /dev/null +++ b/sys-apps/shadow/files/shadow-4.0.7-perms.patch @@ -0,0 +1,49 @@ +diff -Nrup src/Makefile.am src/Makefile.am +--- src/Makefile.am 2005-07-24 12:33:11.000000000 -0400 ++++ src/Makefile.am 2005-07-24 14:45:52.000000000 -0400 +@@ -46,6 +46,8 @@ noinst_PROGRAMS = id sulogin + + suidbins = su + suidubins = chage chfn chsh expiry gpasswd newgrp passwd ++suidbinperms = 4711 ++suidubinperms = 4711 + + LDADD = $(top_builddir)/libmisc/libmisc.a \ + $(top_builddir)/lib/libshadow.la +@@ -71,8 +73,8 @@ install-am: all-am + ln -sf newgrp $(DESTDIR)$(ubindir)/sg + ln -sf vipw $(DESTDIR)$(usbindir)/vigr + for i in $(suidbins); do \ +- chmod -f 4755 $(DESTDIR)$(bindir)/$$i; \ ++ chmod -f $(suidbinperms) $(DESTDIR)$(bindir)/$$i; \ + done + for i in $(suidubins); do \ +- chmod -f 4755 $(DESTDIR)$(ubindir)/$$i; \ ++ chmod -f $(suidubinperms) $(DESTDIR)$(ubindir)/$$i; \ + done +diff -Nrup src/Makefile.in src/Makefile.in +--- src/Makefile.in 2005-07-24 12:33:56.000000000 -0400 ++++ src/Makefile.in 2005-07-24 14:46:07.000000000 -0400 +@@ -352,6 +352,9 @@ INCLUDES = \ + # id and groups are from gnu, sulogin from sysvinit + suidbins = su + suidubins = chage chfn chsh expiry gpasswd newgrp passwd ++suidbinperms = 4711 ++suidubinperms = 4711 ++ + LDADD = $(top_builddir)/libmisc/libmisc.a \ + $(top_builddir)/lib/libshadow.la + +@@ -835,10 +838,10 @@ install-am: all-am + ln -sf newgrp $(DESTDIR)$(ubindir)/sg + ln -sf vipw $(DESTDIR)$(usbindir)/vigr + for i in $(suidbins); do \ +- chmod -f 4755 $(DESTDIR)$(bindir)/$$i; \ ++ chmod -f $(suidbinperms) $(DESTDIR)$(bindir)/$$i; \ + done + for i in $(suidubins); do \ +- chmod -f 4755 $(DESTDIR)$(ubindir)/$$i; \ ++ chmod -f $(suidubinperms) $(DESTDIR)$(ubindir)/$$i; \ + done + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/sys-apps/shadow/shadow-4.0.10.ebuild b/sys-apps/shadow/shadow-4.0.10.ebuild index b739c13e7f09..094f2b7ca4a2 100644 --- a/sys-apps/shadow/shadow-4.0.10.ebuild +++ b/sys-apps/shadow/shadow-4.0.10.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/shadow-4.0.10.ebuild,v 1.5 2005/07/20 01:00:14 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/shadow-4.0.10.ebuild,v 1.6 2005/07/25 12:02:21 solar Exp $ inherit eutils libtool toolchain-funcs flag-o-matic @@ -15,7 +15,7 @@ LICENSE="BSD" SLOT="0" KEYWORDS="-*" #"~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="nls pam selinux skey" +IUSE="nls pam selinux skey nousuid" RDEPEND=">=sys-libs/cracklib-2.7-r3 pam? ( virtual/pam ) @@ -58,6 +58,9 @@ src_unpack() { # Fix EPIPE failure when writing to nscd, bug #80413 epatch "${FILESDIR}"/${PN}-4.0.7-nscd-EPIPE-failure.patch + # lock down setuid perms #47208 + epatch "${FILESDIR}"/${PN}-4.0.7-perms.patch + elibtoolize epunt_cxx } @@ -81,13 +84,11 @@ src_compile() { } src_install() { - make DESTDIR=${D} install || die "install problem" + local perms=4711 + use nousuid && perms=711 + make DESTDIR=${D} suiduperms=${perms} install || die "install problem" dosym useradd /usr/sbin/adduser - # lock down setuid perms #47208 - fperms go-r /bin/su /usr/bin/ch{fn,sh,age} \ - /usr/bin/{expiry,newgrp,passwd,gpasswd} || die "fperms" - # 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 diff --git a/sys-apps/shadow/shadow-4.0.7-r4.ebuild b/sys-apps/shadow/shadow-4.0.7-r4.ebuild new file mode 100644 index 000000000000..d291c255b813 --- /dev/null +++ b/sys-apps/shadow/shadow-4.0.7-r4.ebuild @@ -0,0 +1,243 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/shadow-4.0.7-r4.ebuild,v 1.1 2005/07/25 12:02:21 solar Exp $ + +inherit eutils libtool toolchain-funcs flag-o-matic multilib + +# We should remove this login after pam-0.78 goes stable. +FORCE_SYSTEMAUTH_UPDATE="no" + +DESCRIPTION="Utilities to deal with user accounts" +HOMEPAGE="http://shadow.pld.org.pl/" +SRC_URI="ftp://ftp.pld.org.pl/software/shadow/${P}.tar.bz2" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="pam selinux nls skey nousuid" + +RDEPEND=">=sys-libs/cracklib-2.7-r3 + pam? ( virtual/pam ) + !pam? ( !sys-apps/pam-login ) + skey? ( app-admin/skey ) + selinux? ( sys-libs/libselinux )" +DEPEND="${RDEPEND} + >=sys-apps/portage-2.0.51-r2 + nls? ( sys-devel/gettext )" +# We moved /etc/pam.d/login to pam-login +PDEPEND="pam? ( >=sys-apps/pam-login-3.17 )" + +pkg_preinst() { + rm -f ${ROOT}/etc/pam.d/system-auth.new +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # uclibc support, corrects NIS usage + epatch "${FILESDIR}"/shadow-4.0.4.1-nonis.patch + + # If su should not simulate a login shell, use '/bin/sh' as shell to enable + # running of commands as user with /bin/false as shell, closing bug #15015. + # *** This one could be a security hole; disable for now *** + #epatch "${FILESDIR}"/${P}-nologin-run-sh.patch + + # don't install manpages if USE=-nls + epatch "${FILESDIR}"/shadow-4.0.5-nls-manpages.patch + + # tweak the default login.defs + epatch "${FILESDIR}"/shadow-4.0.5-login.defs.patch + + # skeychallenge call needs updating #69741 + epatch "${FILESDIR}"/shadow-4.0.5-skey.patch + + # The new configure changes do not detect utmp/logdir properly + epatch "${FILESDIR}"/shadow-4.0.6-fix-configure.patch + + # Tweak manpages #70880 + epatch "${FILESDIR}"/shadow-4.0.6-manpages.patch + + # Fix SU_WHEEL_ONLY behavior #80345 + epatch "${FILESDIR}"/${P}-iswheel.patch + + # Fix lastlog not logged for tty's + epatch "${FILESDIR}"/${P}-lastlog.patch + + # Make user/group names more flexible #3485 / #22920 + epatch "${FILESDIR}"/shadow-4.0.6-dots-in-usernames.patch + epatch "${FILESDIR}"/shadow-4.0.6-long-groupnames.patch + + # Newer glibc's have a different nscd socket location #74395 + epatch "${FILESDIR}"/${P}-nscd-socket-path.patch + + # Fix EPIPE failure when writing to nscd, bug #80413 + epatch "${FILESDIR}"/${P}-nscd-EPIPE-failure.patch + + # lock down setuid perms #47208 + epatch "${FILESDIR}"/${PN}-4.0.7-perms.patch + + elibtoolize + epunt_cxx +} + +src_compile() { + append-ldflags -Wl,-z,now + [[ ${CTARGET:-${CHOST}} != ${CHOST} ]] \ + && export ac_cv_func_setpgrp_void=yes + econf \ + --disable-desrpc \ + --with-libcrypt \ + --with-libcrack \ + --enable-shared=no \ + --enable-static=yes \ + $(use_with pam libpam) \ + $(use_with skey libskey) \ + $(use_with selinux) \ + $(use_enable nls) \ + || die "bad configure" + emake || die "compile problem" +} + +src_install() { + local perms=4711 + use nousuid && perms=711 + make DESTDIR="${D}" suidubinperms=${perms} install || die "install problem" + dosym useradd /usr/sbin/adduser + + fperms go-r /bin/su /usr/bin/ch{fn,sh,age} \ + /usr/bin/{expiry,newgrp,passwd,gpasswd} || die "fperms" + + # 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} + + if use pam; then + # These is now shipped with pam-login, and login + # had/have a serious root exploit with pam support + # enabled. + for x in "${D}"/bin/login \ + "${D}"/usr/bin/faillog "${D}"/usr/bin/lastlog \ + "${D}"/usr/share/man/man5/faillog.5* \ + "${D}"/usr/share/man/man8/lastlog.8* \ + "${D}"/usr/share/man/man8/faillog.8*; do + [[ -f ${x} ]] && rm -f ${x} + done + fi + + insinto /etc + # Using a securetty with devfs device names added + # (compat names kept for non-devfs compatibility) + insopts -m0600 ; doins "${FILESDIR}"/securetty + insopts -m0600 ; doins etc/login.access + insopts -m0644 ; doins etc/limits + # Output arch-specific cruft + case $(tc-arch) in + ppc64) echo "hvc0" >> "${D}"/etc/securetty + echo "hvsi0" >> "${D}"/etc/securetty;; + hppa) echo "ttyB0" >> "${D}"/etc/securetty;; + arm) echo "ttyFB0" >> "${D}"/etc/securetty;; + esac + + # needed for 'adduser -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 + + if use pam ; then + local INSTALL_SYSTEM_PAMD="yes" + + # Do not install below pam.d files if we have pam-0.78 or later + portageq has_version / '>=sys-libs/pam-0.78' && \ + INSTALL_SYSTEM_PAMD="no" + + for x in "${FILESDIR}"/pam.d-include/*; do + case "${x##*/}" in + "login") + # We do no longer install this one, as its from + # pam-login now. + ;; + "system-auth"|"system-auth-1.1"|"other") + # These we only install if we do not have pam-0.78 + # or later. + [ "${INSTALL_SYSTEM_PAMD}" = "yes" ] && [ -f ${x} ] && \ + dopamd ${x} + ;; + "su") + # Disable support for pam_env and pam_wheel on openpam + has_version sys-libs/pam && dopamd ${x} + ;; + "su-openpam") + has_version sys-libs/openpam && newpamd ${x} su + ;; + *) + [ -f ${x} ] && dopamd ${x} + ;; + esac + done + for x in chage chsh chfn chpasswd newusers \ + user{add,del,mod} group{add,del,mod} ; do + newpamd "${FILESDIR}"/pam.d-include/shadow ${x} + done + + # Only add this one if needed. + if [ "${FORCE_SYSTEMAUTH_UPDATE}" = "yes" ]; then + newpamd "${FILESDIR}"/pam.d-include/system-auth-1.1 system-auth.new || \ + die "Failed to install system-auth.new!" + fi + + # remove manpages that pam will install for us + # and/or don't apply when using pam + + find "${D}"/usr/share/man \ + '(' -name 'login.1' -o -name 'suauth.5' ')' \ + -exec rm {} \; + else + insinto /etc + insopts -m0644 + newins etc/login.defs.linux login.defs + 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}"/doc + dodoc INSTALL README WISHLIST + docinto txt + dodoc HOWTO LSM README.* *.txt +} + +pkg_postinst() { + use pam || return 0; + + if [ "${FORCE_SYSTEMAUTH_UPDATE}" = "yes" ]; then + local CHECK1="$(md5sum ${ROOT}/etc/pam.d/system-auth | cut -d ' ' -f 1)" + local CHECK2="$(md5sum ${ROOT}/etc/pam.d/system-auth.new | cut -d ' ' -f 1)" + + if [ "${CHECK1}" != "${CHECK2}" ]; then + ewarn "Due to a security issue, ${ROOT}etc/pam.d/system-auth " + ewarn "is being updated automatically. Your old " + ewarn "system-auth will be backed up as:" + ewarn + ewarn " ${ROOT}etc/pam.d/system-auth.bak" + echo + + cp -a ${ROOT}/etc/pam.d/system-auth \ + ${ROOT}/etc/pam.d/system-auth.bak; + mv -f ${ROOT}/etc/pam.d/system-auth.new \ + ${ROOT}/etc/pam.d/system-auth + rm -f ${ROOT}/etc/pam.d/._cfg????_system-auth + else + rm -f ${ROOT}/etc/pam.d/system-auth.new + fi + fi +} |