summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2005-09-09 10:31:35 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2005-09-09 10:31:35 +0000
commit44917632c584ab0714c9d2de8d61f40d31e6f6c4 (patch)
tree54ed0ccf60e06ad4063a2b0b9704c1b711eb9384 /eclass
parentUpdated ipv6 patch to test23. (diff)
downloadhistorical-44917632c584ab0714c9d2de8d61f40d31e6f6c4.tar.gz
historical-44917632c584ab0714c9d2de8d61f40d31e6f6c4.tar.bz2
historical-44917632c584ab0714c9d2de8d61f40d31e6f6c4.zip
Added check for non-portable modules in pamd files, so that pamd files that get installed on OpenPAM systems works fine.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/pam.eclass18
1 files changed, 17 insertions, 1 deletions
diff --git a/eclass/pam.eclass b/eclass/pam.eclass
index b9ceda277f2d..ad8c25836ad0 100644
--- a/eclass/pam.eclass
+++ b/eclass/pam.eclass
@@ -1,7 +1,7 @@
# Copyright 2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Diego Pettenò <flameeyes@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.8 2005/07/06 20:23:20 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.9 2005/09/09 10:31:35 flameeyes Exp $
#
# This eclass contains functions to install pamd configuration files and
# pam modules.
@@ -20,6 +20,7 @@ dopamd() {
INSDESTTREE=/etc/pam.d \
doins "$@" || die "failed to install $@"
+ cleanpamd "$@"
}
# newpamd <old name> <new name>
@@ -34,6 +35,7 @@ newpamd() {
INSDESTTREE=/etc/pam.d \
newins "$1" "$2" || die "failed to install $1 as $2"
+ cleanpamd $2
}
# dopamsecurity <section> <file> [more files]
@@ -144,3 +146,17 @@ pamd_mimic_system() {
shift
done
}
+
+# cleanpamd <pamd file>
+#
+# Cleans a pam.d file from modules that might not be present on the system
+# where it's going to be installed
+cleanpamd() {
+ while [[ -n $1 ]]; do
+ if ! has_version sys-libs/pam; then
+ sed -i -e '/pam_shells\|pam_console/s:^:#:' ${D}/etc/pam.d/$1
+ fi
+
+ shift
+ done
+}