get away from G_LOG_LEVEL_ERROR since they cause abort()

This commit is contained in:
Frédéric Péters 2004-08-14 12:57:13 +00:00
parent 2195d23edb
commit 09a8899c80
8 changed files with 31 additions and 24 deletions

View File

@ -126,7 +126,9 @@ lasso_authn_request_envelope_new_from_export(gchar *buffer,
xmlFree(buffer_decoded);
break;
default:
message(G_LOG_LEVEL_ERROR, "Invalid export type : %d\n", export_type);
message(G_LOG_LEVEL_WARNING, "Invalid export type : %d\n", export_type);
g_free(request);
request = NULL;
break;
}

View File

@ -64,7 +64,7 @@ lasso_authn_response_get_status(LassoAuthnResponse *response) {
value = lasso_node_get_attr_value(status_code, "Value", &err);
lasso_node_destroy(status_code);
if (err != NULL) {
message(G_LOG_LEVEL_ERROR, err->message);
message(G_LOG_LEVEL_WARNING, err->message);
g_error_free(err);
return (NULL);
}
@ -73,7 +73,7 @@ lasso_authn_response_get_status(LassoAuthnResponse *response) {
}
}
else {
message(G_LOG_LEVEL_ERROR, "No StatusCode element found in AuthnResponse.\n");
message(G_LOG_LEVEL_WARNING, "No StatusCode element found in AuthnResponse.\n");
return (NULL);
}
}

View File

@ -42,7 +42,7 @@ lasso_logout_response_get_status_code_value(LassoLogoutResponse *response)
value = lasso_node_get_attr_value(status_code, "Value", &err);
lasso_node_destroy(status_code);
if (err != NULL) {
message(G_LOG_LEVEL_ERROR, err->message);
message(G_LOG_LEVEL_WARNING, err->message);
g_error_free(err);
return (NULL);
}
@ -51,7 +51,7 @@ lasso_logout_response_get_status_code_value(LassoLogoutResponse *response)
}
}
else {
message(G_LOG_LEVEL_ERROR, "No StatusCode element found in Response.\n");
message(G_LOG_LEVEL_WARNING, "No StatusCode element found in Response.\n");
return (NULL);
}
}
@ -234,7 +234,7 @@ lasso_logout_response_new_from_request_export(gchar *buffer,
request = lasso_logout_request_new_from_export(buffer, export_type);
break;
default:
message(G_LOG_LEVEL_ERROR, "Invalid export type\n");
message(G_LOG_LEVEL_WARNING, "Invalid export type\n");
return(NULL);
}
@ -257,14 +257,14 @@ lasso_logout_response_new_from_soap(gchar *buffer)
envelope = lasso_node_new_from_dump(buffer);
if(envelope == NULL) {
message(G_LOG_LEVEL_ERROR, "Error while parsing the soap msg\n");
message(G_LOG_LEVEL_WARNING, "Error while parsing the soap msg\n");
return(NULL);
}
lassoNode_response = lasso_node_get_child(envelope, "LogoutResponse",
NULL, NULL);
if(lassoNode_response == NULL) {
message(G_LOG_LEVEL_ERROR, "LogoutResponse node not found\n");
message(G_LOG_LEVEL_WARNING, "LogoutResponse node not found\n");
return(NULL);
}
class = LASSO_NODE_GET_CLASS(lassoNode_response);
@ -294,7 +294,7 @@ lasso_logout_response_new_from_export(gchar *buffer,
response = lasso_logout_response_new_from_soap(buffer);
break;
default:
message(G_LOG_LEVEL_ERROR, "Invalid export type\n");
message(G_LOG_LEVEL_WARNING, "Invalid export type\n");
return(NULL);
}

View File

@ -273,7 +273,7 @@ lasso_register_name_identifier_request_new_from_export(gchar *buff
request = lasso_register_name_identifier_request_new_from_soap(buffer);
break;
default:
message(G_LOG_LEVEL_ERROR, "Invalid export type\n");
message(G_LOG_LEVEL_WARNING, "Invalid export type\n");
request = NULL;
}

View File

