| 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.15 2008/02/20 00:00:01 flameeyes Exp $ |
4 | # $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.18 2009/12/11 20:33:11 vapier 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 |
| … | |
… | |
| 82 | # |
82 | # |
| 83 | # Returns the pam modules' directory for current implementation |
83 | # Returns the pam modules' directory for current implementation |
| 84 | getpam_mod_dir() { |
84 | getpam_mod_dir() { |
| 85 | if has_version sys-libs/pam || has_version sys-libs/openpam; then |
85 | if has_version sys-libs/pam || has_version sys-libs/openpam; then |
| 86 | PAM_MOD_DIR=/$(get_libdir)/security |
86 | PAM_MOD_DIR=/$(get_libdir)/security |
| 87 | elif use ppc-macos; then |
|
|
| 88 | # OSX looks there for pam modules |
|
|
| 89 | PAM_MOD_DIR=/usr/lib/pam |
|
|
| 90 | else |
87 | else |
| 91 | # Unable to find PAM implementation... defaulting |
88 | # Unable to find PAM implementation... defaulting |
| 92 | PAM_MOD_DIR=/$(get_libdir)/security |
89 | PAM_MOD_DIR=/$(get_libdir)/security |
| 93 | fi |
90 | fi |
| 94 | |
91 | |
| … | |
… | |
| 174 | # Cleans a pam.d file from modules that might not be present on the system |
171 | # Cleans a pam.d file from modules that might not be present on the system |
| 175 | # where it's going to be installed |
172 | # where it's going to be installed |
| 176 | cleanpamd() { |
173 | cleanpamd() { |
| 177 | while [[ -n $1 ]]; do |
174 | while [[ -n $1 ]]; do |
| 178 | if ! has_version sys-libs/pam; then |
175 | if ! has_version sys-libs/pam; then |
| 179 | sed -i -e '/pam_shells\|pam_console/s:^:#:' ${D}/etc/pam.d/$1 |
176 | sed -i -e '/pam_shells\|pam_console/s:^:#:' "${D}/etc/pam.d/$1" |
| 180 | fi |
177 | fi |
| 181 | |
178 | |
| 182 | shift |
179 | shift |
| 183 | done |
180 | done |
| 184 | } |
181 | } |
| … | |
… | |
| 213 | done |
210 | done |
| 214 | } |
211 | } |
| 215 | |
212 | |
| 216 | # Think about it before uncommenting this one, for now run it by hand |
213 | # Think about it before uncommenting this one, for now run it by hand |
| 217 | # pam_pkg_preinst() { |
214 | # pam_pkg_preinst() { |
| 218 | # local shopts=$- |
|
|
| 219 | # set -o noglob # so that bash doen't expand "*" |
215 | # eshopts_push -o noglob # so that bash doen't expand "*" |
| 220 | # |
216 | # |
| 221 | # pam_epam_expand "${D}"/etc/pam.d/* |
217 | # pam_epam_expand "${D}"/etc/pam.d/* |
| 222 | # |
218 | # |
| 223 | # set +o noglob; set -$shopts # reset old shell opts |
219 | # eshopts_pop # reset old shell opts |
| 224 | # } |
220 | # } |