summaryrefslogtreecommitdiffstats
path: root/server/responder/common
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2009-09-18 12:35:34 +0200
committerStephen Gallagher <sgallagh@redhat.com>2009-09-21 10:35:10 -0400
commit8c50bd085c0efe5fde354deee2c8118887aae29d (patch)
treeb3968a8878c533438aef689b79825915e2720ef2 /server/responder/common
parent9570ca098cd0e92d1eb6aabc00fb8cac9fddd442 (diff)
downloadsssd-8c50bd085c0efe5fde354deee2c8118887aae29d.tar.gz
sssd-8c50bd085c0efe5fde354deee2c8118887aae29d.tar.xz
sssd-8c50bd085c0efe5fde354deee2c8118887aae29d.zip
Use syslog for logging error conditions in SSSD
This is just a band-aid until ELAPI is fully functional and ready to use.
Diffstat (limited to 'server/responder/common')
-rw-r--r--server/responder/common/responder_common.c52
-rw-r--r--server/responder/common/responder_dp.c24
2 files changed, 38 insertions, 38 deletions
diff --git a/server/responder/common/responder_common.c b/server/responder/common/responder_common.c
index 57c8678bf..119a1dd4b 100644
--- a/server/responder/common/responder_common.c
+++ b/server/responder/common/responder_common.c
@@ -72,7 +72,7 @@ static void client_send(struct tevent_context *ev, struct cli_ctx *cctx)
return;
}
if (ret != EOK) {
- DEBUG(0, ("Failed to read request, aborting client!\n"));
+ SYSLOG_ERROR("Failed to read request, aborting client!\n");
talloc_free(cctx);
return;
}
@@ -92,7 +92,7 @@ static void client_recv(struct tevent_context *ev, struct cli_ctx *cctx)
if (!cctx->creq) {
cctx->creq = talloc_zero(cctx, struct cli_request);
if (!cctx->creq) {
- DEBUG(0, ("Failed to alloc request, aborting client!\n"));
+ SYSLOG_ERROR("Failed to alloc request, aborting client!\n");
talloc_free(cctx);
return;
}
@@ -102,7 +102,7 @@ static void client_recv(struct tevent_context *ev, struct cli_ctx *cctx)
ret = sss_packet_new(cctx->creq, SSS_PACKET_MAX_RECV_SIZE,
0, &cctx->creq->in);
if (ret != EOK) {
- DEBUG(0, ("Failed to alloc request, aborting client!\n"));
+ SYSLOG_ERROR("Failed to alloc request, aborting client!\n");
talloc_free(cctx);
return;
}
@@ -116,7 +116,7 @@ static void client_recv(struct tevent_context *ev, struct cli_ctx *cctx)
/* execute command */
ret = sss_cmd_execute(cctx, cctx->rctx->sss_cmds);
if (ret != EOK) {
- DEBUG(0, ("Failed to execute request, aborting client!\n"));
+ SYSLOG_ERROR("Failed to execute request, aborting client!\n");
talloc_free(cctx);
}
/* past this point cctx can be freed at any time by callbacks
@@ -193,7 +193,7 @@ static void accept_priv_fd_handler(struct tevent_context *ev,
if (!cctx) {
struct sockaddr_un addr;
int fd;
- DEBUG(0, ("Out of memory trying to setup client context on privileged pipe!\n"));
+ SYSLOG_ERROR("Out of memory trying to setup client context on privileged pipe!\n");
/* accept and close to signal the client we have a problem */
memset(&addr, 0, sizeof(addr));
len = sizeof(addr);
@@ -246,7 +246,7 @@ static void accept_fd_handler(struct tevent_context *ev,
if (!cctx) {
struct sockaddr_un addr;
int fd;
- DEBUG(0, ("Out of memory trying to setup client context!\n"));
+ SYSLOG_ERROR("Out of memory trying to setup client context!\n");
/* accept and close to signal the client we have a problem */
memset(&addr, 0, sizeof(addr));
len = sizeof(addr);
@@ -295,7 +295,7 @@ static int sss_monitor_init(struct resp_ctx *rctx,
/* Set up SBUS connection to the monitor */
ret = monitor_get_sbus_address(rctx, rctx->cdb, &sbus_address);
if (ret != EOK) {
- DEBUG(0, ("Could not locate monitor address.\n"));
+ SYSLOG_ERROR("Could not locate monitor address.\n");
return ret;
}
@@ -303,14 +303,14 @@ static int sss_monitor_init(struct resp_ctx *rctx,
intf, &rctx->mon_conn,
NULL, NULL);
if (ret != EOK) {
- DEBUG(0, ("Failed to connect to monitor services.\n"));
+ SYSLOG_ERROR("Failed to connect to monitor services.\n");
return ret;
}
/* Identify ourselves to the monitor */
ret = monitor_common_send_id(rctx->mon_conn, svc_name, svc_version);
if (ret != EOK) {
- DEBUG(0, ("Failed to identify to the monitor!\n"));
+ SYSLOG_ERROR("Failed to identify to the monitor!\n");
return ret;
}
@@ -328,7 +328,7 @@ static int sss_dp_init(struct resp_ctx *rctx,
/* Set up SBUS connection to the monitor */
ret = dp_get_sbus_address(rctx, rctx->cdb, &sbus_address);
if (ret != EOK) {
- DEBUG(0, ("Could not locate DP address.\n"));
+ SYSLOG_ERROR("Could not locate DP address.\n");
return ret;
}
@@ -336,7 +336,7 @@ static int sss_dp_init(struct resp_ctx *rctx,
intf, &rctx->dp_conn,
NULL, NULL);
if (ret != EOK) {
- DEBUG(0, ("Failed to connect to monitor services.\n"));
+ SYSLOG_ERROR("Failed to connect to monitor services.\n");
return ret;
}
@@ -345,7 +345,7 @@ static int sss_dp_init(struct resp_ctx *rctx,
cli_type, cli_version,
cli_name, cli_domain);
if (ret != EOK) {
- DEBUG(0, ("Failed to identify to the DP!\n"));
+ SYSLOG_ERROR("Failed to identify to the DP!\n");
return ret;
}
@@ -414,18 +414,18 @@ static int set_unix_socket(struct resp_ctx *rctx)
unlink(rctx->sock_name);
if (bind(rctx->lfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
- DEBUG(0,("Unable to bind on socket '%s'\n", rctx->sock_name));
+ SYSLOG_ERROR("Unable to bind on socket '%s'\n", rctx->sock_name);
goto failed;
}
if (listen(rctx->lfd, 10) != 0) {
- DEBUG(0,("Unable to listen on socket '%s'\n", rctx->sock_name));
+ SYSLOG_ERROR("Unable to listen on socket '%s'\n", rctx->sock_name);
goto failed;
}
rctx->lfde = tevent_add_fd(rctx->ev, rctx, rctx->lfd,
TEVENT_FD_READ, accept_fd_handler, rctx);
if (!rctx->lfde) {
- DEBUG(0, ("Failed to queue handler on pipe\n"));
+ SYSLOG_ERROR("Failed to queue handler on pipe\n");
goto failed;
}
}
@@ -450,18 +450,18 @@ static int set_unix_socket(struct resp_ctx *rctx)
unlink(rctx->priv_sock_name);
if (bind(rctx->priv_lfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
- DEBUG(0,("Unable to bind on socket '%s'\n", rctx->priv_sock_name));
+ SYSLOG_ERROR("Unable to bind on socket '%s'\n", rctx->priv_sock_name);
goto failed;
}
if (listen(rctx->priv_lfd, 10) != 0) {
- DEBUG(0,("Unable to listen on socket '%s'\n", rctx->priv_sock_name));
+ SYSLOG_ERROR("Unable to listen on socket '%s'\n", rctx->priv_sock_name);
goto failed;
}
rctx->priv_lfde = tevent_add_fd(rctx->ev, rctx, rctx->priv_lfd,
TEVENT_FD_READ, accept_priv_fd_handler, rctx);
if (!rctx->priv_lfde) {
- DEBUG(0, ("Failed to queue handler on privileged pipe\n"));
+ SYSLOG_ERROR("Failed to queue handler on privileged pipe\n");
goto failed;
}
}
@@ -500,7 +500,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
rctx = talloc_zero(mem_ctx, struct resp_ctx);
if (!rctx) {
- DEBUG(0, ("fatal error initializing resp_ctx\n"));
+ SYSLOG_ERROR("fatal error initializing resp_ctx\n");
return ENOMEM;
}
rctx->ev = ev;
@@ -512,13 +512,13 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
ret = confdb_get_domains(rctx->cdb, &rctx->domains);
if (ret != EOK) {
- DEBUG(0, ("fatal error setting up domain map\n"));
+ SYSLOG_ERROR("fatal error setting up domain map\n");
return ret;
}
ret = sss_monitor_init(rctx, monitor_intf, svc_name, svc_version);
if (ret != EOK) {
- DEBUG(0, ("fatal error setting up message bus\n"));
+ SYSLOG_ERROR("fatal error setting up message bus\n");
return ret;
}
@@ -526,30 +526,30 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
cli_type, cli_version,
cli_name, cli_domain);
if (ret != EOK) {
- DEBUG(0, ("fatal error setting up backend connector\n"));
+ SYSLOG_ERROR("fatal error setting up backend connector\n");
return ret;
}
else if (!rctx->dp_conn) {
- DEBUG(0, ("Data Provider is not yet available. Retrying.\n"));
+ SYSLOG_ERROR("Data Provider is not yet available. Retrying.\n");
return EIO;
}
ret = sysdb_init(rctx, ev, cdb, NULL, false, &rctx->db_list);
if (ret != EOK) {
- DEBUG(0, ("fatal error initializing resp_ctx\n"));
+ SYSLOG_ERROR("fatal error initializing resp_ctx\n");
return ret;
}
ret = sss_names_init(rctx, rctx->cdb, &rctx->names);
if (ret != EOK) {
- DEBUG(0, ("fatal error initializing regex data\n"));
+ SYSLOG_ERROR("fatal error initializing regex data\n");
return ret;
}
/* after all initializations we are ready to listen on our socket */
ret = set_unix_socket(rctx);
if (ret != EOK) {
- DEBUG(0, ("fatal error initializing socket\n"));
+ SYSLOG_ERROR("fatal error initializing socket\n");
return ret;
}
diff --git a/server/responder/common/responder_dp.c b/server/responder/common/responder_dp.c
index a6365186a..a51fc5e4f 100644
--- a/server/responder/common/responder_dp.c
+++ b/server/responder/common/responder_dp.c
@@ -70,7 +70,7 @@ static int sss_dp_req_destructor(void *ptr)
key.str = sdp_req->key;
int hret = hash_delete(dp_requests, &key);
if (hret != HASH_SUCCESS) {
- DEBUG(0, ("Could not clear entry from request queue\n"));
+ SYSLOG_ERROR("Could not clear entry from request queue\n");
/* This should never happen */
return EIO;
}
@@ -269,7 +269,7 @@ int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *memctx,
/* We have a new request asking for a callback */
sdp_req = talloc_get_type(value.ptr, struct sss_dp_req);
if (!sdp_req) {
- DEBUG(0, ("Could not retrieve DP request context\n"));
+ SYSLOG_ERROR("Could not retrieve DP request context\n");
ret = EIO;
goto done;
}
@@ -303,8 +303,8 @@ int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *memctx,
value.ptr = sdp_req;
hret = hash_enter(dp_requests, &key, &value);
if (hret != HASH_SUCCESS) {
- DEBUG(0, ("Could not store request query (%s)",
- hash_error_string(hret)));
+ SYSLOG_ERROR("Could not store request query (%s)",
+ hash_error_string(hret));
ret = EIO;
goto done;
}
@@ -315,8 +315,8 @@ int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *memctx,
break;
default:
- DEBUG(0,("Could not query request list (%s)\n",
- hash_error_string(hret)));
+ SYSLOG_ERROR("Could not query request list (%s)\n",
+ hash_error_string(hret));
ret = EIO;
goto done;
}
@@ -364,7 +364,7 @@ static int sss_dp_send_acct_req_create(struct resp_ctx *rctx,
DP_CLI_INTERFACE,
DP_SRV_METHOD_GETACCTINFO);
if (msg == NULL) {
- DEBUG(0,("Out of memory?!\n"));
+ SYSLOG_ERROR("Out of memory?!\n");
return ENOMEM;
}
@@ -390,7 +390,7 @@ static int sss_dp_send_acct_req_create(struct resp_ctx *rctx,
* We can't communicate on this connection
* We'll drop it using the default destructor.
*/
- DEBUG(0, ("D-BUS send failed.\n"));
+ SYSLOG_ERROR("D-BUS send failed.\n");
dbus_message_unref(msg);
return EIO;
}
@@ -423,7 +423,7 @@ static int sss_dp_send_acct_req_create(struct resp_ctx *rctx,
sss_dp_send_acct_callback,
sdp_req, NULL);
if (!dbret) {
- DEBUG(0, ("Could not queue up pending request!"));
+ SYSLOG_ERROR("Could not queue up pending request!");
talloc_zfree(sdp_req);
dbus_pending_call_cancel(pending_reply);
dbus_message_unref(msg);
@@ -456,7 +456,7 @@ static int sss_dp_get_reply(DBusPendingCall *pending,
* until reply is valid or timeout has occurred. If reply is NULL
* here, something is seriously wrong and we should bail out.
*/
- DEBUG(0, ("Severe error. A reply callback was called but no reply was received and no timeout occurred\n"));
+ SYSLOG_ERROR("Severe error. A reply callback was called but no reply was received and no timeout occurred\n");
/* FIXME: Destroy this connection ? */
err = EIO;
@@ -490,8 +490,8 @@ static int sss_dp_get_reply(DBusPendingCall *pending,
err = ETIME;
goto done;
}
- DEBUG(0,("The Data Provider returned an error [%s]\n",
- dbus_message_get_error_name(reply)));
+ SYSLOG_ERROR("The Data Provider returned an error [%s]\n",
+ dbus_message_get_error_name(reply));
/* Falling through to default intentionally*/
default:
/*