Changeset 5c7a4d0


Ignore:
Timestamp:
07/29/14 09:52:22 (4 months ago)
Author:
Josh <joshms@…>
Branches:
master, releng/10.0.3, releng/10.1
Children:
13ccd816
Parents:
5b93f09
Message:

Improved input validation for username. Can use this all over the rest of the installer for validation of characters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pc-installdialog/pc-installdialog.sh

    r1041fc9 r5c7a4d0  
    606606       continue 
    607607    fi    
    608     #check for invalid characters.  Will need to expand this detection later 
    609     echo $ANS | grep -q -e "!" -e "@" -e "#" -e "%" -e '\$' -e '\^' -e '\&' -e '\*' -e '(' -e ')' 
    610     if [ $? -eq 0 ] ; then        
     608    #check for invalid characters. 
     609    echo "$ANS" | grep -q '^[a-zA-Z0-9]*$' 
     610    if [ $? -eq 1 ] ; then 
    611611       echo "Name contains invalid characters!" >> /tmp/.vartemp.$$ 
    612612       dialog --tailbox /tmp/.vartemp.$$ 8 35 
     
    615615    fi 
    616616    USERNAME="$ANS" 
    617     if [ "$USERNAME" = "$ANS" ] ; then break; fi 
     617    break 
    618618  done 
    619619   
Note: See TracChangeset for help on using the changeset viewer.