From 87b8670b2749d02ffdc6c06506ac692b09db5be2 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 22 Sep 2009 13:11:29 -0400 Subject: Revert "Use syslog for logging error conditions in SSSD" This reverts commit 8c50bd085c0efe5fde354deee2c8118887aae29d. Amended: commit 1016af2b1b97ad4290ccce8fa462cc7e3c191b2e also made use of the SYSLOG_ERROR() macro, so those portions of that code also needed to be reverted. --- server/providers/data_provider.c | 64 ++++++++++++++----------------- server/providers/data_provider_be.c | 76 +++++++++++++++++-------------------- server/providers/dp_auth_util.c | 12 +++--- server/providers/krb5/krb5_auth.c | 4 +- server/providers/ldap/ldap_id.c | 4 +- server/providers/ldap/sdap.c | 66 ++++++++++++++++---------------- server/providers/ldap/sdap_async.c | 6 +-- server/providers/proxy.c | 24 ++++++------ 8 files changed, 121 insertions(+), 135 deletions(-) (limited to 'server/providers') diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c index f4affd1ad..f8efcc8d8 100644 --- a/server/providers/data_provider.c +++ b/server/providers/data_provider.c @@ -43,8 +43,6 @@ #define DP_CONF_ENTRY "config/services/dp" -#define PRG_NAME "sssd" - struct dp_backend; struct dp_frontend; @@ -153,7 +151,7 @@ static int dp_monitor_init(struct dp_ctx *dpctx) /* Set up SBUS connection to the monitor */ ret = monitor_get_sbus_address(dpctx, dpctx->cdb, &sbus_address); if (ret != EOK) { - SYSLOG_ERROR("Could not locate monitor address.\n"); + DEBUG(0, ("Could not locate monitor address.\n")); return ret; } @@ -161,7 +159,7 @@ static int dp_monitor_init(struct dp_ctx *dpctx) &monitor_dp_interface, &conn, NULL, NULL); if (ret != EOK) { - SYSLOG_ERROR("Failed to connect to monitor services.\n"); + DEBUG(0, ("Failed to connect to monitor services.\n")); return ret; } @@ -170,7 +168,7 @@ static int dp_monitor_init(struct dp_ctx *dpctx) DATA_PROVIDER_SERVICE_NAME, DATA_PROVIDER_VERSION); if (ret != EOK) { - SYSLOG_ERROR("Failed to identify to the monitor!\n"); + DEBUG(0, ("Failed to identify to the monitor!\n")); return ret; } @@ -204,7 +202,7 @@ static int dp_client_init(struct sbus_connection *conn, void *data) dpcli = talloc(conn, struct dp_client); if (!dpcli) { - SYSLOG_ERROR("Out of memory?!\n"); + DEBUG(0,("Out of memory?!\n")); talloc_zfree(conn); return ENOMEM; } @@ -218,7 +216,7 @@ static int dp_client_init(struct sbus_connection *conn, void *data) dpcli->timeout = tevent_add_timer(dpctx->ev, dpcli, tv, init_timeout, dpcli); if (!dpcli->timeout) { - SYSLOG_ERROR("Out of memory?!\n"); + DEBUG(0,("Out of memory?!\n")); talloc_zfree(conn); return ENOMEM; } @@ -250,7 +248,7 @@ static int client_registration(DBusMessage *message, data = sbus_conn_get_private_data(conn); dpcli = talloc_get_type(data, struct dp_client); if (!dpcli) { - SYSLOG_ERROR("Connection holds no valid init data\n"); + DEBUG(0, ("Connection holds no valid init data\n")); return EINVAL; } @@ -278,14 +276,14 @@ static int client_registration(DBusMessage *message, case DP_CLI_BACKEND: dpbe = talloc_zero(dpcli->dpctx, struct dp_backend); if (!dpbe) { - SYSLOG_ERROR("Out of memory!\n"); + DEBUG(0, ("Out of memory!\n")); sbus_disconnect(conn); return ENOMEM; } dpbe->domain = talloc_strdup(dpbe, cli_domain); if (!dpbe->domain) { - SYSLOG_ERROR("Out of memory!\n"); + DEBUG(0, ("Out of memory!\n")); sbus_disconnect(conn); return ENOMEM; } @@ -302,14 +300,14 @@ static int client_registration(DBusMessage *message, case DP_CLI_FRONTEND: dpfe = talloc_zero(dpcli->dpctx, struct dp_frontend); if (!dpfe) { - SYSLOG_ERROR("Out of memory!\n"); + DEBUG(0, ("Out of memory!\n")); sbus_disconnect(conn); return ENOMEM; } dpfe->name = talloc_strdup(dpfe, cli_name); if (!dpfe->name) { - SYSLOG_ERROR("Out of memory!\n"); + DEBUG(0, ("Out of memory!\n")); sbus_disconnect(conn); return ENOMEM; } @@ -332,7 +330,7 @@ static int client_registration(DBusMessage *message, /* reply that all is ok */ reply = dbus_message_new_method_return(message); if (!reply) { - SYSLOG_ERROR("Dbus Out of memory!\n"); + DEBUG(0, ("Dbus Out of memory!\n")); return ENOMEM; } @@ -340,7 +338,7 @@ static int client_registration(DBusMessage *message, DBUS_TYPE_UINT16, &version, DBUS_TYPE_INVALID); if (!dbret) { - SYSLOG_ERROR("Failed to build dbus reply\n"); + DEBUG(0, ("Failed to build dbus reply\n")); dbus_message_unref(reply); sbus_disconnect(conn); return EIO; @@ -375,7 +373,7 @@ static void be_got_account_info(DBusPendingCall *pending, void *data) * until reply is valid or timeout has occurred. If reply is NULL * here, something is seriously wrong and we should bail out. */ - SYSLOG_ERROR("Severe error. A reply callback was called but no reply was received and no timeout occurred\n"); + DEBUG(0, ("Severe error. A reply callback was called but no reply was received and no timeout occurred\n")); /* Destroy this connection */ sbus_disconnect(bereq->be->dpcli->conn); @@ -404,8 +402,8 @@ static void be_got_account_info(DBusPendingCall *pending, void *data) break; case DBUS_MESSAGE_TYPE_ERROR: - SYSLOG_ERROR("The Data Provider returned an error [%s], closing connection.\n", - dbus_message_get_error_name(reply)); + DEBUG(0,("The Data Provider returned an error [%s], closing connection.\n", + dbus_message_get_error_name(reply))); /* Falling through to default intentionally*/ default: /* @@ -470,7 +468,7 @@ static int dp_send_acct_req(struct dp_be_request *bereq, DP_CLI_INTERFACE, DP_CLI_METHOD_GETACCTINFO); if (msg == NULL) { - SYSLOG_ERROR("Out of memory?!\n"); + DEBUG(0,("Out of memory?!\n")); return ENOMEM; } @@ -494,7 +492,7 @@ static int dp_send_acct_req(struct dp_be_request *bereq, * We can't communicate on this connection * We'll drop it using the default destructor. */ - SYSLOG_ERROR("D-BUS send failed.\n"); + DEBUG(0, ("D-BUS send failed.\n")); dbus_message_unref(msg); return EIO; } @@ -690,7 +688,7 @@ static void be_got_pam_reply(DBusPendingCall *pending, void *data) * until reply is valid or timeout has occurred. If reply is NULL * here, something is seriously wrong and we should bail out. */ - SYSLOG_ERROR("Severe error. A reply callback was called but no reply was received and no timeout occurred\n"); + DEBUG(0, ("Severe error. A reply callback was called but no reply was received and no timeout occurred\n")); /* Destroy this connection */ sbus_disconnect(bereq->be->dpcli->conn); @@ -717,8 +715,8 @@ static void be_got_pam_reply(DBusPendingCall *pending, void *data) break; case DBUS_MESSAGE_TYPE_ERROR: - SYSLOG_ERROR("The Data Provider returned an error [%s], closing connection.\n", - dbus_message_get_error_name(reply)); + DEBUG(0,("The Data Provider returned an error [%s], closing connection.\n", + dbus_message_get_error_name(reply))); /* Falling through to default intentionally*/ default: /* @@ -767,7 +765,7 @@ static int dp_call_pamhandler(struct dp_be_request *bereq, struct pam_data *pd) DP_CLI_INTERFACE, DP_CLI_METHOD_PAMHANDLER); if (msg == NULL) { - SYSLOG_ERROR("Out of memory?!\n"); + DEBUG(0,("Out of memory?!\n")); return ENOMEM; } @@ -788,7 +786,7 @@ static int dp_call_pamhandler(struct dp_be_request *bereq, struct pam_data *pd) * We can't communicate on this connection * We'll drop it using the default destructor. */ - SYSLOG_ERROR("D-BUS send failed.\n"); + DEBUG(0, ("D-BUS send failed.\n")); dbus_message_unref(msg); return EIO; } @@ -829,7 +827,7 @@ static int dp_pamhandler(DBusMessage *message, struct sbus_connection *conn) ret = dp_unpack_pam_request(message, pd, &dbus_error); if (!ret) { - SYSLOG_ERROR("Failed, to parse message!\n"); + DEBUG(0,("Failed, to parse message!\n")); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); talloc_free(pd); return EIO; @@ -840,7 +838,7 @@ static int dp_pamhandler(DBusMessage *message, struct sbus_connection *conn) reply = dbus_message_new_method_return(message); if (!reply) { - SYSLOG_ERROR("Out of memory?!\n"); + DEBUG(0,("Out of memory?!\n")); talloc_free(pd); return ENOMEM; } @@ -966,7 +964,7 @@ static int dp_process_init(TALLOC_CTX *mem_ctx, dpctx = talloc_zero(mem_ctx, struct dp_ctx); if (!dpctx) { - SYSLOG_ERROR("fatal error initializing dp_ctx\n"); + DEBUG(0, ("fatal error initializing dp_ctx\n")); return ENOMEM; } dpctx->ev = ev; @@ -974,13 +972,13 @@ static int dp_process_init(TALLOC_CTX *mem_ctx, ret = dp_monitor_init(dpctx); if (ret != EOK) { - SYSLOG_ERROR("fatal error setting up monitor bus\n"); + DEBUG(0, ("fatal error setting up monitor bus\n")); return ret; } ret = dp_srv_init(dpctx); if (ret != EOK) { - SYSLOG_ERROR("fatal error setting up server bus\n"); + DEBUG(0, ("fatal error setting up server bus\n")); return ret; } @@ -1013,11 +1011,8 @@ int main(int argc, const char *argv[]) poptFreeContext(pc); - /* enable syslog logging */ - openlog(PRG_NAME, LOG_PID, LOG_DAEMON); - /* set up things like debug , signals, daemonization, etc... */ - ret = server_setup(PRG_NAME, 0, DP_CONF_ENTRY, &main_ctx); + ret = server_setup("sssd[dp]", 0, DP_CONF_ENTRY, &main_ctx); if (ret != EOK) return 2; ret = die_if_parent_died(); @@ -1034,9 +1029,6 @@ int main(int argc, const char *argv[]) /* loop on main */ server_loop(main_ctx); - /* close syslog */ - closelog(); - return 0; } diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c index b8630e6af..2e83ab6e9 100644 --- a/server/providers/data_provider_be.c +++ b/server/providers/data_provider_be.c @@ -516,7 +516,7 @@ static int mon_cli_init(struct be_ctx *ctx) /* Set up SBUS connection to the monitor */ ret = monitor_get_sbus_address(ctx, ctx->cdb, &sbus_address); if (ret != EOK) { - SYSLOG_ERROR("Could not locate monitor address.\n"); + DEBUG(0, ("Could not locate monitor address.\n")); return ret; } @@ -524,7 +524,7 @@ static int mon_cli_init(struct be_ctx *ctx) &monitor_be_interface, &ctx->mon_conn, NULL, ctx); if (ret != EOK) { - SYSLOG_ERROR("Failed to connect to monitor services.\n"); + DEBUG(0, ("Failed to connect to monitor services.\n")); return ret; } @@ -533,7 +533,7 @@ static int mon_cli_init(struct be_ctx *ctx) ctx->identity, DATA_PROVIDER_VERSION); if (ret != EOK) { - SYSLOG_ERROR("Failed to identify to the monitor!\n"); + DEBUG(0, ("Failed to identify to the monitor!\n")); return ret; } @@ -552,7 +552,7 @@ static int be_cli_init(struct be_ctx *ctx) /* Set up SBUS connection to the monitor */ ret = dp_get_sbus_address(ctx, ctx->cdb, &sbus_address); if (ret != EOK) { - SYSLOG_ERROR("Could not locate monitor address.\n"); + DEBUG(0, ("Could not locate monitor address.\n")); return ret; } @@ -560,7 +560,7 @@ static int be_cli_init(struct be_ctx *ctx) &be_interface, &ctx->dp_conn, NULL, ctx); if (ret != EOK) { - SYSLOG_ERROR("Failed to connect to monitor services.\n"); + DEBUG(0, ("Failed to connect to monitor services.\n")); return ret; } @@ -569,7 +569,7 @@ static int be_cli_init(struct be_ctx *ctx) DP_CLI_BACKEND, DATA_PROVIDER_VERSION, "", ctx->domain->name); if (ret != EOK) { - SYSLOG_ERROR("Failed to identify to the data provider!\n"); + DEBUG(0, ("Failed to identify to the data provider!\n")); return ret; } @@ -577,7 +577,7 @@ static int be_cli_init(struct be_ctx *ctx) ret = confdb_get_int(ctx->cdb, ctx, SERVICE_CONF_ENTRY, "reconnection_retries", 3, &max_retries); if (ret != EOK) { - SYSLOG_ERROR("Failed to set up automatic reconnection\n"); + DEBUG(0, ("Failed to set up automatic reconnection\n")); return ret; } @@ -604,20 +604,20 @@ static void be_cli_reconnect_init(struct sbus_connection *conn, int status, void DP_CLI_BACKEND, DATA_PROVIDER_VERSION, "", be_ctx->domain->name); if (ret != EOK) { - SYSLOG_ERROR("Failed to send id to the data provider!\n"); + DEBUG(0, ("Failed to send id to the data provider!\n")); } else { return; } } /* Handle failure */ - SYSLOG_ERROR("Could not reconnect to data provider.\n"); + DEBUG(0, ("Could not reconnect to data provider.\n")); /* Kill the backend and let the monitor restart it */ ret = be_finalize(be_ctx); if (ret != EOK) { - SYSLOG_ERROR("Finalizing back-end failed with error [%d] [%s]\n", - ret, strerror(ret)); + DEBUG(0, ("Finalizing back-end failed with error [%d] [%s]\n", + ret, strerror(ret))); be_shutdown(NULL, ret, NULL); } } @@ -629,8 +629,8 @@ static void be_shutdown(struct be_req *req, int status, const char *errstr) exit(0); /* Something went wrong in finalize */ - SYSLOG_ERROR("Finalizing auth module failed with error [%d] [%s]\n", - status, errstr ? : strerror(status)); + DEBUG(0, ("Finalizing auth module failed with error [%d] [%s]\n", + status, errstr ? : strerror(status))); exit(1); } @@ -643,8 +643,8 @@ static void be_id_shutdown(struct be_req *req, int status, const char *errstr) if (status != EOK) { /* Something went wrong in finalize */ - SYSLOG_ERROR("Finalizing auth module failed with error [%d] [%s]\n", - status, errstr ? : strerror(status)); + DEBUG(0, ("Finalizing auth module failed with error [%d] [%s]\n", + status, errstr ? : strerror(status))); } ctx = req->be_ctx; @@ -690,7 +690,7 @@ static int be_finalize(struct be_ctx *ctx) fail: /* If we got here, we couldn't shut down cleanly. */ - SYSLOG_ERROR("ERROR: could not shut down cleanly.\n"); + DEBUG(0, ("ERROR: could not shut down cleanly.\n")); return ret; } @@ -784,8 +784,8 @@ static int load_backend_module(struct be_ctx *ctx, DEBUG(7, ("Loading backend [%s] with path [%s].\n", mod_name, path)); handle = dlopen(path, RTLD_NOW); if (!handle) { - SYSLOG_ERROR("Unable to load %s module with path (%s), error: %s\n", - mod_name, path, dlerror()); + DEBUG(0, ("Unable to load %s module with path (%s), error: %s\n", + mod_name, path, dlerror())); ret = ELIBACC; goto done; } @@ -797,16 +797,16 @@ static int load_backend_module(struct be_ctx *ctx, mod_init_fn = (bet_init_fn_t)dlsym(ctx->loaded_be[lb].handle, mod_init_fn_name); if (mod_init_fn == NULL) { - SYSLOG_ERROR("Unable to load init fn %s from module %s, error: %s\n", - mod_init_fn_name, mod_name, dlerror()); + DEBUG(0, ("Unable to load init fn %s from module %s, error: %s\n", + mod_init_fn_name, mod_name, dlerror())); ret = ELIBBAD; goto done; } ret = mod_init_fn(ctx, be_ops, be_pvt_data); if (ret != EOK) { - SYSLOG_ERROR("Error (%d) in module (%s) initialization (%s)!\n", - ret, mod_name, mod_init_fn_name); + DEBUG(0, ("Error (%d) in module (%s) initialization (%s)!\n", + ret, mod_name, mod_init_fn_name)); goto done; } @@ -877,7 +877,7 @@ int be_process_init(TALLOC_CTX *mem_ctx, ctx = talloc_zero(mem_ctx, struct be_ctx); if (!ctx) { - SYSLOG_ERROR("fatal error initializing be_ctx\n"); + DEBUG(0, ("fatal error initializing be_ctx\n")); return ENOMEM; } ctx->ev = ev; @@ -885,37 +885,37 @@ int be_process_init(TALLOC_CTX *mem_ctx, ctx->identity = talloc_asprintf(ctx, "%%BE_%s", be_domain); ctx->conf_path = talloc_asprintf(ctx, "config/domains/%s", be_domain); if (!ctx->identity || !ctx->conf_path) { - SYSLOG_ERROR("Out of memory!?\n"); + DEBUG(0, ("Out of memory!?\n")); return ENOMEM; } ret = confdb_get_domain(cdb, be_domain, &ctx->domain); if (ret != EOK) { - SYSLOG_ERROR("fatal error retrieving domain configuration\n"); + DEBUG(0, ("fatal error retrieving domain configuration\n")); return ret; } ret = sysdb_domain_init(ctx, ev, ctx->domain, DB_PATH, &ctx->sysdb); if (ret != EOK) { - SYSLOG_ERROR("fatal error opening cache database\n"); + DEBUG(0, ("fatal error opening cache database\n")); return ret; } ret = mon_cli_init(ctx); if (ret != EOK) { - SYSLOG_ERROR("fatal error setting up monitor bus\n"); + DEBUG(0, ("fatal error setting up monitor bus\n")); return ret; } ret = be_cli_init(ctx); if (ret != EOK) { - SYSLOG_ERROR("fatal error setting up server bus\n"); + DEBUG(0, ("fatal error setting up server bus\n")); return ret; } ret = be_rewrite(ctx); if (ret != EOK) { - SYSLOG_ERROR("error rewriting provider types\n"); + DEBUG(0, ("error rewriting provider types\n")); return ret; } @@ -923,7 +923,7 @@ int be_process_init(TALLOC_CTX *mem_ctx, &ctx->bet_info[BET_ID].bet_ops, &ctx->bet_info[BET_ID].pvt_bet_data); if (ret != EOK) { - SYSLOG_ERROR("fatal error initializing data providers\n"); + DEBUG(0, ("fatal error initializing data providers\n")); return ret; } @@ -932,7 +932,7 @@ int be_process_init(TALLOC_CTX *mem_ctx, &ctx->bet_info[BET_AUTH].pvt_bet_data); if (ret != EOK) { if (ret != ENOENT) { - SYSLOG_ERROR("fatal error initializing data providers\n"); + DEBUG(0, ("fatal error initializing data providers\n")); return ret; } DEBUG(1, ("No authentication module provided for [%s] !!\n", @@ -944,7 +944,7 @@ int be_process_init(TALLOC_CTX *mem_ctx, &ctx->bet_info[BET_ACCESS].pvt_bet_data); if (ret != EOK) { if (ret != ENOENT) { - SYSLOG_ERROR("fatal error initializing data providers\n"); + DEBUG(0, ("fatal error initializing data providers\n")); return ret; } DEBUG(1, ("No access control module provided for [%s] " @@ -958,7 +958,7 @@ int be_process_init(TALLOC_CTX *mem_ctx, &ctx->bet_info[BET_CHPASS].pvt_bet_data); if (ret != EOK) { if (ret != ENOENT) { - SYSLOG_ERROR("fatal error initializing data providers\n"); + DEBUG(0, ("fatal error initializing data providers\n")); return ret; } DEBUG(1, ("No change password module provided for [%s] !!\n", @@ -1012,12 +1012,9 @@ int main(int argc, const char *argv[]) conf_entry = talloc_asprintf(NULL, BE_CONF_ENTRY, be_domain); if (!conf_entry) return 2; - /* enable syslog logging */ - openlog(srv_name, LOG_PID, LOG_DAEMON); - ret = server_setup(srv_name, 0, conf_entry, &main_ctx); if (ret != EOK) { - SYSLOG_ERROR("Could not set up mainloop [%d]\n", ret); + DEBUG(0, ("Could not set up mainloop [%d]\n", ret)); return 2; } @@ -1032,7 +1029,7 @@ int main(int argc, const char *argv[]) main_ctx->event_ctx, main_ctx->confdb_ctx); if (ret != EOK) { - SYSLOG_ERROR("Could not initialize backend [%d]\n", ret); + DEBUG(0, ("Could not initialize backend [%d]\n", ret)); return 3; } @@ -1041,9 +1038,6 @@ int main(int argc, const char *argv[]) /* loop on main */ server_loop(main_ctx); - /* close syslog */ - closelog(); - return 0; } diff --git a/server/providers/dp_auth_util.c b/server/providers/dp_auth_util.c index 8bfa08490..80e9f167f 100644 --- a/server/providers/dp_auth_util.c +++ b/server/providers/dp_auth_util.c @@ -241,8 +241,8 @@ static void id_callback(DBusPendingCall *pending, void *ptr) * until reply is valid or timeout has occurred. If reply is NULL * here, something is seriously wrong and we should bail out. */ - SYSLOG_ERROR("Severe error. A reply callback was called but no" - " reply was received and no timeout occurred\n"); + DEBUG(0, ("Severe error. A reply callback was called but no" + " reply was received and no timeout occurred\n")); /* FIXME: Destroy this connection ? */ goto done; @@ -266,8 +266,8 @@ static void id_callback(DBusPendingCall *pending, void *ptr) break; case DBUS_MESSAGE_TYPE_ERROR: - SYSLOG_ERROR("The Monitor returned an error [%s]\n", - dbus_message_get_error_name(reply)); + DEBUG(0,("The Monitor returned an error [%s]\n", + dbus_message_get_error_name(reply))); /* Falling through to default intentionally*/ default: /* @@ -304,7 +304,7 @@ int dp_common_send_id(struct sbus_connection *conn, DP_SRV_INTERFACE, DP_SRV_METHOD_REGISTER); if (msg == NULL) { - SYSLOG_ERROR("Out of memory?!\n"); + DEBUG(0, ("Out of memory?!\n")); return ENOMEM; } @@ -330,7 +330,7 @@ int dp_common_send_id(struct sbus_connection *conn, * We can't communicate on this connection * We'll drop it using the default destructor. */ - SYSLOG_ERROR("D-BUS send failed.\n"); + DEBUG(0, ("D-BUS send failed.\n")); dbus_message_unref(msg); return EIO; } diff --git a/server/providers/krb5/krb5_auth.c b/server/providers/krb5/krb5_auth.c index 0eac91f5d..03e790322 100644 --- a/server/providers/krb5/krb5_auth.c +++ b/server/providers/krb5/krb5_auth.c @@ -793,11 +793,11 @@ static void krb5_pam_handler_done(struct tevent_req *req) } break; default: - SYSLOG_ERROR("unsupported PAM command [%d].\n", pd->cmd); + DEBUG(0, ("unsupported PAM command [%d].\n", pd->cmd)); } if (password == NULL) { - SYSLOG_ERROR("password not available, offline auth may not work.\n"); + DEBUG(0, ("password not available, offline auth may not work.\n")); goto done; } diff --git a/server/providers/ldap/ldap_id.c b/server/providers/ldap/ldap_id.c index bd376f7cb..72caf9664 100644 --- a/server/providers/ldap/ldap_id.c +++ b/server/providers/ldap/ldap_id.c @@ -873,7 +873,7 @@ static void ldap_id_enumerate_set_timer(struct sdap_id_ctx *ctx, tv = tevent_timeval_add(&tv, ert, 0); enum_task = tevent_add_timer(ctx->be->ev, ctx, tv, ldap_id_enumerate, ctx); if (!enum_task) { - SYSLOG_ERROR("FATAL: failed to setup enumeration task!\n"); + DEBUG(0, ("FATAL: failed to setup enumeration task!\n")); /* shutdown! */ exit(1); } @@ -1354,7 +1354,7 @@ int sssm_ldap_init(struct be_ctx *bectx, enum_task = tevent_add_timer(ctx->be->ev, ctx, ctx->last_run, ldap_id_enumerate, ctx); if (!enum_task) { - SYSLOG_ERROR("FATAL: failed to setup enumeration task!\n"); + DEBUG(0, ("FATAL: failed to setup enumeration task!\n")); ret = EFAULT; goto done; } diff --git a/server/providers/ldap/sdap.c b/server/providers/ldap/sdap.c index 7edcc3d88..22d238e65 100644 --- a/server/providers/ldap/sdap.c +++ b/server/providers/ldap/sdap.c @@ -148,8 +148,8 @@ int sdap_get_options(TALLOC_CTX *memctx, if (ret != EOK || ((opts->basic[i].def_val.string != NULL) && (opts->basic[i].val.string == NULL))) { - SYSLOG_ERROR("Failed to retrieve value for option (%s)\n", - opts->basic[i].opt_name); + DEBUG(0, ("Failed to retrieve value for option (%s)\n", + opts->basic[i].opt_name)); if (ret == EOK) ret = EINVAL; goto done; } @@ -162,8 +162,8 @@ int sdap_get_options(TALLOC_CTX *memctx, opts->basic[i].opt_name, NULL, &tmp); if (ret != EOK) { - SYSLOG_ERROR("Failed to retrieve value for option (%s)\n", - opts->basic[i].opt_name); + DEBUG(0, ("Failed to retrieve value for option (%s)\n", + opts->basic[i].opt_name)); goto done; } @@ -186,8 +186,8 @@ int sdap_get_options(TALLOC_CTX *memctx, opts->basic[i].def_val.number, &opts->basic[i].val.number); if (ret != EOK) { - SYSLOG_ERROR("Failed to retrieve value for option (%s)\n", - opts->basic[i].opt_name); + DEBUG(0, ("Failed to retrieve value for option (%s)\n", + opts->basic[i].opt_name)); goto done; } DEBUG(6, ("Option %s has value %d\n", @@ -200,8 +200,8 @@ int sdap_get_options(TALLOC_CTX *memctx, opts->basic[i].def_val.boolean, &opts->basic[i].val.boolean); if (ret != EOK) { - SYSLOG_ERROR("Failed to retrieve value for option (%s)\n", - opts->basic[i].opt_name); + DEBUG(0, ("Failed to retrieve value for option (%s)\n", + opts->basic[i].opt_name)); goto done; } DEBUG(6, ("Option %s is %s\n", @@ -223,7 +223,7 @@ int sdap_get_options(TALLOC_CTX *memctx, default_user_map = rfc2307bis_user_map; default_group_map = rfc2307bis_group_map; } else { - SYSLOG_ERROR("Unrecognized schema type: %s\n", schema); + DEBUG(0, ("Unrecognized schema type: %s\n", schema)); ret = EINVAL; goto done; } @@ -240,8 +240,8 @@ int sdap_get_options(TALLOC_CTX *memctx, &opts->user_map[i].name); if (ret != EOK || (opts->user_map[i].def_name && !opts->user_map[i].name)) { - SYSLOG_ERROR("Failed to retrieve a value (%s)\n", - opts->user_map[i].opt_name); + DEBUG(0, ("Failed to retrieve a value (%s)\n", + opts->user_map[i].opt_name)); if (ret != EOK) ret = EINVAL; goto done; } @@ -262,8 +262,8 @@ int sdap_get_options(TALLOC_CTX *memctx, &opts->group_map[i].name); if (ret != EOK || (opts->group_map[i].def_name && !opts->group_map[i].name)) { - SYSLOG_ERROR("Failed to retrieve a value (%s)\n", - opts->group_map[i].opt_name); + DEBUG(0, ("Failed to retrieve a value (%s)\n", + opts->group_map[i].opt_name)); if (ret != EOK) ret = EINVAL; goto done; } @@ -301,10 +301,10 @@ const char *_sdap_go_get_cstring(struct sdap_gen_opts *opts, int id, const char *location) { if (opts[id].type != SDAP_STRING) { - SYSLOG_ERROR("[%s] Requested type 'String' for option '%s'" - " but value is of type '%s'!\n", - location, opts[id].opt_name, - sdap_type_to_string(opts[id].type)); + DEBUG(0, ("[%s] Requested type 'String' for option '%s'" + " but value is of type '%s'!\n", + location, opts[id].opt_name, + sdap_type_to_string(opts[id].type))); return NULL; } return opts[id].val.cstring; @@ -314,10 +314,10 @@ char *_sdap_go_get_string(struct sdap_gen_opts *opts, int id, const char *location) { if (opts[id].type != SDAP_STRING) { - SYSLOG_ERROR("[%s] Requested type 'String' for option '%s'" - " but value is of type '%s'!\n", - location, opts[id].opt_name, - sdap_type_to_string(opts[id].type)); + DEBUG(0, ("[%s] Requested type 'String' for option '%s'" + " but value is of type '%s'!\n", + location, opts[id].opt_name, + sdap_type_to_string(opts[id].type))); return NULL; } return opts[id].val.string; @@ -328,10 +328,10 @@ struct sdap_blob _sdap_go_get_blob(struct sdap_gen_opts *opts, { struct sdap_blob null_blob = { NULL, 0 }; if (opts[id].type != SDAP_BLOB) { - SYSLOG_ERROR("[%s] Requested type 'Blob' for option '%s'" - " but value is of type '%s'!\n", - location, opts[id].opt_name, - sdap_type_to_string(opts[id].type)); + DEBUG(0, ("[%s] Requested type 'Blob' for option '%s'" + " but value is of type '%s'!\n", + location, opts[id].opt_name, + sdap_type_to_string(opts[id].type))); return null_blob; } return opts[id].val.blob; @@ -341,10 +341,10 @@ int _sdap_go_get_int(struct sdap_gen_opts *opts, int id, const char *location) { if (opts[id].type != SDAP_NUMBER) { - SYSLOG_ERROR("[%s] Requested type 'Number' for option '%s'" - " but value is of type '%s'!\n", - location, opts[id].opt_name, - sdap_type_to_string(opts[id].type)); + DEBUG(0, ("[%s] Requested type 'Number' for option '%s'" + " but value is of type '%s'!\n", + location, opts[id].opt_name, + sdap_type_to_string(opts[id].type))); return 0; } return opts[id].val.number; @@ -354,10 +354,10 @@ bool _sdap_go_get_bool(struct sdap_gen_opts *opts, int id, const char *location) { if (opts[id].type != SDAP_BOOL) { - SYSLOG_ERROR("[%s] Requested type 'Boolean' for option '%s'" - " but value is of type '%s'!\n", - location, opts[id].opt_name, - sdap_type_to_string(opts[id].type)); + DEBUG(0, ("[%s] Requested type 'Boolean' for option '%s'" + " but value is of type '%s'!\n", + location, opts[id].opt_name, + sdap_type_to_string(opts[id].type))); return false; } return opts[id].val.boolean; diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c index f50750a20..6ab88679f 100644 --- a/server/providers/ldap/sdap_async.c +++ b/server/providers/ldap/sdap_async.c @@ -1350,7 +1350,7 @@ static struct tevent_req *sdap_save_group_send(TALLOC_CTX *memctx, continue; } if (mu > mg) { /* shouldn't be possible */ - SYSLOG_ERROR("Fatal Internal error: aborting\n"); + DEBUG(0, ("Fatal Internal error: aborting\n")); ret = EFAULT; goto fail; } @@ -1369,8 +1369,8 @@ static struct tevent_req *sdap_save_group_send(TALLOC_CTX *memctx, break; default: - SYSLOG_ERROR("FATAL ERROR: Unhandled schema type! (%d)\n", - opts->schema_type); + DEBUG(0, ("FATAL ERROR: Unhandled schema type! (%d)\n", + opts->schema_type)); ret = EFAULT; goto fail; } diff --git a/server/providers/proxy.c b/server/providers/proxy.c index 22717e861..80a2a5500 100644 --- a/server/providers/proxy.c +++ b/server/providers/proxy.c @@ -2227,78 +2227,78 @@ int sssm_proxy_init(struct be_ctx *bectx, handle = dlopen(libpath, RTLD_NOW); if (!handle) { - SYSLOG_ERROR("Unable to load %s module with path, error: %s\n", - libpath, dlerror()); + DEBUG(0, ("Unable to load %s module with path, error: %s\n", + libpath, dlerror())); ret = ELIBACC; goto done; } ctx->ops.getpwnam_r = proxy_dlsym(handle, "_nss_%s_getpwnam_r", libname); if (!ctx->ops.getpwnam_r) { - SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); + DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); ret = ELIBBAD; goto done; } ctx->ops.getpwuid_r = proxy_dlsym(handle, "_nss_%s_getpwuid_r", libname); if (!ctx->ops.getpwuid_r) { - SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); + DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); ret = ELIBBAD; goto done; } ctx->ops.setpwent = proxy_dlsym(handle, "_nss_%s_setpwent", libname); if (!ctx->ops.setpwent) { - SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); + DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); ret = ELIBBAD; goto done; } ctx->ops.getpwent_r = proxy_dlsym(handle, "_nss_%s_getpwent_r", libname); if (!ctx->ops.getpwent_r) { - SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); + DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); ret = ELIBBAD; goto done; } ctx->ops.endpwent = proxy_dlsym(handle, "_nss_%s_endpwent", libname); if (!ctx->ops.endpwent) { - SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); + DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); ret = ELIBBAD; goto done; } ctx->ops.getgrnam_r = proxy_dlsym(handle, "_nss_%s_getgrnam_r", libname); if (!ctx->ops.getgrnam_r) { - SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); + DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); ret = ELIBBAD; goto done; } ctx->ops.getgrgid_r = proxy_dlsym(handle, "_nss_%s_getgrgid_r", libname); if (!ctx->ops.getgrgid_r) { - SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); + DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); ret = ELIBBAD; goto done; } ctx->ops.setgrent = proxy_dlsym(handle, "_nss_%s_setgrent", libname); if (!ctx->ops.setgrent) { - SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); + DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); ret = ELIBBAD; goto done; } ctx->ops.getgrent_r = proxy_dlsym(handle, "_nss_%s_getgrent_r", libname); if (!ctx->ops.getgrent_r) { - SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); + DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); ret = ELIBBAD; goto done; } ctx->ops.endgrent = proxy_dlsym(handle, "_nss_%s_endgrent", libname); if (!ctx->ops.endgrent) { - SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); + DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); ret = ELIBBAD; goto done; } -- cgit