/[gentoo-x86]/eclass/pam.eclass
Gentoo

Diff of /eclass/pam.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.8
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.3 2005/05/20 15:54:34 flameeyes Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.8 2005/07/06 20:23:20 agriffis 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
9inherit multilib 9inherit multilib
10ECLASS="pam"
11INHERITED="$INHERITED $ECLASS"
12 10
13# dopamd <file> [more files] 11# dopamd <file> [more files]
14# 12#
15# Install pam auth config file in /etc/pam.d 13# Install pam auth config file in /etc/pam.d
16dopamd() { 14dopamd() {
47 if hasq pam ${IUSE} && ! use pam; then 45 if hasq pam ${IUSE} && ! use pam; then
48 return 0; 46 return 0;
49 fi 47 fi
50 48
51 INSDESTTREE=/etc/security/$1 \ 49 INSDESTTREE=/etc/security/$1 \
52 shift
53 doins "$@" || die "failed to install $@" 50 doins "${@:2}" || die "failed to install ${@:2}"
54} 51}
55 52
56# newpamsecurity <section> <old name> <new name> 53# newpamsecurity <section> <old name> <new name>
57# 54#
58# Installs the config file <old name> as <new name> in /etc/security/<section>/ 55# Installs the config file <old name> as <new name> in /etc/security/<section>/
69 66
70# getpam_mod_dir 67# getpam_mod_dir
71# 68#
72# Returns the pam modules' directory for current implementation 69# Returns the pam modules' directory for current implementation
73getpam_mod_dir() { 70getpam_mod_dir() {
74 if has_version sys-libs/pam; then 71 if has_version sys-libs/pam || has_version sys-libs/openpam; then
75 PAM_MOD_DIR=/$(get_libdir)/security 72 PAM_MOD_DIR=/$(get_libdir)/security
76 elif has_version sys-libs/openpam; then 73 elif use ppc-macos; then
74 # OSX looks there for pam modules
77 PAM_MOD_DIR=/usr/$(get_libdir) 75 PAM_MOD_DIR=/usr/lib/pam
78 else 76 else
79 # Unable to find PAM implementation... defaulting 77 # Unable to find PAM implementation... defaulting
80 PAM_MOD_DIR=/$(get_libdir)/security 78 PAM_MOD_DIR=/$(get_libdir)/security
81 fi 79 fi
82 80
125 123
126 dodir /etc/pam.d 124 dodir /etc/pam.d
127 pamdfile=${D}/etc/pam.d/$1 125 pamdfile=${D}/etc/pam.d/$1
128 echo -e "# File autogenerated by pamd_mimic_system in pam eclass\n\n" >> \ 126 echo -e "# File autogenerated by pamd_mimic_system in pam eclass\n\n" >> \
129 $pamdfile 127 $pamdfile
130 128
131 authlevels="auth account password session" 129 authlevels="auth account password session"
130
131 if has_version '<sys-libs/pam-0.78'; then
132 mimic="\trequired\t\tpam_stack.so service=system-auth"
133 else
134 mimic="\tinclude\t\tsystem-auth"
135 fi
132 136
133 shift 137 shift
134 138
135 while [[ -n $1 ]]; do 139 while [[ -n $1 ]]; do
136 hasq $1 ${authlevels} || die "unknown level type" 140 hasq $1 ${authlevels} || die "unknown level type"
137 141
138 echo -e "$1\tinclude\t\tsystem-auth" >> ${pamdfile} 142 echo -e "$1${mimic}" >> ${pamdfile}
139 143
140 shift 144 shift
141 done 145 done
142} 146}

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20