.ssh/sshsvc.conf: Newer version of `sshsvc-mkauthkeys'.
[dyndns] / bin / update
index a9c2716..60cbea0 100755 (executable)
@@ -31,6 +31,13 @@ doneargs='case $# in 0) ;; *) fail_usage ;; esac'
 checkhost () {
   host=$1
 
+  case "$host" in
+    *..* | .* | *. | *[!-_.a-zA-Z0-9]*)
+      echo >&2 "$0: invalid hostname"
+      exit 2
+      ;;
+  esac
+
   matchp=nil
   for pat in $DYNDNS_HOST; do
     case "$host" in $pat) matchp=t ;; esac
@@ -61,7 +68,7 @@ case "$cmd" in
       0,t,*) fail_usage ;;
       *,nil,"$client" | *,t,*) addr=$1; shift ;;
       *)
-       echo >&2 "$0: incorrect address (wanted = $2; found = $addr)"
+       echo >&2 "$0: incorrect address (wanted = $client; found = $1)"
        exit 3
        ;;
     esac