#! /bin/ksh PATH="/usr/bin" export PATH # password file # PASSWD="/vecr/private/.htpasswd" ### # function to display error and exit # error() { echo "Content-type: text/plain\n" echo "$@" exit 1 } ### # function to display password requirements # describe_password() { echo "Once you set a local password, it is effective immediately and must be used instead of your Villanova LDAP password to access this system.
When a local password is first set, an ssh login account on vecr.ece.villanova.edu is also automatically established for you within 15 minutes using the same password, with home directory x/ under your main web directory. Local web password changes are effective for your ssh login also within 15 minutes.
Ssh access to Villanova systems from off-campus is available using the Villanova gateway to establish a VPN. For ssh on MS/Win, use putty.
Passwords must be 8 characters long, must not contain any blanks, and must contain at least two alphabetic characters (case-sensitive) and at least two non-alphabetic characters (e.g. digits or punctuation)." } ### # function to check password # check_password() { len=$(expr "$password" : ".*") if [ "$len" -ne 8 ]; then error "Password must be 8 characters long." fi x=$(echo "$password" | tr -d '[:space:]') len=$(expr "$x" : ".*") if [ "$len" -ne 8 ]; then error "Password must not contain any blank characters." fi x=$(echo "$password" | tr -d '[:alpha:]') len=$(expr "$x" : ".*") if [ "$len" -lt 2 ]; then error "Password must contain at least 2 non-alphabetic characters." fi x=$(echo "$password" | tr -dc '[:alpha:]') len=$(expr "$x" : ".*") if [ "$len" -lt 2 ]; then error "Password must contain at least 2 alphabetic characters." fi } # echo "Content-type: text/plain\n" # echo "args: $@\n\nstdin:" # cat # exit 0 title="${user} - set/reset local password" ### # handle GET # if [ "$1" = "GET" ]; then echo "Content-type: text/html\n
Please re-login using your new password." else error "Set password failed:\n\n$x" fi exit fi