Skip to content

Commit

Permalink
fix: Hide auth diagnostics behind --debug to avoid polluting JSON out…
Browse files Browse the repository at this point in the history
…put. (esnet#1087)

Fixes esnet#1086.

While here, fix wording of an error message.
  • Loading branch information
bmah888 authored and hanvari committed Jul 3, 2021
1 parent e3d86bb commit b286f82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,12 +1746,16 @@ int test_is_authorized(struct iperf_test *test){
}
int ret = check_authentication(username, password, ts, test->server_authorized_users, test->server_skew_threshold);
if (ret == 0){
iperf_printf(test, report_authentication_succeeded, username, ts);
if (test->debug) {
iperf_printf(test, report_authentication_succeeded, username, ts);
}
free(username);
free(password);
return 0;
} else {
iperf_printf(test, report_authentication_failed, username, ts);
if (test->debug) {
iperf_printf(test, report_authentication_failed, username, ts);
}
free(username);
free(password);
return -1;
Expand Down
2 changes: 1 addition & 1 deletion src/iperf_locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const char report_connecting[] =
"Connecting to host %s, port %d\n";

const char report_authentication_succeeded[] =
"Authentication successed for user '%s' ts %ld\n";
"Authentication succeeded for user '%s' ts %ld\n";

const char report_authentication_failed[] =
"Authentication failed for user '%s' ts %ld\n";
Expand Down

0 comments on commit b286f82

Please sign in to comment.