casacfgpam was corrected to install casa in the right place after common-auth, common-session, pam_unix2.so or the end of the section.

This commit is contained in:
Cameron (Kamran) Mashayekhi 2006-02-09 00:46:36 +00:00
parent 7d1f7c9ed7
commit 78997d2777
2 changed files with 50 additions and 19 deletions

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Wed Feb 8 17:45:50 MST 2006 - cmashayekhi@novell.com
- startup and shutdown script was modified to not
edit pam files.
- script to modify pam files for install, upgradeand
remove were created and spec file was modified to
call them.
- startup and shut down of the service during install
and upgrade was fixed.
-------------------------------------------------------------------
Tue Feb 7 14:00:59 MST 2006 - cmashayekhi@novell.com

View File

@ -1,25 +1,45 @@
# Adding CASA pam entries to pam files.
for pam_file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm"
for file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm"
do
if [ -f $pam_file ]
if [ -f $file ]
then
MICASA_D=`grep -i pam_micasa $pam_file`
if [ -z "$MICASA_D" ]
sed -i '/pam_micasa/d' $file
var=`grep pam_unix2.so $file`
entry=`echo -e "auth\t required\tpam_micasa.so"`
entry2=`echo -e "session\t required\tpam_micasa.so"`
cnt=0
if [ "$var" != "" ]
then
awk '
/auth/ { authSeen++; }
/account/ {
if (!acctSeen && authSeen)
{
print "auth\trequired\tpam_micasa.so\n";}
acctSeen++;
}
/session/ { sesSeen++; }
// {print $0; }
END { if (sesSeen)
print "session\trequired\tpam_micasa.so\n"; }
' $pam_file > $pam_file.sav
mv $pam_file.sav $pam_file
sed -i "/^auth.*required.*pam_unix2.so/a$entry" $file
sed -i "/^session.*required.*pam_unix2.so/a$entry2" $file
else
let ' cnt = cnt + 1'
fi
var2=`grep common-auth $file`
if [ "$var2" != "" ]
then
sed -i "/^auth.*include.*common-auth/a$entry" $file
sed -i "/^session.*include.*common-session/a$entry2" $file
else
let ' cnt = cnt + 1'
fi
if [ $cnt -eq 2 ]
then
awk '
/auth/ { authSeen++; }
/account/ {
if (!acctSeen && authSeen)
{
print "auth\trequired\tpam_micasa.so\n";}
acctSeen++;
}
/session/ { sesSeen++; }
// {print $0; }
END { if (sesSeen)
print "session\trequired\tpam_micasa.so\n"; }
' $file > $file.sav
mv $file.sav $file
fi
fi
done
done