commit:     08d34c586be332d147752c94ada4268eb03a6e36
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  9 04:51:09 2014 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Tue Dec  9 04:51:09 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=dev/heroxbd.git;a=commit;h=08d34c58

sys-apps/shadow: further prefixify

---
 sys-apps/shadow/Manifest                           |   5 +-
 .../shadow/files/shadow-4.2.1-sysconfdir-2.patch   | 548 +++++++++++++++++++++
 .../shadow/files/shadow-4.2.1-sysconfdir.patch     |  14 +-
 sys-apps/shadow/shadow-4.2.1.ebuild                |   1 +
 4 files changed, 561 insertions(+), 7 deletions(-)

diff --git a/sys-apps/shadow/Manifest b/sys-apps/shadow/Manifest
index a83cae3..75577a4 100644
--- a/sys-apps/shadow/Manifest
+++ b/sys-apps/shadow/Manifest
@@ -19,8 +19,9 @@ AUX shadow-4.1.5-nscd-newline-msg.patch 1332 SHA256 
37142316d0c06584801d65e90279
 AUX shadow-4.1.5-selinux-groupadd.patch 703 SHA256 
62cce19aa1c702bc099948e694166f19d057849a6fdde99ffea52a4e3e2dab99 SHA512 
a9c258b3b316abe57e85c556edcd37a1cea18f9125273ca7c79c136fb256f6847d0d4c5a78155882900ce280c83aac6ba1f428c9b3aaa020d7cf35a13409ffb0
 WHIRLPOOL 
1c301b32f6bb5927fac5626a724446ac1a865234dda5021dbdb908607b2887a534c2499246ef355888b5d0c6fcf8111faa2fa5bb6c5b33eebb3132c916e6120a
 AUX shadow-4.1.5-stdarg.patch 1137 SHA256 
9280f8337651dc25f22f52acd8f4467b592d1f664bd35ce1f2f431335b1aef5b SHA512 
aeda218afa859c9b121f54500be4bdf3676386448c04cffda3ec4aefc4b7fdd8b7e2b5e24545dad2d64fc7748cc68bdce337931d7313d608df0b153330f9912a
 WHIRLPOOL 
42dd1686196f503950905d40728f8e74a75b64014e39cb5d3ed8aa379718a7c00893a1ef8834e8aa887807a4a08556464e0d2b65b79e2e7a0512d89e79e358db
 AUX shadow-4.1.5.1-prefix.patch 44162 SHA256 
034dd070a99bfac108fe270b061b95111c0cda09471235493689de8c104daf7f SHA512 
a3839fb18d47d26465d1fd419de2a5e6da4cb3386e41870a6be82b738d2a3b4831e3abaf8e6700c72020a02307493acc6c26fb75f0f33aedf330ca4dfd884f6d
 WHIRLPOOL 
a5847f33ce06f6bdef16d80331f9c45a8dd65cc800a0c888c0f5c31189cd3e43d23dc24dff1a57858ce16ecbc02c1804b5f5387466edb21ee1aa70e86d962240
-AUX shadow-4.2.1-sysconfdir.patch 20555 SHA256 
3a43dd9693be0450fa095c4e8a6580a40fa74376b6a1eff392af0ec37016ae2e SHA512 
4b9c9679ca750ee7596c290a7d7bb530670c66f1cd9f5712ccbceb8d0d6ae7f74ca884e57967b098c0ee384ec4ff3f61bd37a3170da5249a7817edc40b555a32
 WHIRLPOOL 
0f8e706742fad8990f2a9cb891319ddd1bb136310e16391f11bb503e310ad049f7d9ac69914e12b95f4d647379871f79f995a2cffd38b15a6a85cb53728247ed
+AUX shadow-4.2.1-sysconfdir-2.patch 20781 SHA256 
ac408f10cf2c959c3e138894e571224700c2708b9bec55e9eb244d4059aba3ab SHA512 
60a9c25c094bd4375ddf3e26d2d3a5c77a2a2cd21a8169aa29f607fef6289d969f718de4086ad7152e172615012780a1616ef4e31964140954dd7af0f15f4388
 WHIRLPOOL 
