~mdw
/
dyndns
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
751afaf
)
bin/update: Check that the hostname is actually plausibly formed.
author
Mark Wooding
<mdw@distorted.org.uk>
Wed, 6 Feb 2013 00:28:38 +0000
(
00:28
+0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 6 Feb 2013 00:28:38 +0000
(
00:28
+0000)
I'm going to assume that nsupdate or something will complain if the DNS
length limits or whatever are exceeded.
bin/update
patch
|
blob
|
blame
|
history
diff --git
a/bin/update
b/bin/update
index
a9c2716
..
957df07
100755
(executable)
--- a/
bin/update
+++ b/
bin/update
@@
-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