diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-04-21 17:20:11 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-04-21 17:20:11 +0000 |
commit | 4f19ee6ccb578a1e26f7a18748a616e893dda163 (patch) | |
tree | f671ea69682713b5d728b1caa916b0ee8bc3b6a3 /sys-apps/shadow | |
parent | old (diff) | |
download | historical-4f19ee6ccb578a1e26f7a18748a616e893dda163.tar.gz historical-4f19ee6ccb578a1e26f7a18748a616e893dda163.tar.bz2 historical-4f19ee6ccb578a1e26f7a18748a616e893dda163.zip |
Fix crash when calling userdel #405409 by Yuri Mamaev. Add patch for groupadd on selinux #406819 by Amadeusz Sławiński. Depend on libsemanage when USE=selinux #408173 by Markus Knetschke.
Package-Manager: portage-2.2.0_alpha100/cvs/Linux x86_64
Diffstat (limited to 'sys-apps/shadow')
-rw-r--r-- | sys-apps/shadow/ChangeLog | 11 | ||||
-rw-r--r-- | sys-apps/shadow/Manifest | 25 | ||||
-rw-r--r-- | sys-apps/shadow/files/shadow-4.1.5-grremove.patch | 49 | ||||
-rw-r--r-- | sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch | 32 | ||||
-rw-r--r-- | sys-apps/shadow/shadow-4.1.5-r2.ebuild | 203 |
5 files changed, 313 insertions, 7 deletions
diff --git a/sys-apps/shadow/ChangeLog b/sys-apps/shadow/ChangeLog index c8b9078a3529..d648420ab852 100644 --- a/sys-apps/shadow/ChangeLog +++ b/sys-apps/shadow/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for sys-apps/shadow # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/ChangeLog,v 1.268 2012/04/17 08:38:50 phajdan.jr Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/ChangeLog,v 1.269 2012/04/21 17:20:11 vapier Exp $ + +*shadow-4.1.5-r2 (21 Apr 2012) + + 21 Apr 2012; Mike Frysinger <vapier@gentoo.org> +shadow-4.1.5-r2.ebuild, + +files/shadow-4.1.5-grremove.patch, + +files/shadow-4.1.5-selinux-groupadd.patch: + Fix crash when calling userdel #405409 by Yuri Mamaev. Add patch for groupadd + on selinux #406819 by Amadeusz Sławiński. Depend on libsemanage when + USE=selinux #408173 by Markus Knetschke. *shadow-4.1.5-r1 (17 Apr 2012) diff --git a/sys-apps/shadow/Manifest b/sys-apps/shadow/Manifest index e448cdc7bf23..4fc3b33f18c6 100644 --- a/sys-apps/shadow/Manifest +++ b/sys-apps/shadow/Manifest @@ -1,5 +1,5 @@ -----BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 +Hash: SHA1 AUX default/useradd 96 RMD160 55c38953c800c6aae1ebe4312028560f77e7414f SHA1 348916abd4f794ee99310e1c006fbf00296ea2d7 SHA256 31aa2cbe4a34a9f7d4d134c1fecd007c9bbf4d40e19d0dcddbcd396f1853b490 AUX login.defs 6254 RMD160 1daa093f13d56126833e6e97d6dd60498a68304a SHA1 0cb67ea901d9544f1bb6f8f147aa25bb2f50628e SHA256 b7bfd7b1c34ce3d35865b572abc69d278dea4eef4f349c26b238735547c4ac22 @@ -21,8 +21,10 @@ AUX shadow-4.1.4.2-fix-etc-gshadow-reading.patch 570 RMD160 80cbb45693ce4a1b19ce AUX shadow-4.1.4.2-groupmod-pam-check.patch 689 RMD160 daa22dfce4b35d02951958fafdbac3816794bd63 SHA1 5823f38c0085b27e7e4327ab17ecc13563a43650 SHA256 ad60c0c26b70007750da034223eca38f1a98512fc80ce2fe40440e31a7585c52 AUX shadow-4.1.4.2-su_no_sanitize_env.patch 315 RMD160 114abfb9ccc429342a83b8e919929c3818019718 SHA1 28ca6c0624c0fe5e4582ccca54e957ede125e96d SHA256 675098bb3dca4d8ac78e6c1c4ae7f513cb4017583b34b6b4d67611578bff8723 AUX shadow-4.1.4.3-dup-install-targets.patch 695 RMD160 68c8ac6ea510b81559f93663123f5da56fde0ba9 SHA1 ec9b6880748047896a41f714edfdf35070693690 SHA256 8d8cebd032acb9f20a1ff99d8db2b95952ebb8a3592a7b1088364ed88cf70d11 +AUX shadow-4.1.5-grremove.patch 1664 RMD160 6144ceffabeadd7fa4aaca8a8692ab1ce516911b SHA1 a37009af79794efa19106bb3841eab897f2755ae SHA256 626536837e0cdc6903200de0d63b23c5a0d4a88f8d9b668e830a7035ab5f7e01 AUX shadow-4.1.5-nscd-ignore-exit-1.patch 988 RMD160 6f88e6d0cf0a6dbe9d61f62ffdd64877f795d7a2 SHA1 76cebffc6702416471a6d935a4b1bc76d8ce7a1c SHA256 b44d1706553f084b9949467c10be17661d8a01dda308f323ea14e406caf84347 AUX shadow-4.1.5-nscd-newline-msg.patch 1332 RMD160 28a80cfc66102376135092d5af24e3ee3b0aea6a SHA1 38216a555a45a66a6206bf1f70910c2d05b22705 SHA256 37142316d0c06584801d65e902798108995d59f52eda8c76d322479a31c9cff1 +AUX shadow-4.1.5-selinux-groupadd.patch 703 RMD160 b10c214719ad4fe67d04190b0a524aaab90824b1 SHA1 4dc97ab97b125c3d1c0dfa50c70f6a837d9743ff SHA256 62cce19aa1c702bc099948e694166f19d057849a6fdde99ffea52a4e3e2dab99 AUX shadow-4.1.5-stdarg.patch 1137 RMD160 79b451539e55172a1ea4ee41dedcf8d9625e781e SHA1 5b9fee3b369268b88c7f05edbc748bc5692e08d8 SHA256 9280f8337651dc25f22f52acd8f4467b592d1f664bd35ce1f2f431335b1aef5b DIST shadow-4.1.4.2.tar.bz2 1790400 RMD160 8483dc5aefc52708199e09a7b2d6831f0a8e357b SHA1 43e29471057c671de51360b10e3ee2b419c78ffa SHA256 97987f6a7967a85e6aa0dba2a1d52db8bd69af5a717391de5693db768fb78990 DIST shadow-4.1.4.3.tar.bz2 1804034 RMD160 0a38818054c40f4ca812da6b34aac5e2572c5d7c SHA1 ad9b85b5531ce8e68f4695efc4ac53ba7266269e SHA256 633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778 @@ -30,13 +32,24 @@ DIST shadow-4.1.5.tar.bz2 2155227 RMD160 b0653f4d1a4a841a37a43d4062e926037637d1d EBUILD shadow-4.1.4.2-r6.ebuild 5321 RMD160 422fc2391be087e10312e27167b762d5826899fa SHA1 cb31c00c78bffad366209d2629f31cb10ee15869 SHA256 4a77c13904a42a146ce4c6becb1d98c692491947b45e249cf615c2bed88278a6 EBUILD shadow-4.1.4.3.ebuild 5444 RMD160 503b532a45b4d525738eb5cdc16ff8bf3ce70906 SHA1 f820b8eb4ad2f72e333d23853bba27756ff503f4 SHA256 6dc66833bc299c72a38f9185b04cdc2842a8b47769c268064afd83ce9a315a8f EBUILD shadow-4.1.5-r1.ebuild 5393 RMD160 27b50133e5b7e216bd9aca9d70d41e848b8f277b SHA1 d444387b9823ab7e2cc20f9133e5f5eb5ea134f7 SHA256 34b9dfbf57a73d4a860341f2af4d620b1ae9d1bf2f40945847c0516e531f4bfb +EBUILD shadow-4.1.5-r2.ebuild 5537 RMD160 d1b9c8b82b2a20b638ad560aa5e7a5a4763bd2d2 SHA1 773cf178790ad2c81deb7da0089d4cc73749584d SHA256 4dbb4050390b9b765f035726078f6b80e1b77c63fee2ec3c3094e2e4c3363b71 EBUILD shadow-4.1.5.ebuild 5345 RMD160 9e7e9e0b714e40fd576ee7849a5184669af7bf69 SHA1 56388262d0e58e478f6ffae239476c162cf61d33 SHA256 a0c39908094645b32f27e3868f9d0a32c288830ba427af14884418f0bef9931c -MISC ChangeLog 45371 RMD160 d5c0b9711bf661e876767f172847676e824fdde8 SHA1 d31cc4799a874407951e3d004b8a5d1e3c3c2558 SHA256 fd430adeb1c3f750d0ed0574b7af9bec3dd7e19783bd652f4f3adb8cf9f09077 +MISC ChangeLog 45755 RMD160 228f731d56875404e7a2cfe255dc52002d6adc01 SHA1 ff853a567e4fd9237d7f1f039c8ae6bd0d2d1092 SHA256 672e30ee0a81a09780a178a9b92c496cd18a6e7407e5c9552f12ed98db25e265 MISC metadata.xml 363 RMD160 cf7a6fae3991418e259df9bb1f97fd6828e76f53 SHA1 3237fbcc775674c3a21c0b7decfa610d3975fcb9 SHA256 5a445d4b5ca320516347a02942491a7a19dfacd5aa353ed8b31ab6ed71351819 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.17 (GNU/Linux) +Version: GnuPG v2.0.19 (GNU/Linux) -iEYEAREKAAYFAk+NLCEACgkQuUQtlDBCeQLmxwCdEnzS928WNHn5FxgsOUEayFs5 -QQcAoIA60ZZ0HlpwC2LPcUAGrfbRocZk -=MIJH +iQIcBAEBAgAGBQJPkuyYAAoJELEHsLL7fEFWn4IQALNbBcywKnkrwpqvViwASJft +gOiwLkKl0DkWzL3iWGcVCoFUp0DsQQD7vSHkyOVw1pBNhk9Hujb0ubtSk3nBwQOV +vm2WxVj6dQQUxwA5QDf1fAugicp7pbeKM+IYKPa/fycKk1tZzy36vS2EpxtIs5NO +keiMMHerTURT7f0K8KRoD/kfsfAlnJg2UyqQAFklSDrm4wac/OTe6BimHXUnvvaC +7gJjGY+U1+byd1heIuBUWbyEaYwmPcLm4TzBC6N6k0fIaD0qfu05IB2OABKGlM7Y +n+Nc6H6JEcpNoiy7aH4Xrdruoct/fTE/PrT6XjPwbp11vt6CTOB/V9eDQkXvzoT5 +b5lcjSAYhCjgE3jCzmdKmgbZw/M4UVfEayS+9dPJlkt/XTwZOuX6MNIdt4qHVK4T +UVFafAgbfZ5+VMr962vPvPslc5K2Pt07PhjBSDFx6vlvqUMSoDpXAMMYVKTbl31L +0z29d+MRbF884gvff8BnJdAV6SmE/jGHWRxOdvzeaiw2qT3U76sITGwjvDmrEYHy +nSwsiCCGD6G8qdFheiGaREv+vPoJPfGIzmv+GhQl+y5CEMFs6aQZ0m75C3tOxupX +A1Q29VzdsZDAxTDWbVxAIjnf8mNfSsoNx5uzGsa7FH8f9D1N0LF9/UfFRHwMXzNz +3KJn8U2uFh8nZWbUVqDU +=zVvU -----END PGP SIGNATURE----- diff --git a/sys-apps/shadow/files/shadow-4.1.5-grremove.patch b/sys-apps/shadow/files/shadow-4.1.5-grremove.patch new file mode 100644 index 000000000000..96062ae15d2b --- /dev/null +++ b/sys-apps/shadow/files/shadow-4.1.5-grremove.patch @@ -0,0 +1,49 @@ +https://bugs.gentoo.org/405409 + +http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2012-February/009159.html +http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2012-March/009196.html + +--- shadow-4.1.5/src/userdel.c ++++ shadow-4.1.5/src/userdel.c +@@ -333,22 +333,22 @@ static void remove_usergroup (void) + * We can remove this group, it is not the primary + * group of any remaining user. + */ +- if (gr_remove (grp->gr_name) == 0) { ++ if (gr_remove (user_name) == 0) { + fprintf (stderr, + _("%s: cannot remove entry '%s' from %s\n"), +- Prog, grp->gr_name, gr_dbname ()); ++ Prog, user_name, gr_dbname ()); + fail_exit (E_GRP_UPDATE); + } + + #ifdef WITH_AUDIT + audit_logger (AUDIT_DEL_GROUP, Prog, + "deleting group", +- grp->gr_name, AUDIT_NO_ID, ++ user_name, AUDIT_NO_ID, + SHADOW_AUDIT_SUCCESS); + #endif /* WITH_AUDIT */ + SYSLOG ((LOG_INFO, + "removed group '%s' owned by '%s'\n", +- grp->gr_name, user_name)); ++ user_name, user_name)); + + #ifdef SHADOWGRP + if (sgr_locate (user_name) != NULL) { +@@ -361,12 +361,12 @@ static void remove_usergroup (void) + #ifdef WITH_AUDIT + audit_logger (AUDIT_DEL_GROUP, Prog, + "deleting shadow group", +- grp->gr_name, AUDIT_NO_ID, ++ user_name, AUDIT_NO_ID, + SHADOW_AUDIT_SUCCESS); + #endif /* WITH_AUDIT */ + SYSLOG ((LOG_INFO, + "removed shadow group '%s' owned by '%s'\n", +- grp->gr_name, user_name)); ++ user_name, user_name)); + + } + #endif /* SHADOWGRP */ diff --git a/sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch b/sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch new file mode 100644 index 000000000000..5a95c0f87764 --- /dev/null +++ b/sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch @@ -0,0 +1,32 @@ +http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2012-March/009205.html + +https://bugs.gentoo.org/406819 + +--- shadow-4.1.5/lib/commonio.c ++++ shadow-4.1.5/lib/commonio.c +@@ -977,6 +977,12 @@ int commonio_close (struct commonio_db * + + snprintf (buf, sizeof buf, "%s+", db->filename); + ++#ifdef WITH_SELINUX ++ if (set_selinux_file_context (buf) != 0) { ++ errors++; ++ } ++#endif ++ + db->fp = fopen_set_perms (buf, "w", &sb); + if (NULL == db->fp) { + goto fail; +@@ -1011,6 +1017,12 @@ int commonio_close (struct commonio_db * + goto fail; + } + ++#ifdef WITH_SELINUX ++ if (reset_selinux_file_context () != 0) { ++ goto fail; ++ } ++#endif ++ + nscd_need_reload = true; + goto success; + fail: diff --git a/sys-apps/shadow/shadow-4.1.5-r2.ebuild b/sys-apps/shadow/shadow-4.1.5-r2.ebuild new file mode 100644 index 000000000000..9441eb9e35a2 --- /dev/null +++ b/sys-apps/shadow/shadow-4.1.5-r2.ebuild @@ -0,0 +1,203 @@ +# 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-r2.ebuild,v 1.1 2012/04/21 17:20:11 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 + sys-libs/libsemanage + ) + nls? ( virtual/libintl ) + tcb? ( sys-auth/tcb ) + xattr? ( sys-apps/attr )" +DEPEND="${RDEPEND} + nls? ( sys-devel/gettext )" +RDEPEND="${RDEPEND} + pam? ( >=sys-auth/pambase-20120417 )" + +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 + epatch "${FILESDIR}"/${PN}-4.1.5-grremove.patch #405409 + epatch "${FILESDIR}"/${PN}-4.1.5-selinux-groupadd.patch #406819 + 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 ttySAC2 ttySAC3 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/shadow || die + + for x in 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 {} + + + # Remove pam.d files provided by pambase. + rm "${D}"/etc/pam.d/{login,passwd,su} || die + 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. + if [ ! -f "${ROOT}"/etc/gshadow ] ; then + if grpck -r -R "${ROOT}" 2>/dev/null ; then + grpconv -R "${ROOT}" + 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." +} |