f42058b05524e58ef1654d52ad2074b41c1c4ae93aab81dd4f6c828503a600c86994e36d2c53db3d7efb64efae57703b264a2097c8647ad565a817fdfd27dc5c
+AUX shadow-4.2.1-sysconfdir.patch 20667 SHA256 
05e7173fbfa50b3da5ee718e7203d10b60fbe4cd1a1b256252001e011b0e0c8d SHA512 
33402e118e6866b9301c34e10b85684e4f43c9a267b401fd8975d50c776bafae8da2bdc23ee87b88d4504924d0c5672e7f2c04d82dfae040994e05270a943145
 WHIRLPOOL 
8d06a268d354759d2ae714a8c041af263f0bc4f08ca99d30776fc9661d4ae916cacc9917ff300213d0b09fa9e29ef4b5811ac910cdc0c334bee0a83dfdb38ead
 DIST shadow-4.2.1.tar.xz 1594536 SHA256 
3b0893d1476766868cd88920f4f1231c4795652aa407569faff802bcda0f3d41 SHA512 
7a14bf8e08126f0402e37b6e4c559615ced7cf829e39156d929ed05cd8813de48a77ff1f7f6fe707da04cf662a2e9e84c22d63d88dd1ed13f935fde594db95f0
 WHIRLPOOL 
032857f5fae8486cc3dd11303bfa7da55019000ce8ad7bac2f398f9f9764c8659e20a1547d05c5e4f366db749a52afb3083017faf14f6a72ee48345dcd1f86aa
-EBUILD shadow-4.2.1.ebuild 5296 SHA256 
d6ffc91cf82672c7c022e99ee1cf48fd9f4a3201864a62c1d02a41a2321e8bfa SHA512 
0ea8b27525e0e52414a9a43ea87b1882318f7ee55bf989271a4d848820556a2be08058437d5c2634fb333d5e2e09ac9256c987bfec7a7b85919e3ec21362364a
 WHIRLPOOL 
89e576aa1ba1f348d0f260a92545cf6b2a2eb953c5ddcfe41f96237a8905059e65869c45df5f5254abcd84697d7819e25337d64d84fabe2670283647951b38e5
+EBUILD shadow-4.2.1.ebuild 5349 SHA256 
82a0eb82137bbd1b3316f8b9543b6a7a607d26bb5cf6571f7021bf58e79e6778 SHA512 
7907c8160984ba9eeb7d269eba35c96ddfd1129c35335a43faf688239acec3aebe32f4a13d5f5634ec357dcce794f798210aaabd29fabaea8ea8f15d05cf23a7
 WHIRLPOOL 
84bb21edbaf62e026de129feae0e81349d7a5a410ac2262b43b4802e6de8def27ebef5f53bc3db846b6f296997200d161f54968d4c98e56f636430590c8aacb4
 MISC ChangeLog 50196 SHA256 
6281ee581649f1d02e7d07e29b031ec7c8645fd7a866fe006b93b2e8ae7d5a65 SHA512 
87cfb456e7d894fdca943ba2f9c9129e1ef64a5fa6610bcbafe4fc80580705707c9c3aa1f9491c630661e6492ef95feca5e4876318e4b3c6b6189ab21c880a00
 WHIRLPOOL 
ea680f0da93cd3cf44c0a181fc284b4c4534c8d39ccb48f769dd84724e26fe5618e95748d40768fb1d5ddac3a4297959eb228ecbc57ac6c03761f8b37039ec7a
 MISC metadata.xml 374 SHA256 
1675a5791603e79e431df63215162737553fa8018360b026739ac3284bca54b2 SHA512 
0bb65b45fa94ddea89f7e0a879fd996b3f363b3e58eb6cbd71251fd79416667f103af4bac0c87f3ba240e0ce3f323c77ce7be9f6ea92c13d619ff8cef8797add
 WHIRLPOOL 
e7f4f5d975440fe71dbb35dee4394aa808fce7b5e58ac64d162418a47ed99cb002c7622563be4f6800967d6b8530d29dbd895e431c78f75a5cdf490b8c1afc45

