=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/etc/netstart,v retrieving revision 1.134 retrieving revision 1.135 diff -c -r1.134 -r1.135 *** src/etc/netstart 2011/10/07 16:36:26 1.134 --- src/etc/netstart 2012/12/02 16:19:18 1.135 *************** *** 1,6 **** #!/bin/sh - # ! # $OpenBSD: netstart,v 1.134 2011/10/07 16:36:26 deraadt Exp $ # Strip comments (and leading/trailing whitespace if IFS is set) # from a file and spew to stdout --- 1,6 ---- #!/bin/sh - # ! # $OpenBSD: netstart,v 1.135 2012/12/02 16:19:18 rpe Exp $ # Strip comments (and leading/trailing whitespace if IFS is set) # from a file and spew to stdout *************** *** 12,37 **** done<$1 } - # Returns true if $1 contains only alphanumerics - isalphanumeric() { - local _n - _n=$1 - while [ ${#_n} != 0 ]; do - case $_n in - [A-Za-z0-9]*) ;; - *) return 1;; - esac - _n=${_n#?} - done - return 0 - } - # Start the $1 interface ifstart() { if=$1 # Interface names must be alphanumeric only. We check to avoid # configuring backup or temp files, and to catch the "*" case. ! if ! isalphanumeric "$if"; then return fi --- 12,24 ---- done<$1 } # Start the $1 interface ifstart() { if=$1 # Interface names must be alphanumeric only. We check to avoid # configuring backup or temp files, and to catch the "*" case. ! if [[ $if != +([[:alpha:]])+([[:digit:]]) ]]; then ! echo "netstart: $if: Invalid interface name" return fi *************** *** 174,180 **** # If we were invoked with a list of interface names, just reconfigure these # interfaces (or bridges) and return. ! if [ $1x = autobootx ]; then shift fi if [ $# -gt 0 ]; then --- 161,167 ---- # If we were invoked with a list of interface names, just reconfigure these # interfaces (or bridges) and return. ! if [[ $1 == autoboot ]]; then shift fi if [ $# -gt 0 ]; then