diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2008-02-20 00:00:01 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2008-02-20 00:00:01 +0000 |
commit | f147ea110c891980ca4c8c0efc2f5dde4edc6946 (patch) | |
tree | 2a5d2e418abe22f3db22a0720c5bda46187db082 /eclass/pam.eclass | |
parent | Mask net-misc/lsh pending removal in two months. (diff) | |
download | gentoo-2-f147ea110c891980ca4c8c0efc2f5dde4edc6946.tar.gz gentoo-2-f147ea110c891980ca4c8c0efc2f5dde4edc6946.tar.bz2 gentoo-2-f147ea110c891980ca4c8c0efc2f5dde4edc6946.zip |
Replace pamd_mimic_system with a pamd_mimic function that takes as an
argument the stack that it should mime. pamd_mimic_system is now a
wrapper, which I should deprecated once I'm done with pambase.
Diffstat (limited to 'eclass/pam.eclass')
-rw-r--r-- | eclass/pam.eclass | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/eclass/pam.eclass b/eclass/pam.eclass index 51c58ea1b61c..4a59ed2d2bea 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.14 2007/11/04 15:00:27 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.15 2008/02/20 00:00:01 flameeyes Exp $ # # This eclass contains functions to install pamd configuration files and # pam modules. @@ -130,25 +130,35 @@ newpammod() { # for the given levels in the /etc/pam.d directory. pamd_mimic_system() { [[ $# -lt 2 ]] && die "pamd_mimic_system requires at least two argments" + pamd_mimic system-auth "$@" +} + +# pamd_mimic <stack> <pamd file> [auth levels] +# +# This function creates a pamd file which mimics the given stack +# for the given levels in the /etc/pam.d directory. +pamd_mimic() { + [[ $# -lt 3 ]] && die "pamd_mimic requires at least three argments" if hasq pam ${IUSE} && ! use pam; then return 0; fi dodir /etc/pam.d - pamdfile=${D}/etc/pam.d/$1 - echo -e "# File autogenerated by pamd_mimic_system in pam eclass\n\n" >> \ + pamdfile=${D}/etc/pam.d/$2 + echo -e "# File autogenerated by pamd_mimic in pam eclass\n\n" >> \ $pamdfile + originalstack=$1 authlevels="auth account password session" if has_version '<sys-libs/pam-0.78'; then - mimic="\trequired\t\tpam_stack.so service=system-auth" + mimic="\trequired\t\tpam_stack.so service=${originalstack}" else - mimic="\tinclude\t\tsystem-auth" + mimic="\tinclude\t\t${originalstack}" fi - shift + shift; shift while [[ -n $1 ]]; do hasq $1 ${authlevels} || die "unknown level type" |