From 9c99b979973a0bbbee7f67ff10b696afd03ce363 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Tue, 29 Mar 2022 18:14:54 -0400 Subject: Set clientOrigin from bindHost, add dot if necessary Since effectively the difference between a nick origin and a server origin is the presence of a dot. --- bounce.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bounce.c') diff --git a/bounce.c b/bounce.c index de455d4..69783f8 100644 --- a/bounce.c +++ b/bounce.c @@ -285,6 +285,13 @@ int main(int argc, char *argv[]) { if (clientPass && clientPass[0] != '$') { errx(EX_USAGE, "password must be hashed with -x"); } + if (strchr(bindHost, '.')) { + clientOrigin = strdup(bindHost); + if (!clientOrigin) err(EX_OSERR, "strdup"); + } else { + int n = asprintf(&clientOrigin, "%s.", bindHost); + if (n < 0) err(EX_OSERR, "asprintf"); + } if (printCert) { #ifdef __OpenBSD__ -- cgit 1.4.1