int edg_wll_log_proto_handle_gss_failures(edg_wll_Context context, int code, edg_wll_GssStatus *gss_code, const char *text)
{
static char err[256];
- int ret = 0;
+ int myerrno, ret;
+
+ myerrno = errno;
+ ret = 0;
edg_wll_ResetError(context);
ret = edg_wll_SetError(context,ENOTCONN,err);
break;
case EDG_WLL_GSS_ERROR_ERRNO:
- snprintf(err, sizeof(err), "%s;; GSS Error: system error occured;", text);
- ret = edg_wll_SetError(context,ENOTCONN,err);
+ {
+ const char *msg1;
+ char *msg2;
+ msg1 = strerror(myerrno);
+ asprintf(&msg2, "%s;; System Error: %s", text, msg1);
+ ret = edg_wll_SetError(context,ENOTCONN,msg2);
+ free(msg2);
+ }
break;
case EDG_WLL_GSS_ERROR_GSS:
snprintf(err, sizeof(err), "%s;; GSS Error: GSS failure occured", text);
{
const char *msg1;
char *msg2;
- msg1 = hstrerror(errno);
+ msg1 = hstrerror(myerrno);
asprintf(&msg2, "%s;; GSS Error: %s", text, msg1);
ret = edg_wll_SetError(context,EDG_WLL_ERROR_DNS, msg2);
free(msg2);
data.conn = conn;
len = read_il_data(&data, &msg, plain_reader);
if(len < 0) {
- edg_wll_SetError(context, errno, "read_il_data()");
- edg_wll_UpdateError(context, EDG_WLL_IL_PROTO, "get_reply_plain(): error reading message");
+ edg_wll_SetError(context, EDG_WLL_IL_PROTO, "get_reply_plain(): error reading message");
goto get_reply_plain_end;
}
if(decode_il_reply(code_maj, code_min, buf, msg) < 0) {
- edg_wll_SetError(context, errno, "decode_il_reply()");
- edg_wll_UpdateError(context, EDG_WLL_IL_PROTO, "get_reply_plain(): error decoding message");
+ edg_wll_SetError(context, EDG_WLL_IL_PROTO, "get_reply_plain(): error decoding message");
goto get_reply_plain_end;
}
data.conn = conn;
code = read_il_data(&data, &msg, gss_reader);
if(code < 0) {
- edg_wll_SetError(context, errno, "read_il_data()");
edg_wll_UpdateError(context, EDG_WLL_IL_PROTO, "get_reply_gss(): error reading reply");
goto get_reply_gss_end;
}
if(decode_il_reply(code_maj, code_min, buf, msg) < 0) {
- edg_wll_SetError(context, errno, "decode_il_reply()");
- edg_wll_UpdateError(context, EDG_WLL_IL_PROTO, "get_reply_gss(): error decoding reply");
+ char *et;
+ asprintf(&et,"get_reply_gss(): error decoding reply \"%s\"", msg);
+ edg_wll_UpdateError(context, EDG_WLL_IL_PROTO, et);
+ if (et) free(et);
goto get_reply_gss_end;
}
fprintf(stderr,"log_proto_client_proxy: reading answer from server...\n");
#endif
if ((err = get_reply_plain(context, conn, &answer, &lbproto_code, &code)) != 0 ) {
- edg_wll_SetError(context, errno, "get_reply_plain()");
edg_wll_UpdateError(context, EDG_WLL_IL_PROTO,"edg_wll_log_proto_client_proxy(): error reading answer from L&B Proxy server");
} else {
#ifdef EDG_WLL_LOG_STUB
fprintf(stderr,"log_proto_client_direct: reading answer from server...\n");
#endif
if ((err = get_reply_gss(context, con, &answer, &lbproto_code, &code)) != 0 ) {
- edg_wll_SetError(context, errno, "get_reply_gss()");
edg_wll_UpdateError(context, EDG_WLL_IL_PROTO,"edg_wll_log_proto_client_direct(): error reading answer from L&B direct server");
} else {
#ifdef EDG_WLL_LOG_STUB