@ -221,7 +221,7 @@ lasso_register_name_identifier_response_new_from_request_export(gchar
request = lasso_register_name_identifier_request_new_from_export(buffer, export_type);
if(request){
message(G_LOG_LEVEL_ERROR, "Error while building RegisterNameIdentifierRequest\n");
message(G_LOG_LEVEL_WARNING, "Error while building RegisterNameIdentifierRequest\n");
return(NULL);
}
@ -248,7 +248,7 @@ lasso_register_name_identifier_response_new_from_export(gchar *buf
response = lasso_register_name_identifier_response_new_from_soap(buffer);
break;
default:
message(G_LOG_LEVEL_ERROR, "Invalid export type\n");
message(G_LOG_LEVEL_WARNING, "Invalid export type\n");
return(NULL);
}

View File

@ -53,13 +53,13 @@ lasso_profile_get_request_type_from_soap_msg(gchar *soap)
soap_node = lasso_node_new_from_dump(soap);
if (soap_node == NULL) {
message(G_LOG_LEVEL_ERROR, "Error while build node from soap msg\n");
message(G_LOG_LEVEL_WARNING, "Error while build node from soap msg\n");
return(-1);
}
body_node = lasso_node_get_child(soap_node, "Body", NULL, NULL);
if(body_node == NULL) {
message(G_LOG_LEVEL_ERROR, "Body node not found\n");
message(G_LOG_LEVEL_WARNING, "Body node not found\n");
return(-2);
}
@ -87,7 +87,7 @@ lasso_profile_get_request_type_from_soap_msg(gchar *soap)
type = lassoRequestTypeLecp;
}
else {
message(G_LOG_LEVEL_ERROR, "Unkown node name : %s\n", name);
message(G_LOG_LEVEL_WARNING, "Unkown node name : %s\n", name);
}
xmlFree(name);
}
@ -269,7 +269,7 @@ lasso_profile_set_identity_from_dump(LassoProfile *ctx,
{
ctx->identity = lasso_identity_new_from_dump((gchar *)dump);
if (ctx->identity == NULL) {
message(G_LOG_LEVEL_ERROR, "Failed to create the identity from the identity dump\n");
message(G_LOG_LEVEL_WARNING, "Failed to create the identity from the identity dump\n");
return(-1);
}
ctx->identity->is_dirty = FALSE;
@ -295,7 +295,7 @@ lasso_profile_set_session_from_dump(LassoProfile *ctx,
{
ctx->session = lasso_session_new_from_dump((gchar *)dump);
if (ctx->session == NULL) {
message(G_LOG_LEVEL_ERROR, "Failed to create the session from the session dump\n");
message(G_LOG_LEVEL_WARNING, "Failed to create the session from the session dump\n");
return(-1);
}
ctx->session->is_dirty = FALSE;

View File

@ -422,7 +422,7 @@ lasso_server_new(gchar *metadata,
/* get ProviderID in metadata */
providerID = lasso_node_get_attr_value(md_node, "providerID", &err);
if (providerID == NULL) {
message(G_LOG_LEVEL_ERROR, err->message);
message(G_LOG_LEVEL_WARNING, err->message);
g_error_free(err);
lasso_node_destroy(md_node);
return (NULL);
@ -462,10 +462,15 @@ lasso_server_new_from_dump(gchar *dump)
server_node = lasso_node_new_from_dump(dump);
if (server_node == NULL) {
message(G_LOG_LEVEL_ERROR, "Error while loading server dump\n");
message(G_LOG_LEVEL_WARNING, "Error while loading server dump\n");
return(NULL);
}
server_class = LASSO_NODE_GET_CLASS(server_node);
if (strcmp(server_class->get_name(server_node), LASSO_SERVER_NODE) != 0) {
message(G_LOG_LEVEL_WARNING, "XML is not a server dump\n");
lasso_node_destroy(server_node);
return(NULL);
}
/* providerID */
server->providerID = lasso_node_get_attr_value(server_node, LASSO_SERVER_PROVIDERID_NODE, NULL);

View File

@ -77,13 +77,13 @@ int lasso_init()
/* Init xmlsec library */
if(xmlSecInit() < 0) {
message(G_LOG_LEVEL_ERROR, "XMLSec initialization failed.\n");
message(G_LOG_LEVEL_CRITICAL, "XMLSec initialization failed.\n");
return(-1);
}
/* Check loaded library version */
if(xmlSecCheckVersion() != 1) {
message(G_LOG_LEVEL_ERROR, "Loaded xmlsec library version is not compatible.\n");
message(G_LOG_LEVEL_CRITICAL, "Loaded xmlsec library version is not compatible.\n");
return(-1);
}
@ -94,7 +94,7 @@ int lasso_init()
*/
#ifdef XMLSEC_CRYPTO_DYNAMIC_LOADING
if(xmlSecCryptoDLLoadLibrary(BAD_CAST XMLSEC_CRYPTO) < 0) {
message(G_LOG_LEVEL_ERROR, "Unable to load default xmlsec-crypto library. Make sure\n"
message(G_LOG_LEVEL_CRITICAL, "Unable to load default xmlsec-crypto library. Make sure\n"
"that you have it installed and check shared libraries path\n"
"(LD_LIBRARY_PATH) envornment variable.\n");
return(-1);
@ -103,13 +103,13 @@ int lasso_init()
/* Init crypto library */
if(xmlSecCryptoAppInit(NULL) < 0) {
message(G_LOG_LEVEL_ERROR, "Crypto initialization failed.\n");
message(G_LOG_LEVEL_CRITICAL, "Crypto initialization failed.\n");
return(-1);
}
/* Init xmlsec-crypto library */
if(xmlSecCryptoInit() < 0) {
message(G_LOG_LEVEL_ERROR, "xmlsec-crypto initialization failed.\n");
message(G_LOG_LEVEL_CRITICAL, "xmlsec-crypto initialization failed.\n");
return(-1);
}
return 0;