This commit is contained in:
Cameron (Kamran) Mashayekhi 2005-10-27 22:17:29 +00:00
parent 92075e8aff
commit 3012345ebd
2 changed files with 65 additions and 42 deletions

View File

@ -24,6 +24,28 @@ case "$1" in
start) start)
echo -n "Starting miCASA daemon" echo -n "Starting miCASA daemon"
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 $name ]
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
startproc -f $MICASAD_BIN startproc -f $MICASAD_BIN
# Remember status and be verbose # Remember status and be verbose
@ -36,7 +58,15 @@ case "$1" in
pid=`cat /var/run/micasad.pid` pid=`cat /var/run/micasad.pid`
kill -s TERM $pid kill -s TERM $pid
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 $name ]
then
sed '/pam_micasa/d' $file > $file.sav
mv $file.sav $file
fi
done
# Remember status and be verbose # Remember status and be verbose
rc_status -v rc_status -v
;; ;;

View File

@ -182,57 +182,50 @@ cp %{buildroot}%{prefix}/CASA/bin/micasad %{buildroot}/etc/init.d
if [ $1 -eq 1 ] if [ $1 -eq 1 ]
then then
insserv /etc/init.d/micasad insserv /etc/init.d/micasad
%ifarch x86_64 echo "/opt/novell/CASA/%{_lib}/" >> /etc/ld.so.conf.d/CASA.conf
echo "/opt/novell/CASA/lib64/" >> /etc/ld.so.conf.d/CASA.conf
/sbin/ldconfig /sbin/ldconfig
%else
echo "/opt/novell/CASA/lib/" >> /etc/ld.so.conf.d/CASA.conf
/sbin/ldconfig
%endif
for 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"
# for file in "/etc/security/pam_unix2.conf" # for file in "/etc/security/pam_unix2.conf"
do # do
#
if [ -f $name ] # if [ -f $name ]
then # then
awk ' # awk '
/auth/ { authSeen++; } # /auth/ { authSeen++; }
/account/ { # /account/ {
if (!acctSeen && authSeen) # if (!acctSeen && authSeen)
{ # {
print "auth\trequired\tpam_micasa.so\n";} # print "auth\trequired\tpam_micasa.so\n";}
acctSeen++; # acctSeen++;
} # }
/session/ { sesSeen++; } # /session/ { sesSeen++; }
// {print $0; } # // {print $0; }
END { if (sesSeen) # END { if (sesSeen)
print "session\trequired\tpam_micasa.so\n"; } # print "session\trequired\tpam_micasa.so\n"; }
' $file > $file.sav # ' $file > $file.sav
mv $file.sav $file # mv $file.sav $file
fi # fi
done # done
fi fi
%preun %preun
if [ $1 -eq 0 ] if [ $1 -eq 0 ]
then then
for 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"
# for file in "/etc/security/pam_unix2.conf" # for file in "/etc/security/pam_unix2.conf"
do # do
if [ -f $name ] # if [ -f $name ]
then # then
sed '/pam_micasa/d' $file > $file.sav # sed '/pam_micasa/d' $file > $file.sav
mv $file.sav $file # mv $file.sav $file
fi # fi
done # done
#
sed '/CASA/d' "/etc/ld.so.conf" > "/etc/ld.so.conf.sav" rm -f /etc/ld.so.conf.d/CASA.conf
mv /etc/ld.so.conf.sav /etc/ld.so.conf /sbin/ldconfig
insserv -r /etc/init.d/micasad
/sbin/ldconfig
insserv -r /etc/init.d/micasad
fi fi
%clean %clean