From 96349ad9ccb4a9c58c4cb32fefcf89d1a76a224f Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 8 Jan 2023 20:45:42 +0100 Subject: debvm-waitssh: error out if hostname contains @ character --- debvm-waitssh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/debvm-waitssh b/debvm-waitssh index a35c783..32db862 100755 --- a/debvm-waitssh +++ b/debvm-waitssh @@ -14,7 +14,8 @@ B [B<-q>] [B<-t> I] [I:]I =head1 DESCRIPTION B can be used to wait for a virtual machine with exposed ssh port to be reachable on that port. -If no hostname is given, B<127.0.0.1> is assumed. +If no hostname is given, B<127.0.0.1> is assumed. No authentication is attempted by B, so neither +a username nor a key have to be supplied. =head1 OPTIONS @@ -142,6 +143,14 @@ case "$1" in ;; esac +case "$HOST" in *@*) + if [ "$VERBOSITY" -ge 1 ]; then + echo "$0: hostname '$HOST' must not contain the '@' character. No username is required." >&2 + fi + exit 1 + ;; +esac + # Guard against strings containing anything but digits, strings starting with # zero and empty strings as the port number. # -- cgit v1.2.3