diff options
author | Günther Deschner <gdeschner@redhat.com> | 2012-06-21 15:23:13 +0200 |
---|---|---|
committer | Günther Deschner <gdeschner@redhat.com> | 2012-06-26 14:45:10 +0200 |
commit | 5ba3ae0446cf4e3c0507e74ea09e18077f151c74 (patch) | |
tree | 236ce3a7cae0d9fc9a7135cf5e0cf2bee81c0440 /proxy | |
parent | ec3b73aefe72e13433dfbc5a85714fdfecf87040 (diff) | |
download | gss-proxy-5ba3ae0446cf4e3c0507e74ea09e18077f151c74.tar.gz gss-proxy-5ba3ae0446cf4e3c0507e74ea09e18077f151c74.tar.xz gss-proxy-5ba3ae0446cf4e3c0507e74ea09e18077f151c74.zip |
Try to print more useful error output in test code.
Guenther
Diffstat (limited to 'proxy')
-rw-r--r-- | proxy/tests/cli_srv_comm.c | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/proxy/tests/cli_srv_comm.c b/proxy/tests/cli_srv_comm.c index 2d7d3eb..fdcea1e 100644 --- a/proxy/tests/cli_srv_comm.c +++ b/proxy/tests/cli_srv_comm.c @@ -235,7 +235,8 @@ void *client_thread(void *pvt) if (ret_maj != GSS_S_COMPLETE && ret_maj != GSS_S_CONTINUE_NEEDED) { fprintf(stdout, - "gss_init_sec_context() failed with: %d\n", ret_maj); + "gss_init_sec_context() failed with: %d (%s)\n", + ret_maj, strerror(ret_maj)); goto done; } if (out_token.length != 0) { @@ -317,21 +318,24 @@ void *server_thread(void *pvt) ret_maj = gpm_import_name(&ret_min, &target_buf, GSS_C_NT_HOSTBASED_SERVICE, &target_name); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); goto done; } ret_maj = gpm_canonicalize_name(&ret_min, target_name, gss_mech_krb5, &canon_name); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); goto done; } ret_maj = gpm_display_name(&ret_min, canon_name, &out_name_buf, &out_name_type); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); goto done; } @@ -340,7 +344,8 @@ void *server_thread(void *pvt) /* indicate mechs family functions tests */ ret_maj = gpm_indicate_mechs(&ret_min, &mech_set); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); goto done; } @@ -349,7 +354,8 @@ void *server_thread(void *pvt) &mech_set->elements[0], &mech_names); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(&mech_set->elements[0], ret_maj, ret_min); goto done; } @@ -358,7 +364,8 @@ void *server_thread(void *pvt) &mech_attrs, &known_mech_attrs); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(&mech_set->elements[0], ret_maj, ret_min); goto done; } @@ -368,7 +375,8 @@ void *server_thread(void *pvt) &mech_name, &mech_description); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(&mech_set->elements[0], ret_maj, ret_min); goto done; } @@ -376,7 +384,8 @@ void *server_thread(void *pvt) &mech_attrs->elements[0], &name, &short_desc, &long_desc); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); goto done; } @@ -386,13 +395,15 @@ void *server_thread(void *pvt) GSS_C_NO_OID_SET, &mechs); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); goto done; } ret_maj = gpm_inquire_mechs_for_name(&ret_min, target_name, &mech_types); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); goto done; } @@ -406,14 +417,16 @@ void *server_thread(void *pvt) NULL, NULL); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", + ret_maj, strerror(ret_maj)); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); goto done; } ret = gp_recv_buffer(data->srv_pipe[0], buffer, &buflen); if (ret) { - fprintf(stdout, "Failed to get data from client!\n"); + fprintf(stdout, "Failed to get data from client: %d (%s)\n", + ret, strerror(ret)); goto done; } @@ -432,7 +445,8 @@ void *server_thread(void *pvt) NULL, &deleg_cred); if (ret_maj) { - fprintf(stdout, "gssproxy returned an error: %d\n", ret_maj); + fprintf(stdout, "gssproxy returned an error: %d (%s)\n", ret_maj, + strerror(ret_maj)); gp_log_failure(GSS_C_NO_OID, ret_maj, ret_min); goto done; } |