diff --git a/sys-apps/shadow/files/shadow-4.2.1-sysconfdir-2.patch 
b/sys-apps/shadow/files/shadow-4.2.1-sysconfdir-2.patch
new file mode 100644
index 0000000..6083138
--- /dev/null
+++ b/sys-apps/shadow/files/shadow-4.2.1-sysconfdir-2.patch
@@ -0,0 +1,548 @@
+From ea2788255a4ebc4e72d988b840ae0f59ada27ca1 Mon Sep 17 00:00:00 2001
+From: Benda Xu <hero...@gentoo.org>
+Date: Tue, 9 Dec 2014 13:34:51 +0900
+Subject: [PATCH 2/2] Manage and override pathes in headers.
+
+        * lib/getdef.c: move LOGINDEFS into lib/getdef.h
+        * lib/getdef.h: rename to .in
+        * configure.in: generate lib/getdef.h lib/port.h
+        * lib/gshadow_.h: move GSHADOW into lib/defines.h
+        * lib/port.h: override /etc with @sysconfdir@
+        rename to .in
+        * src/chsh.c: move SHELLS_FILE into lib/defines.h
+        * src/login_nopam.c: move TABLE into lib/defines.h
+       and rename to ACCESS_TABLE
+        * src/logoutd.c: move HUP_MESG_FILE into lib/defines.h
+        * src/suauth.c: move SUAUTHFILE into lib/defines.h
+        * src/useradd.c: move SKEL_DIR, USER_DEFAULTS_FILE,
+        LASTLOG_FILE into defines.h
+---
+ configure.in                  |  2 ++
+ lib/defines.h.in              | 31 +++++++++++++++++++++++++++++++
+ lib/getdef.c                  |  4 ----
+ lib/{getdef.h => getdef.h.in} |  4 ++++
+ lib/gshadow_.h                |  2 +-
+ lib/{port.h => port.h.in}     |  2 +-
+ src/chsh.c                    |  3 ---
+ src/login_nopam.c             | 15 +++++----------
+ src/logoutd.c                 |  4 ----
+ src/suauth.c                  |  4 ----
+ src/useradd.c                 | 13 -------------
+ 11 files changed, 44 insertions(+), 40 deletions(-)
+ rename lib/{getdef.h => getdef.h.in} (97%)
+ rename lib/{port.h => port.h.in} (98%)
+
+Index: shadow-4.2.1/configure.in
+===================================================================
+--- shadow-4.2.1.orig/configure.in
++++ shadow-4.2.1/configure.in
+@@ -632,6 +632,8 @@ AM_CONDITIONAL(USE_NLS, test "x$USE_NLS"
+ AC_CONFIG_FILES([
+       Makefile
+       lib/defines.h
++      lib/getdef.h
++      lib/port.h
+       po/Makefile.in
+       doc/Makefile
+       man/Makefile
+Index: shadow-4.2.1/lib/defines.h.in
+===================================================================
+--- shadow-4.2.1.orig/lib/defines.h.in
++++ shadow-4.2.1/lib/defines.h.in
+@@ -316,6 +316,37 @@ char *strchr (), *strrchr (), *strtok ()
+ #endif
+ #endif
+ 
++#ifndef SKEL_DIR
++#define SKEL_DIR "@sysconfdir@/skel"
++#endif
++#ifndef USER_DEFAULTS_FILE
++#define USER_DEFAULTS_FILE "@sysconfdir@/default/useradd"
++#define NEW_USER_FILE "@sysconfdir@/default/nuaddXXXXXX"
++#endif
++/*
++ * Needed for MkLinux DR1/2/2.1 - J.
++ */
++#ifndef LASTLOG_FILE
++#define LASTLOG_FILE "@localstatedir@/log/lastlog"
++#endif
++
++#ifndef HUP_MESG_FILE
++#define HUP_MESG_FILE "@sysconfdir@/logoutd.mesg"
++#endif
++
++#ifndef SUAUTHFILE
++#define SUAUTHFILE "@sysconfdir@/suauth"
++#endif
++
++ /* Path name of the access control file. */
++#ifndef ACCESS_TABLE
++#define ACCESS_TABLE "@sysconfdir@/login.access"
++#endif
++
++#ifndef SHELLS_FILE
++#define SHELLS_FILE "@sysconfdir@/shells"
++#endif
++
+ #ifndef NULL
+ #define NULL ((void *) 0)
+ #endif
+Index: shadow-4.2.1/lib/getdef.c
+===================================================================
+--- shadow-4.2.1.orig/lib/getdef.c
++++ shadow-4.2.1/lib/getdef.c
+@@ -138,10 +138,6 @@ static struct itemdef def_table[] = {
+       {NULL, NULL}
+ };
+ 
+-#ifndef LOGINDEFS
+-#define LOGINDEFS "/etc/login.defs"
+-#endif
+-
+ static char def_fname[] = LOGINDEFS;  /* login config defs file       */
+ static bool def_loaded = false;               /* are defs already loaded?     
*/
+ 
+Index: shadow-4.2.1/lib/getdef.h
+===================================================================
+--- shadow-4.2.1.orig/lib/getdef.h
++++ /dev/null
+@@ -1,47 +0,0 @@
+-/*
+- * Copyright (c) 1991 - 1994, Julianne Frances Haugh
+- * Copyright (c) 1996 - 2000, Marek Michałkiewicz
+- * Copyright (c) 2002 - 2006, Tomasz Kłoczko
+- * Copyright (c) 2008       , Nicolas François
+- * All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 3. The name of the copyright holders or contributors may not be used to
+- *    endorse or promote products derived from this software without
+- *    specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+- * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+- */
+-#ifndef _GETDEF_H
+-#define _GETDEF_H
+-
+-/* getdef.c */
+-extern bool getdef_bool (const char *);
+-extern long getdef_long (const char *, long);
+-extern int getdef_num (const char *, int);
+-extern unsigned long getdef_ulong (const char *, unsigned long);
+-extern unsigned int getdef_unum (const char *, unsigned int);
+-extern /*@observer@*/ /*@null@*/const char *getdef_str (const char *);
+-extern int putdef_str (const char *, const char *);
+-
+-/* default UMASK value if not specified in /etc/login.defs */
+-#define               GETDEF_DEFAULT_UMASK    022
+-
+-#endif                                /* _GETDEF_H */
+Index: shadow-4.2.1/lib/getdef.h.in
+===================================================================
+--- /dev/null
++++ shadow-4.2.1/lib/getdef.h.in
+@@ -0,0 +1,51 @@
++/*
++ * Copyright (c) 1991 - 1994, Julianne Frances Haugh
++ * Copyright (c) 1996 - 2000, Marek Michałkiewicz
++ * Copyright (c) 2002 - 2006, Tomasz Kłoczko
++ * Copyright (c) 2008       , Nicolas François
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. The name of the copyright holders or contributors may not be used to
++ *    endorse or promote products derived from this software without
++ *    specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
++ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++#ifndef _GETDEF_H
++#define _GETDEF_H
++
++#ifndef LOGINDEFS
++#define LOGINDEFS "@sysconfdir@/login.defs"
++#endif
++
++/* getdef.c */
++extern bool getdef_bool (const char *);
++extern long getdef_long (const char *, long);
++extern int getdef_num (const char *, int);
++extern unsigned long getdef_ulong (const char *, unsigned long);
++extern unsigned int getdef_unum (const char *, unsigned int);
++extern /*@observer@*/ /*@null@*/const char *getdef_str (const char *);
++extern int putdef_str (const char *, const char *);
++
++/* default UMASK value if not specified in /etc/login.defs */
++#define               GETDEF_DEFAULT_UMASK    022
++
++#endif                                /* _GETDEF_H */
+Index: shadow-4.2.1/lib/gshadow_.h
+===================================================================
+--- shadow-4.2.1.orig/lib/gshadow_.h
++++ shadow-4.2.1/lib/gshadow_.h
+@@ -71,5 +71,5 @@ void endsgent ();
+ int putsgent ();
+ #endif
+ 
+-#define       GSHADOW "/etc/gshadow"
++#define       GSHADOW "@sysconfdir@/gshadow"
+ #endif                                /* ifndef _H_GSHADOW */
+Index: shadow-4.2.1/lib/port.h
+===================================================================
+--- shadow-4.2.1.orig/lib/port.h
++++ /dev/null
+@@ -1,83 +0,0 @@
+-/*
+- * Copyright (c) 1989 - 1991, Julianne Frances Haugh
+- * Copyright (c) 1996 - 1997, Marek Michałkiewicz
+- * Copyright (c) 2005       , Tomasz Kłoczko
+- * All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 3. The name of the copyright holders or contributors may not be used to
+- *    endorse or promote products derived from this software without
+- *    specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+- * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+- */
+-
+-/*
+- * port.h - structure of /etc/porttime
+- *
+- *    $Id$
+- *
+- *    Each entry in /etc/porttime consists of a TTY device
+- *    name or "*" to indicate all TTY devices, followed by
+- *    a list of 1 or more user IDs or "*" to indicate all
+- *    user names, followed by a list of zero or more valid
+- *    login times.  Login time entries consist of zero or
+- *    more day names (Su, Mo, Tu, We, Th, Fr, Sa, Wk, Al)
+- *    followed by a pair of time values in HHMM format
+- *    separated by a "-".
+- */
+-
+-/*
+- * PORTS - Name of system port access time file.
+- * PORT_IDS - Allowable number of IDs per entry.
+- * PORT_TTY - Allowable number of TTYs per entry.
+- * PORT_TIMES - Allowable number of time entries per entry.
+- * PORT_DAY - Day of the week to a bit value (0 = Sunday).
+- */
+-
+-#define       PORTS   "/etc/porttime"
+-#define       PORT_IDS        64
+-#define       PORT_TTY        64
+-#define       PORT_TIMES      24
+-#define       PORT_DAY(day)   (1<<(day))
+-
+-/*
+- *    pt_names - pointer to array of device names in /dev/
+- *    pt_users - pointer to array of applicable user IDs.
+- *    pt_times - pointer to list of allowable time periods.
+- */
+-
+-struct port {
+-      char **pt_names;
+-      char **pt_users;
+-      struct pt_time *pt_times;
+-};
+-
+-/*
+- *    t_days - bit array for each day of the week (0 = Sunday)
+- *    t_start - starting time for this entry
+- *    t_end - ending time for this entry
+- */
+-
+-struct pt_time {
+-      short t_days;
+-      short t_start;
+-      short t_end;
+-};
+Index: shadow-4.2.1/lib/port.h.in
+===================================================================
+--- /dev/null
++++ shadow-4.2.1/lib/port.h.in
+@@ -0,0 +1,83 @@
++/*
++ * Copyright (c) 1989 - 1991, Julianne Frances Haugh
++ * Copyright (c) 1996 - 1997, Marek Michałkiewicz
++ * Copyright (c) 2005       , Tomasz Kłoczko
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. The name of the copyright holders or contributors may not be used to
++ *    endorse or promote products derived from this software without
++ *    specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
++ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++/*
++ * port.h - structure of /etc/porttime
++ *
++ *    $Id$
++ *
++ *    Each entry in /etc/porttime consists of a TTY device
++ *    name or "*" to indicate all TTY devices, followed by
++ *    a list of 1 or more user IDs or "*" to indicate all
++ *    user names, followed by a list of zero or more valid
++ *    login times.  Login time entries consist of zero or
++ *    more day names (Su, Mo, Tu, We, Th, Fr, Sa, Wk, Al)
++ *    followed by a pair of time values in HHMM format
++ *    separated by a "-".
++ */
++
++/*
++ * PORTS - Name of system port access time file.
++ * PORT_IDS - Allowable number of IDs per entry.
++ * PORT_TTY - Allowable number of TTYs per entry.
++ * PORT_TIMES - Allowable number of time entries per entry.
++ * PORT_DAY - Day of the week to a bit value (0 = Sunday).
++ */
++
++#define       PORTS   "@sysconfdir@/porttime"
++#define       PORT_IDS        64
++#define       PORT_TTY        64
++#define       PORT_TIMES      24
++#define       PORT_DAY(day)   (1<<(day))
++
++/*
++ *    pt_names - pointer to array of device names in /dev/
++ *    pt_users - pointer to array of applicable user IDs.
++ *    pt_times - pointer to list of allowable time periods.
++ */
++
++struct port {
++      char **pt_names;
++      char **pt_users;
++      struct pt_time *pt_times;
++};
++
++/*
++ *    t_days - bit array for each day of the week (0 = Sunday)
++ *    t_start - starting time for this entry
++ *    t_end - ending time for this entry
++ */
++
++struct pt_time {
++      short t_days;
++      short t_start;
++      short t_end;
++};
+Index: shadow-4.2.1/src/chsh.c
+===================================================================
+--- shadow-4.2.1.orig/src/chsh.c
++++ shadow-4.2.1/src/chsh.c
+@@ -55,9 +55,6 @@
+ /*@-exitarg@*/
+ #include "exitcodes.h"
+ 
+-#ifndef SHELLS_FILE
+-#define SHELLS_FILE "/etc/shells"
+-#endif
+ /*
+  * Global variables
+  */
+Index: shadow-4.2.1/src/login_nopam.c
+===================================================================
+--- shadow-4.2.1.orig/src/login_nopam.c
++++ shadow-4.2.1/src/login_nopam.c
+@@ -57,11 +57,6 @@
+ #define MAXHOSTNAMELEN 256
+ #endif
+ 
+- /* Path name of the access control file. */
+-#ifndef       TABLE
+-#define TABLE "/etc/login.access"
+-#endif
+-
+ /* Delimiters for fields and for lists of users, ttys or hosts. */
+ static char fs[] = ":";               /* field separator */
+ static char sep[] = ", \t";   /* list-element separator */
+@@ -89,7 +84,7 @@ int login_access (const char *user, cons
+        * mandatory. The first field should be a "+" or "-" character. A
+        * non-existing table means no access control.
+        */
+-      fp = fopen (TABLE, "r");
++      fp = fopen (ACCESS_TABLE, "r");
+       if (NULL != fp) {
+               int lineno = 0; /* for diagnostics */
+               while (   !match
+@@ -100,7 +95,7 @@ int login_access (const char *user, cons
+                       if (line[end] != '\n') {
+                               SYSLOG ((LOG_ERR,
+                                        "%s: line %d: missing newline or line 
too long",
+-                                       TABLE, lineno));
++                                       ACCESS_TABLE, lineno));
+                               continue;
+                       }
+                       if (line[0] == '#') {
+@@ -119,13 +114,13 @@ int login_access (const char *user, cons
+                           || (strtok ((char *) 0, fs) != NULL)) {
+                               SYSLOG ((LOG_ERR,
+                                        "%s: line %d: bad field count",
+-                                       TABLE, lineno));
++                                       ACCESS_TABLE, lineno));
+                               continue;
+                       }
+                       if (perm[0] != '+' && perm[0] != '-') {
+                               SYSLOG ((LOG_ERR,
+                                        "%s: line %d: bad first field",
+-                                       TABLE, lineno));
++                                       ACCESS_TABLE, lineno));
+                               continue;
+                       }
+                       match = (   list_match (froms, from, from_match)
+@@ -134,7 +129,7 @@ int login_access (const char *user, cons
+               (void) fclose (fp);
+       } else if (errno != ENOENT) {
+               int err = errno;
+-              SYSLOG ((LOG_ERR, "cannot open %s: %s", TABLE, strerror (err)));
++              SYSLOG ((LOG_ERR, "cannot open %s: %s", ACCESS_TABLE, strerror 
(err)));
+       }
+       return (!match || (line[0] == '+'))?1:0;
+ }
+Index: shadow-4.2.1/src/logoutd.c
+===================================================================
+--- shadow-4.2.1.orig/src/logoutd.c
++++ shadow-4.2.1/src/logoutd.c
+@@ -49,10 +49,6 @@ const char *Prog;
+ #define DEFAULT_HUP_MESG _("login time exceeded\n\n")
+ #endif
+ 
+-#ifndef HUP_MESG_FILE
+-#define HUP_MESG_FILE "/etc/logoutd.mesg"
+-#endif
+-
+ /* local function prototypes */
+ #ifdef USE_UTMPX
+ static int check_login (const struct utmpx *ut);
+Index: shadow-4.2.1/src/suauth.c
+===================================================================
+--- shadow-4.2.1.orig/src/suauth.c
++++ shadow-4.2.1/src/suauth.c
+@@ -39,10 +39,6 @@
+ #include "defines.h"
+ #include "prototypes.h"
+ 
+-#ifndef SUAUTHFILE
+-#define SUAUTHFILE "/etc/suauth"
+-#endif
+-
+ #define       NOACTION        0
+ #define       NOPWORD         1
+ #define       DENY            -1
+Index: shadow-4.2.1/src/useradd.c
+===================================================================
+--- shadow-4.2.1.orig/src/useradd.c
++++ shadow-4.2.1/src/useradd.c
+@@ -72,19 +72,6 @@
+ #include "tcbfuncs.h"
+ #endif
+ 
+-#ifndef SKEL_DIR
+-#define SKEL_DIR "/etc/skel"
+-#endif
+-#ifndef USER_DEFAULTS_FILE
+-#define USER_DEFAULTS_FILE "/etc/default/useradd"
+-#define NEW_USER_FILE "/etc/default/nuaddXXXXXX"
+-#endif
+-/*
+- * Needed for MkLinux DR1/2/2.1 - J.
+- */
+-#ifndef LASTLOG_FILE
+-#define LASTLOG_FILE "/var/log/lastlog"
+-#endif
+ /*
+  * Global variables
+  */
+Index: shadow-4.2.1/configure
+===================================================================
+--- shadow-4.2.1.orig/configure
++++ shadow-4.2.1/configure
+@@ -18063,7 +18063,7 @@ else
+ fi
+ 
+ 
+-ac_config_files="$ac_config_files Makefile lib/defines.h po/Makefile.in 
doc/Makefile man/Makefile man/config.xml man/po/Makefile man/cs/Makefile 
man/da/Makefile man/de/Makefile man/es/Makefile man/fi/Makefile man/fr/Makefile 
man/hu/Makefile man/id/Makefile man/it/Makefile man/ja/Makefile man/ko/Makefile 
man/pl/Makefile man/pt_BR/Makefile man/ru/Makefile man/sv/Makefile 
man/tr/Makefile man/zh_CN/Makefile man/zh_TW/Makefile libmisc/Makefile 
lib/Makefile src/Makefile contrib/Makefile etc/Makefile etc/pam.d/Makefile 
shadow.spec"
++ac_config_files="$ac_config_files Makefile lib/defines.h lib/getdef.h 
lib/port.h po/Makefile.in doc/Makefile man/Makefile man/config.xml 
man/po/Makefile man/cs/Makefile man/da/Makefile man/de/Makefile man/es/Makefile 
man/fi/Makefile man/fr/Makefile man/hu/Makefile man/id/Makefile man/it/Makefile 
man/ja/Makefile man/ko/Makefile man/pl/Makefile man/pt_BR/Makefile 
man/ru/Makefile man/sv/Makefile man/tr/Makefile man/zh_CN/Makefile 
man/zh_TW/Makefile libmisc/Makefile lib/Makefile src/Makefile contrib/Makefile 
etc/Makefile etc/pam.d/Makefile shadow.spec"
+ 
+ cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
+@@ -19124,6 +19124,8 @@ do
+     "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
+     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+     "lib/defines.h") CONFIG_FILES="$CONFIG_FILES lib/defines.h" ;;
++    "lib/getdef.h") CONFIG_FILES="$CONFIG_FILES lib/getdef.h" ;;
++    "lib/port.h") CONFIG_FILES="$CONFIG_FILES lib/port.h" ;;
+     "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
+     "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+     "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;

