| 1 | # Copyright 2004 Gentoo Foundation |
1 | # Copyright 2004 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License, v2 or later |
2 | # Distributed under the terms of the GNU General Public License, v2 or later |
| 3 | # Author Diego Pettenò <flameeyes@gentoo.org> |
3 | # Author Diego Pettenò <flameeyes@gentoo.org> |
| 4 | # $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.5 2005/06/07 11:33:39 flameeyes Exp $ |
4 | # $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.6 2005/07/04 12:50:47 flameeyes Exp $ |
| 5 | # |
5 | # |
| 6 | # This eclass contains functions to install pamd configuration files and |
6 | # This eclass contains functions to install pamd configuration files and |
| 7 | # pam modules. |
7 | # pam modules. |
| 8 | |
8 | |
| 9 | inherit multilib |
9 | inherit multilib |
| … | |
… | |
| 128 | echo -e "# File autogenerated by pamd_mimic_system in pam eclass\n\n" >> \ |
128 | echo -e "# File autogenerated by pamd_mimic_system in pam eclass\n\n" >> \ |
| 129 | $pamdfile |
129 | $pamdfile |
| 130 | |
130 | |
| 131 | authlevels="auth account password session" |
131 | authlevels="auth account password session" |
| 132 | |
132 | |
|
|
133 | if has_version '<sys-libs/pam-0.78'; then |
|
|
134 | mimic="\trequired\t\tpam_stack.so service=system-auth" |
|
|
135 | else |
|
|
136 | mimic="\tinclude\t\tsystem-auth" |
|
|
137 | fi |
|
|
138 | |
| 133 | shift |
139 | shift |
| 134 | |
140 | |
| 135 | while [[ -n $1 ]]; do |
141 | while [[ -n $1 ]]; do |
| 136 | hasq $1 ${authlevels} || die "unknown level type" |
142 | hasq $1 ${authlevels} || die "unknown level type" |
| 137 | |
143 | |
| 138 | echo -e "$1\tinclude\t\tsystem-auth" >> ${pamdfile} |
144 | echo -e "$1${mimic}" >> ${pamdfile} |
| 139 | |
145 | |
| 140 | shift |
146 | shift |
| 141 | done |
147 | done |
| 142 | } |
148 | } |