diff options
author | dteske <dteske@FreeBSD.org> | 2014-07-31 22:13:31 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2014-07-31 22:13:31 +0000 |
commit | 9f01ef1fa73cac2f4cc0766662af69881f1fbcdc (patch) | |
tree | e31cc979fc6c37bec6d4ecbeab087c64a880c375 /usr.sbin | |
parent | 5cbb895ebfdd192459082f198254d1f7a0d8497a (diff) | |
download | FreeBSD-src-9f01ef1fa73cac2f4cc0766662af69881f1fbcdc.zip FreeBSD-src-9f01ef1fa73cac2f4cc0766662af69881f1fbcdc.tar.gz |
Update command and add check for edge-case.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bsdconfig/share/common.subr | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr index 6ce1956..57c4125 100644 --- a/usr.sbin/bsdconfig/share/common.subr +++ b/usr.sbin/bsdconfig/share/common.subr @@ -222,7 +222,7 @@ f_have() # setvar $var_to_set [$value] # -# Implement setvar for shells such as unlike FreeBSD sh(1). +# Implement setvar for shells unlike FreeBSD sh(1). # if ! f_have setvar; then setvar() @@ -236,6 +236,10 @@ setvar() *) f_err "setvar: too many arguments\n" return $FAILURE esac + case "$__setvar_var_to_set" in *[!0-9A-Za-z_]*) + f_err "setvar: %s: bad variable name\n" "$__setvar_var_to_set" + return 2 + esac while case "$__setvar_r" in *\'*) : ;; *) false ; esac do __setvar_left="$__setvar_left${__setvar_right%%\'*}'\\''" |