summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2013-08-09 20:41:01 +0200
committerFlorian Bruhin <git@the-compiler.org>2013-08-09 20:41:01 +0200
commit8ef9e0d0e179fb515bc672bf30879a473e883721 (patch)
treee5f9deb34d25578770a5c0ba06ccfd24986c9313
parent903cad2ccec87f3b8d5528fa137260b0a9900425 (diff)
downloadsshtunnel-8ef9e0d0e179fb515bc672bf30879a473e883721.tar.gz
sshtunnel-8ef9e0d0e179fb515bc672bf30879a473e883721.zip
Check tunnel names for invalid chars
-rwxr-xr-xsshtunnel4
1 files changed, 4 insertions, 0 deletions
diff --git a/sshtunnel b/sshtunnel
index 042f727..35a1dac 100755
--- a/sshtunnel
+++ b/sshtunnel
@@ -224,6 +224,10 @@ cmd_profile() {
die "Tunnel $name does not exist!"
fi
+ if [[ "$name" == *[^[:alnum:].:_/\\]* ]]; then
+ die "Name $name contains an invalid character!"
+ fi
+
tunnel_cmd=('exec' '--')
ssh=$(conf_key ssh ssh auto)