# 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.121 2005/08/24 11:33:18 azarah Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/ChangeLog,v 1.122 2005/10/10 22:42:44 vapier Exp $
+
+*shadow-4.0.13 (10 Oct 2005)
+
+ 10 Oct 2005; Mike Frysinger <vapier@gentoo.org>
+ +files/shadow-4.0.13-dots-in-usernames.patch,
+ +files/shadow-4.0.13-login.defs.patch,
+ +files/shadow-4.0.13-long-groupnames.patch,
+ +files/shadow-4.0.13-nonis.patch,
+ +files/shadow-4.0.13-su-fix-environment.patch, +shadow-4.0.13.ebuild:
+ Version bump.
24 Aug 2005; Martin Schlemmer <azarah@gentoo.org>
+files/shadow-4.0.12-gcc2.patch, shadow-4.0.12.ebuild:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-MD5 41c23ed0904ed9071c85d13aa76d0a42 shadow-4.0.7-r1.ebuild 6582
-MD5 69b75fc8b3df89e5da434f35f6db5e31 shadow-4.0.5-r3.ebuild 5616
-MD5 02b151abd6ca7f518c23e6890f201e43 shadow-4.0.7-r4.ebuild 7174
-MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
-MD5 0528fcbf64cb6383f23308d400e3d58a shadow-4.0.12.ebuild 7110
-MD5 588bb10a6f777e71c67c552906d186a7 shadow-4.0.7-r3.ebuild 7053
-MD5 314bf4f7ce691287c74208fe9719f146 shadow-4.0.7.ebuild 5582
-MD5 a0d8e3f6fb0895bc2cc023898a48e81c shadow-4.0.6-r1.ebuild 5621
-MD5 75f60cacddf580b22250ec244749116c shadow-4.0.11.1-r2.ebuild 7215
-MD5 bbedc15fb467b91796456cd032199535 shadow-4.0.5-r2.ebuild 5443
-MD5 7845499ca5337b409e9888dad2bbb4f8 ChangeLog 22632
-MD5 dd33182f75e512eacdf6652e505359eb shadow-4.0.4.1-r4.ebuild 5963
-MD5 30c0eb4f3ffb1e531659cf9b69cffa14 shadow-4.0.11.1-r1.ebuild 7084
-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 b52179dd78e6b6d207600184022114db files/shadow-4.0.12-dots-in-usernames.patch 1466
-MD5 020e030c2d09b206e88cf9051ced6244 files/shadow-4.0.4.1-nonis.patch 1504
-MD5 aaf16ddabef285df169e37254b13561c files/shadow-4.0.4.1-selinux.diff 4296
-MD5 c5e9081ed43837797e2f1617b7ce1c24 files/shadow-4.0.5-fix-adding-of-pam_env-set-env-vars.patch 285
-MD5 450a2289f2a383296ad9af005e46da74 files/shadow-4.0.11.1-ngettext.patch 1038
-MD5 7becc41b4f7264483ee3ff0ca8277084 files/shadow-4.0.4.1-passwd-typo.patch 438
-MD5 f9846ea2aeefba54443ef5d6796f0bbc files/shadow-4.0.10-nls-manpages.patch 367
-MD5 b8efca60a25e256eebe54c3d0db0760f files/shadow-4.0.4.1-gcc34-xmalloc.patch 361
+MD5 bfd8f50ac41f57089f41a37427f15b33 ChangeLog 22972
+MD5 6e0bc0211949c624da0ea08d994a7038 files/default/useradd 96
+MD5 9375147f78a25196b654616c969af9a5 files/digest-shadow-4.0.11.1-r1 69
+MD5 9375147f78a25196b654616c969af9a5 files/digest-shadow-4.0.11.1-r2 69
MD5 cec3e64e953a7f3f96a1e89d73b62899 files/digest-shadow-4.0.12 67
-MD5 90e2ab53494f677dc23b5137d6e39110 files/shadow-4.0.6-fix-configure.patch 3047
-MD5 13cddd2e24cbcaf5164e13f9105c222c files/shadow-4.0.7-perms.patch 1768
-MD5 46c2be2ed8b26ec007e3ed1f476491d8 files/digest-shadow-4.0.7-r1 66
-MD5 44f064b586ea49c8e2dc1fca8b9e4599 files/shadow-4.0.11.1-SUPATH.patch 1614
-MD5 fdb23bff28b70bd53f200379c33dd27c files/shadow-4.0.10-nonis.patch 1434
+MD5 2832ae3af9a1f70243c65802597ae825 files/digest-shadow-4.0.13 67
MD5 cef6788bc7c8c5468c1b1f68df77ed9e files/digest-shadow-4.0.4.1-r4 67
-MD5 a99f871c88548d503bad935d2aa6f412 files/shadow-4.0.4.1-nls-manpages.patch 355
-MD5 f4ae7cde924d5d91ce4010760439b836 files/shadow-4.0.11.1-su-fix-environment.patch 966
-MD5 46c2be2ed8b26ec007e3ed1f476491d8 files/digest-shadow-4.0.7-r4 66
-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 c87c0968ace90b32753b91f93ad7bab1 files/shadow-4.0.11.1-uclibc-missing-l64a.patch 1269
MD5 d8b8542a7bc013011a293732ca504a50 files/digest-shadow-4.0.5-r2 66
-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 636f233fa173a998195016c3808173d4 files/shadow-4.0.5-skey.patch 395
MD5 d8b8542a7bc013011a293732ca504a50 files/digest-shadow-4.0.5-r3 66
-MD5 391991f50203bd8b7738474051befdee files/shadow-4.0.5-remove-else.patch 531
-MD5 ae5d078bc6b651b5f081dcfc64b5df69 files/shadow-4.0.11.1-perms.patch 1659
-MD5 c31db5c71b0cdfca75346abc2887aa02 files/shadow-4.0.5-nls-manpages.patch 362
-MD5 6355d65b618395c4adf46f733269546c files/shadow-4.0.10-dots-in-usernames.patch 1894
-MD5 804242385ef14139f4b46167396f26f8 files/shadow-4.0.12-long-groupnames.patch 923
-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 9375147f78a25196b654616c969af9a5 files/digest-shadow-4.0.11.1-r2 69
-MD5 9375147f78a25196b654616c969af9a5 files/digest-shadow-4.0.11.1-r1 69
-MD5 46c2be2ed8b26ec007e3ed1f476491d8 files/digest-shadow-4.0.7-r3 66
+MD5 e9ac6a566b65499773437ce98911a046 files/digest-shadow-4.0.6-r1 66
MD5 46c2be2ed8b26ec007e3ed1f476491d8 files/digest-shadow-4.0.7 66
-MD5 e1c86a7766f97cff8d5196821b6b1913 files/shadow-4.0.12-gcc2.patch 962
-MD5 6e0bc0211949c624da0ea08d994a7038 files/default/useradd 96
+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 4b7d75b12f1bea9f349dff4c48c18b8b files/pam.d-include/login 245
+MD5 5bff4f2134b72dabc4afa5bb296e874d files/pam.d-include/other 142
+MD5 5df27e06de913de76e24790642eecfd2 files/pam.d-include/passwd 104
+MD5 50d7c96eab701fd6ddbf4b283e493b4c files/pam.d-include/shadow 152
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 33d9efd092b6999143ea42c99a59bfb1 files/pam.d-include/system-auth-1.1 365
MD5 987d0bd2e5dd1f96dc28ae2963054022 files/pam.d/login 333
-MD5 a1fc81dbd0d41face776fba4ca929d8f files/pam.d/su 1142
-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 8a59937d720a19824db6e4a8cd173a4b files/pam.d/passwd 172
MD5 a5721c39446539b751dceae4b054542b files/pam.d/shadow 171
+MD5 a1fc81dbd0d41face776fba4ca929d8f files/pam.d/su 1142
+MD5 deed69f8fa52ca844f3669414bd5cf01 files/pam.d/system-auth 373
+MD5 33d9efd092b6999143ea42c99a59bfb1 files/pam.d/system-auth-1.1 365
+MD5 a744152ec905f4c06f3b92142b7fec8a files/securetty 253
+MD5 6355d65b618395c4adf46f733269546c files/shadow-4.0.10-dots-in-usernames.patch 1894
+MD5 95f7b8980169e81352229bd548909ea7 files/shadow-4.0.10-fix-configure.patch 579
+MD5 aaedecd7edcccff66f962fd82928eec9 files/shadow-4.0.10-long-groupnames.patch 1205
+MD5 f9846ea2aeefba54443ef5d6796f0bbc files/shadow-4.0.10-nls-manpages.patch 367
+MD5 fdb23bff28b70bd53f200379c33dd27c files/shadow-4.0.10-nonis.patch 1434
+MD5 44f064b586ea49c8e2dc1fca8b9e4599 files/shadow-4.0.11.1-SUPATH.patch 1614
+MD5 450a2289f2a383296ad9af005e46da74 files/shadow-4.0.11.1-ngettext.patch 1038
+MD5 ae5d078bc6b651b5f081dcfc64b5df69 files/shadow-4.0.11.1-perms.patch 1659
+MD5 f4ae7cde924d5d91ce4010760439b836 files/shadow-4.0.11.1-su-fix-environment.patch 966
+MD5 c87c0968ace90b32753b91f93ad7bab1 files/shadow-4.0.11.1-uclibc-missing-l64a.patch 1269
+MD5 b52179dd78e6b6d207600184022114db files/shadow-4.0.12-dots-in-usernames.patch 1466
+MD5 e1c86a7766f97cff8d5196821b6b1913 files/shadow-4.0.12-gcc2.patch 962
+MD5 804242385ef14139f4b46167396f26f8 files/shadow-4.0.12-long-groupnames.patch 923
+MD5 fc7dcebbbe2fae05629e848bc886f454 files/shadow-4.0.13-dots-in-usernames.patch 917
+MD5 08f11e5b0c4a987e49367f245f475728 files/shadow-4.0.13-login.defs.patch 672
+MD5 acdc5a5ac62bfd3495bde25438b49734 files/shadow-4.0.13-long-groupnames.patch 398
+MD5 dfa169094cacf64d4980b0c8d76374d8 files/shadow-4.0.13-nonis.patch 1795
+MD5 223a6d64e1635462fcca48217644cfd0 files/shadow-4.0.13-su-fix-environment.patch 1070
+MD5 b8efca60a25e256eebe54c3d0db0760f files/shadow-4.0.4.1-gcc34-xmalloc.patch 361
+MD5 a99f871c88548d503bad935d2aa6f412 files/shadow-4.0.4.1-nls-manpages.patch 355
+MD5 020e030c2d09b206e88cf9051ced6244 files/shadow-4.0.4.1-nonis.patch 1504
+MD5 7becc41b4f7264483ee3ff0ca8277084 files/shadow-4.0.4.1-passwd-typo.patch 438
+MD5 aaf16ddabef285df169e37254b13561c files/shadow-4.0.4.1-selinux.diff 4296
+MD5 201f1321262da41ccd1a0283216ae9a7 files/shadow-4.0.4.1-su-pam_open_session.patch 4886
+MD5 bb55107c3a9354ef2d1977547fdb5a83 files/shadow-4.0.4.1-useradd-manpage-update.patch 958
+MD5 058f760e522ab65e270293003805fe61 files/shadow-4.0.4.1-userdel-missing-brackets.patch 380
+MD5 c5e9081ed43837797e2f1617b7ce1c24 files/shadow-4.0.5-fix-adding-of-pam_env-set-env-vars.patch 285
+MD5 fda41657b856ffaeec5a2734b312409b files/shadow-4.0.5-fix-mail-configure.patch 5452
+MD5 20fd2dc35b8671b91e120b90281b4cf3 files/shadow-4.0.5-hack-X-envvars.patch 521
+MD5 d14e133da535d64d1b397784e17c213a files/shadow-4.0.5-login.defs.patch 766
+MD5 c31db5c71b0cdfca75346abc2887aa02 files/shadow-4.0.5-nls-manpages.patch 362
+MD5 391991f50203bd8b7738474051befdee files/shadow-4.0.5-remove-else.patch 531
+MD5 636f233fa173a998195016c3808173d4 files/shadow-4.0.5-skey.patch 395
+MD5 b4d0fc0f54800978591791493d6b2ec3 files/shadow-4.0.6-dots-in-usernames.patch 1993
+MD5 90e2ab53494f677dc23b5137d6e39110 files/shadow-4.0.6-fix-configure.patch 3047
+MD5 8bf11ce0e8ee683fe290462473871dab files/shadow-4.0.6-long-groupnames.patch 1625
+MD5 d15398f7d8c06b906abdf73ae3a55f54 files/shadow-4.0.6-manpages.patch 564
+MD5 d06833980d79d4f001b6064a3f52f938 files/shadow-4.0.7-iswheel.patch 416
+MD5 a63ee37286c486567191c7c6b24432e2 files/shadow-4.0.7-lastlog.patch 455
+MD5 70b7c7f1725841e335e5f2361fc9ebab files/shadow-4.0.7-nscd-EPIPE-failure.patch 947
+MD5 e32464f2df5a85f4f6c67bc78e9a23d1 files/shadow-4.0.7-nscd-socket-path.patch 1081
+MD5 13cddd2e24cbcaf5164e13f9105c222c files/shadow-4.0.7-perms.patch 1768
+MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
+MD5 30c0eb4f3ffb1e531659cf9b69cffa14 shadow-4.0.11.1-r1.ebuild 7084
+MD5 75f60cacddf580b22250ec244749116c shadow-4.0.11.1-r2.ebuild 7215
+MD5 0528fcbf64cb6383f23308d400e3d58a shadow-4.0.12.ebuild 7110
+MD5 a7afb0ae64b5fc3037aa92b1eacdf60e shadow-4.0.13.ebuild 7121
+MD5 dd33182f75e512eacdf6652e505359eb shadow-4.0.4.1-r4.ebuild 5963
+MD5 bbedc15fb467b91796456cd032199535 shadow-4.0.5-r2.ebuild 5443
+MD5 69b75fc8b3df89e5da434f35f6db5e31 shadow-4.0.5-r3.ebuild 5616
+MD5 a0d8e3f6fb0895bc2cc023898a48e81c shadow-4.0.6-r1.ebuild 5621
+MD5 41c23ed0904ed9071c85d13aa76d0a42 shadow-4.0.7-r1.ebuild 6582
+MD5 588bb10a6f777e71c67c552906d186a7 shadow-4.0.7-r3.ebuild 7053
+MD5 02b151abd6ca7f518c23e6890f201e43 shadow-4.0.7-r4.ebuild 7174
+MD5 314bf4f7ce691287c74208fe9719f146 shadow-4.0.7.ebuild 5582
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
-iD8DBQFDQxPjgIKl8Uu19MoRAo63AKCAnIoHY+c4Uppp3DeuqNeoBd1uHgCffy8n
-FC1ykenLBgVwldkBYopXePk=
-=j8BS
+iD8DBQFDSu7UgIKl8Uu19MoRAmGjAJ9MrPFnwqNUVpIJ73lg7WH9PVzYAACfQst7
+OlR/g2W9QI8xveGKA2gdWP8=
+=ttqZ
-----END PGP SIGNATURE-----
--- /dev/null
+MD5 5c6a105d89afb0900922260e9c5650cc shadow-4.0.13.tar.bz2 1087998
--- /dev/null
+Allow people to add users with dots in their names.
+
+http://bugs.gentoo.org/22920
+
+Index: libmisc/chkname.c
+===================================================================
+RCS file: /cvsroot/shadow/libmisc/chkname.c,v
+retrieving revision 1.11
+diff -u -p -r1.11 chkname.c
+--- libmisc/chkname.c 31 Aug 2005 17:24:57 -0000 1.11
++++ libmisc/chkname.c 10 Oct 2005 22:20:16 -0000
+@@ -18,7 +18,7 @@
+ static int good_name (const char *name)
+ {
+ /*
+- * User/group names must match [a-z_][a-z0-9_-]*[$]
++ * User/group names must match [a-z_][a-z0-9_-.]*[$]
+ */
+ if (!*name || !((*name >= 'a' && *name <= 'z') || *name == '_'))
+ return 0;
+@@ -27,6 +27,7 @@ static int good_name (const char *name)
+ if (!((*name >= 'a' && *name <= 'z') ||
+ (*name >= '0' && *name <= '9') ||
+ *name == '_' || *name == '-' ||
++ *name == '.' ||
+ (*name == '$' && *(name + 1) == '\0')))
+ return 0;
+ }
--- /dev/null
+Index: etc/login.defs
+===================================================================
+RCS file: /cvsroot/shadow/etc/login.defs,v
+retrieving revision 1.8
+diff -u -p -U0 -r1.8 login.defs
+--- etc/login.defs 1 Sep 2005 19:57:45 -0000 1.8
++++ etc/login.defs 10 Oct 2005 22:17:39 -0000
+@@ -38 +38 @@
+-MAIL_CHECK_ENAB yes
++MAIL_CHECK_ENAB no
+@@ -205 +205 @@
+-SU_WHEEL_ONLY no
++SU_WHEEL_ONLY yes
+@@ -210 +210 @@
+-CRACKLIB_DICTPATH /var/cache/cracklib/cracklib_dict
++CRACKLIB_DICTPATH /usr/lib/cracklib_dict
+@@ -227 +227 @@
+-LOGIN_RETRIES 5
++LOGIN_RETRIES 3
+@@ -279 +279 @@
+-#MD5_CRYPT_ENAB no
++MD5_CRYPT_ENAB yes
+@@ -330 +330 @@
+-#GETPASS_ASTERISKS 1
++GETPASS_ASTERISKS 0
--- /dev/null
+Remove arbitrary requirement on the length of groups. Perhaps we
+should turn this into a configure option and send upstream ?
+
+http://bugs.gentoo.org/3485
+
+--- libmisc/chkname.c
++++ libmisc/chkname.c
+@@ -59,8 +60,10 @@
+ * Arbitrary limit for group names - max 16
+ * characters (same as on HP-UX 10).
+ */
++#if 0
+ if (strlen (name) > 16)
+ return 0;
++#endif
+
+ return good_name (name);
+ }
--- /dev/null
+--- src/login_nopam.c
++++ src/login_nopam.c
+@@ -50,7 +50,9 @@
+ #include <netinet/in.h>
+ #include <arpa/inet.h> /* for inet_ntoa() */
+ extern struct group *getgrnam ();
++#ifdef USE_NIS
+ extern int innetgr ();
++#endif
+
+ #if !defined(MAXHOSTNAMELEN) || (MAXHOSTNAMELEN < 64)
+ #undef MAXHOSTNAMELEN
+@@ -178,6 +180,7 @@ static char *myhostname (void)
+ return (name);
+ }
+
++#ifdef USE_NIS
+ /* netgroup_match - match group against machine or user */
+ static int
+ netgroup_match (const char *group, const char *machine, const char *user)
+@@ -193,6 +196,7 @@ netgroup_match (const char *group, const
+
+ return innetgr (group, machine, user, mydomain);
+ }
++#endif
+
+ /* user_match - match a username against one token */
+ static int user_match (const char *tok, const char *string)
+@@ -214,8 +218,10 @@ static int user_match (const char *tok,
+ *at = 0;
+ return (user_match (tok, string)
+ && from_match (at + 1, myhostname ()));
++#ifdef USE_NIS
+ } else if (tok[0] == '@') { /* netgroup */
+ return (netgroup_match (tok + 1, (char *) 0, string));
++#endif
+ } else if (string_match (tok, string)) { /* ALL or exact match */
+ return (YES);
+ } else if ((group = getgrnam (tok))) { /* try group membership */
+@@ -271,9 +277,12 @@ static int from_match (const char *tok,
+ * contain a "." character. If the token is a network number, return YES
+ * if it matches the head of the string.
+ */
++#ifdef USE_NIS
+ if (tok[0] == '@') { /* netgroup */
+ return (netgroup_match (tok + 1, string, (char *) 0));
+- } else if (string_match (tok, string)) { /* ALL or exact match */
++ } else
++#endif
++ if (string_match (tok, string)) { /* ALL or exact match */
+ return (YES);
+ } else if (tok[0] == '.') { /* domain: match last fields */
+ if ((str_len = strlen (string)) > (tok_len = strlen (tok))
--- /dev/null
+The patch from upstream (shadow-4.0.11.1-SUPATH.patch) sets environ too
+early when using PAM, so move it to !USE_PAM. Also set USER and SHELL.
+
+--- shadow-4.0.11.1/src/su.c 2005-08-04 12:34:35.000000000 +0200
++++ shadow-4.0.11.1.az/src/su.c 2005-08-04 12:38:57.000000000 +0200
+@@ -594,11 +594,6 @@
+ addenv ("PATH", cp);
+ }
+
+-#ifndef USE_PAM
+- /* setup the environment for PAM later on, else we run into auth problems */
+- environ = newenvp; /* make new environment active */
+-#endif
+-
+ if (getenv ("IFS")) /* don't export user IFS ... */
+ addenv ("IFS= \t\n", NULL); /* ... instead, set a safe IFS */
+
+@@ -666,6 +664,8 @@
+ exit (1);
+ }
+ #else /* !USE_PAM */
++ environ = newenvp; /* make new environment active */
++
+ if (!amroot) /* no limits if su from root */
+ setup_limits (&pwent);
+
+@@ -676,8 +676,11 @@
+ if (fakelogin)
+ setup_env (&pwent);
+ #if 1 /* Suggested by Joey Hess. XXX - is this right? */
+- else
++ else {
+ addenv ("HOME", pwent.pw_dir);
++ addenv ("USER", pwent.pw_name);
++ addenv ("SHELL", pwent.pw_shell);
++ }
+ #endif
+
+ /*
--- /dev/null
+# 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.13.ebuild,v 1.1 2005/10/10 22:42:44 vapier Exp $
+
+inherit eutils libtool toolchain-funcs flag-o-matic
+
+# 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/${PN}/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="-*" #~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="nls pam selinux 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-4.0.11.1-r2 )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # uclibc support, corrects NIS usage
+ epatch "${FILESDIR}"/${PN}-4.0.13-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}"/${PN}-4.0.10-nls-manpages.patch
+
+ # tweak the default login.defs
+ epatch "${FILESDIR}"/${PN}-4.0.13-login.defs.patch
+
+ # The new configure changes do not detect utmp/logdir properly
+ epatch "${FILESDIR}"/${PN}-4.0.10-fix-configure.patch
+
+ # skeychallenge call needs updating #69741
+ epatch "${FILESDIR}"/shadow-4.0.5-skey.patch
+
+ # Make user/group names more flexible #3485 / #22920
+ epatch "${FILESDIR}"/${PN}-4.0.13-dots-in-usernames.patch
+ epatch "${FILESDIR}"/${PN}-4.0.13-long-groupnames.patch
+
+ # Fix compiling with gcc-2.95.x
+ epatch "${FILESDIR}"/${PN}-4.0.12-gcc2.patch
+
+ # Patch from upstream enables the new environment too early for PAM
+ epatch "${FILESDIR}"/${PN}-4.0.13-su-fix-environment.patch
+
+ # Some UCLIBC patches
+ epatch "${FILESDIR}"/${PN}-4.0.11.1-uclibc-missing-l64a.patch
+
+ # lock down setuid perms #47208
+ epatch "${FILESDIR}"/${PN}-4.0.11.1-perms.patch
+
+ # Needed by the UCLIBC patches
+ autoconf || die
+
+ elibtoolize
+ epunt_cxx
+}
+
+src_compile() {
+ append-ldflags -Wl,-z,now
+ tc-is-cross-compiler && 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} suiduperms=${perms} install || die "install problem"
+ dosym useradd /usr/sbin/adduser
+
+ # 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/man1/login.1* \
+ "${D}"/usr/share/man/man5/login.{access,defs}.5* \
+ "${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
+ use pam || { insopts -m0600 ; doins etc/login.access ; }
+ use pam || { insopts -m0600 ; 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 'limits.5*' -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_preinst() {
+ rm -f "${ROOT}"/etc/pam.d/system-auth.new
+}
+
+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 -pPR ${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
+}