diff options
author | Bruce A. Mah <bmah@es.net> | 2020-07-10 16:31:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-10 16:31:41 -0700 |
commit | d5d2e2473f449752aaa55bf1b0589868cc950eb2 (patch) | |
tree | 6fc289d44c087ad14bbb32f7837fbc4d18c0907d | |
parent | 223da9809006c8cadf2e309566a3d526be775d63 (diff) | |
download | iperf3-d5d2e2473f449752aaa55bf1b0589868cc950eb2.tar.gz |
fix: Correctly emit an error message when unable to get a password. (#1026)
This occurs when iperf3 is being run with authentication and it
tries to get a password interactively, but there's no tty available.
Fixes #1024.
-rw-r--r-- | src/iperf_api.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/iperf_api.c b/src/iperf_api.c index c9b2a1a..16e0b95 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -1345,6 +1345,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) if ((client_password = getenv("IPERF3_PASSWORD")) != NULL) client_password = strdup(client_password); else if (iperf_getpass(&client_password, &s, stdin) < 0){ + i_errno = IESETCLIENTAUTH; return -1; } if (test_load_pubkey_from_file(client_rsa_public_key) < 0){ |