From afd206ea405c083ecae71ad618b5f910af3eca81 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 13 Dec 2020 11:09:51 +0000 Subject: [PATCH] Give psusan and Uppity different SSH banner text. 'Uppity' is the name of a program that's only useful for debugging, so I'd rather not have its name reused by psusan which I'm polishing up to be actually useful to end users (if rather specialist ones). So SshServerConfig now has an 'application name' field which is used as the application name in the SSH banner, and Uppity sets it to "Uppity" while psusan sets it to "PSUSAN". --- sshserver.c | 2 +- sshserver.h | 1 + unix/uxpsusan.c | 1 + unix/uxserver.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sshserver.c b/sshserver.c index d5e42b09..d196ab70 100644 --- a/sshserver.c +++ b/sshserver.c @@ -302,7 +302,7 @@ void ssh_server_start(Plug *plug, Socket *socket) srv->bpp = ssh_verstring_new( srv->conf, srv->logctx, srv->ssc->bare_connection, our_protoversion, &srv->version_receiver, - true, "Uppity"); + true, srv->ssc->application_name); server_connect_bpp(srv); queue_idempotent_callback(&srv->bpp->ic_in_raw); } diff --git a/sshserver.h b/sshserver.h index c0b2c933..358f24af 100644 --- a/sshserver.h +++ b/sshserver.h @@ -1,6 +1,7 @@ typedef struct AuthPolicy AuthPolicy; struct SshServerConfig { + const char *application_name; const char *session_starting_dir; RSAKey *rsa_kex_key; diff --git a/unix/uxpsusan.c b/unix/uxpsusan.c index 6fb82da7..3a0019fc 100644 --- a/unix/uxpsusan.c +++ b/unix/uxpsusan.c @@ -267,6 +267,7 @@ int main(int argc, char **argv) memset(&ssc, 0, sizeof(ssc)); + ssc.application_name = "PSUSAN"; ssc.session_starting_dir = getenv("HOME"); ssc.bare_connection = true; diff --git a/unix/uxserver.c b/unix/uxserver.c index 65978dbe..f8dc1033 100644 --- a/unix/uxserver.c +++ b/unix/uxserver.c @@ -533,6 +533,7 @@ int main(int argc, char **argv) memset(&ssc, 0, sizeof(ssc)); + ssc.application_name = "Uppity"; ssc.session_starting_dir = getenv("HOME"); ssc.ssh1_cipher_mask = SSH1_SUPPORTED_CIPHER_MASK; ssc.ssh1_allow_compression = true;