This was working successfully in AIX 4.3.1.0. After upgrading the
machine and OS to AIX 5.2.0.0, the custom authentication failed.

I used the following entries and script:


/etc/security/login.cfg :
auth_method:
program = /usr/bin/user_limit.scp


/etc/security/user ("default" section):
auth1 = SYSTEM,auth_method


#/usr/bin/user_limit.scp
#!/bin/ksh
USER=$1
LOGNUM=`cat /logins.dat | grep $USER | awk '{print $2}'`

if [[ $LOGNUM = '' ]]
then
LOGNUM=1
fi

NUM=`who | grep -w -c $USER`

if [[ $NUM -lt $LOGNUM ]]
then
exit 0
fi
echo "permission denied ... you already have $NUM login(s) for" $USER
"."
exit 255


Problem:
After entering the user name and password, the following error is
shown. If I comment out the lines in the login.cfg and user files, I
can login successfully.

AIX Version 5
(C) Copyrights by IBM and by others 1982, 2005.
login: root
root's Password:
3004-007 You entered an invalid login name or password.
login:


Thanks in advance for your help.

Jack