I'm working with OpenBSD 5.6 and the goal is that I need to create user when he or she tries to authenticate with specific password. I've written a script for this purpose and everything goes ok but first attempt (when user is created) fails. Obviously second attempt is ok.I guess problem is that the system checks username before authentication script running so system doesn't know this user. Is there any way to resolve this?#/bin/sh# 5th parameter is usernameecho password:read pswdsomeAuthMethodInvocation $5 $pswd# check if user authenticated successfullyif [ `echo $?` == 0]; then    useradd $5    echo authorize>$3    exit 0fi
User creation during authentication
authentication;openbsd;useradd