diff --git a/sys-apps/shadow/files/shadow-4.2.1-sysconfdir.patch 
b/sys-apps/shadow/files/shadow-4.2.1-sysconfdir.patch
index 4cf2f4c..1214075 100644
--- a/sys-apps/shadow/files/shadow-4.2.1-sysconfdir.patch
+++ b/sys-apps/shadow/files/shadow-4.2.1-sysconfdir.patch
@@ -1,9 +1,13 @@
+From 54775500160de242f2371da8defc3ca639a95e5c Mon Sep 17 00:00:00 2001
+From: Benda Xu <hero...@gentoo.org>
+Date: Tue, 9 Dec 2014 12:47:31 +0900
+Subject: [PATCH 1/2] override /etc with @sysconfdir@.
+
 ---
- configure        |    3 
- configure.in     |    1 
- lib/defines.h    |  385 
-------------------------------------------------------
- lib/defines.h.in |  385 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 388 insertions(+), 386 deletions(-)
+ configure.in                    | 1 +
+ lib/{defines.h => defines.h.in} | 8 ++++----
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+ rename lib/{defines.h => defines.h.in} (98%)
 
 Index: shadow-4.2.1/configure
 ===================================================================

diff --git a/sys-apps/shadow/shadow-4.2.1.ebuild 
b/sys-apps/shadow/shadow-4.2.1.ebuild
index 264d3cf..6bdef31 100644
--- a/sys-apps/shadow/shadow-4.2.1.ebuild
+++ b/sys-apps/shadow/shadow-4.2.1.ebuild
@@ -35,6 +35,7 @@ RDEPEND="${RDEPEND}
 src_prepare() {
        epatch "${FILESDIR}"/${PN}-4.1.3-dots-in-usernames.patch #22920
        epatch "${FILESDIR}"/${PN}-4.2.1-sysconfdir.patch
+       epatch "${FILESDIR}"/${PN}-4.2.1-sysconfdir-2.patch
        epatch_user
        elibtoolize
 }

Reply via email to