diff options
Diffstat (limited to 'server/providers')
-rw-r--r-- | server/providers/data_provider.c | 64 | ||||
-rw-r--r-- | server/providers/data_provider_be.c | 76 | ||||
-rw-r--r-- | server/providers/dp_auth_util.c | 12 | ||||
-rw-r--r-- | server/providers/krb5/krb5_auth.c | 4 | ||||
-rw-r--r-- | server/providers/ldap/ldap_id.c | 4 | ||||
-rw-r--r-- | server/providers/ldap/sdap.c | 66 | ||||
-rw-r--r-- | server/providers/ldap/sdap_async.c | 6 | ||||
-rw-r--r-- | server/providers/proxy.c | 24 |
8 files changed, 135 insertions, 121 deletions
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c index f8efcc8d..f4affd1a 100644 --- a/server/providers/data_provider.c +++ b/server/providers/data_provider.c @@ -43,6 +43,8 @@ #define DP_CONF_ENTRY "config/services/dp" +#define PRG_NAME "sssd" + struct dp_backend; struct dp_frontend; @@ -151,7 +153,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) { - DEBUG(0, ("Could not locate monitor address.\n")); + SYSLOG_ERROR("Could not locate monitor address.\n"); return ret; } @@ -159,7 +161,7 @@ static int dp_monitor_init(struct dp_ctx *dpctx) &monitor_dp_interface, &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; } @@ -168,7 +170,7 @@ static int dp_monitor_init(struct dp_ctx *dpctx) DATA_PROVIDER_SERVICE_NAME, DATA_PROVIDER_VERSION); if (ret != EOK) { - DEBUG(0, ("Failed to identify to the monitor!\n")); + SYSLOG_ERROR("Failed to identify to the monitor!\n"); return ret; } @@ -202,7 +204,7 @@ static int dp_client_init(struct sbus_connection *conn, void *data) dpcli = talloc(conn, struct dp_client); if (!dpcli) { - DEBUG(0,("Out of memory?!\n")); + SYSLOG_ERROR("Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } @@ -216,7 +218,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) { - DEBUG(0,("Out of memory?!\n")); + SYSLOG_ERROR("Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } @@ -248,7 +250,7 @@ static int client_registration(DBusMessage *message, data = sbus_conn_get_private_data(conn); dpcli = talloc_get_type(data, struct dp_client); if (!dpcli) { - DEBUG(0, ("Connection holds no valid init data\n")); + SYSLOG_ERROR("Connection holds no valid init data\n"); return EINVAL; } @@ -276,14 +278,14 @@ static int client_registration(DBusMessage *message, case DP_CLI_BACKEND: dpbe = talloc_zero(dpcli->dpctx, struct dp_backend); if (!dpbe) { - DEBUG(0, ("Out of memory!\n")); + SYSLOG_ERROR("Out of memory!\n"); sbus_disconnect(conn); return ENOMEM; } dpbe->domain = talloc_strdup(dpbe, cli_domain); if (!dpbe->domain) { - DEBUG(0, ("Out of memory!\n")); + SYSLOG_ERROR("Out of memory!\n"); sbus_disconnect(conn); return ENOMEM; } @@ -300,14 +302,14 @@ static int client_registration(DBusMessage *message, case DP_CLI_FRONTEND: dpfe = talloc_zero(dpcli->dpctx, struct dp_frontend); if (!dpfe) { - DEBUG(0, ("Out of memory!\n")); + SYSLOG_ERROR("Out of memory!\n"); sbus_disconnect(conn); return ENOMEM; } dpfe->name = talloc_strdup(dpfe, cli_name); if (!dpfe->name) { - DEBUG(0, ("Out of memory!\n")); + SYSLOG_ERROR("Out of memory!\n"); sbus_disconnect(conn); return ENOMEM; } @@ -330,7 +332,7 @@ static int client_registration(DBusMessage *message, /* reply that all is ok */ reply = dbus_message_new_method_return(message); if (!reply) { - DEBUG(0, ("Dbus Out of memory!\n")); + SYSLOG_ERROR("Dbus Out of memory!\n"); return ENOMEM; } @@ -338,7 +340,7 @@ static int client_registration(DBusMessage *message, DBUS_TYPE_UINT16, &version, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(0, ("Failed to build dbus reply\n")); + SYSLOG_ERROR("Failed to build dbus reply\n"); dbus_message_unref(reply); sbus_disconnect(conn); return EIO; @@ -373,7 +375,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. */ - 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"); /* Destroy this connection */ sbus_disconnect(bereq->be->dpcli->conn); @@ -402,8 +404,8 @@ static void be_got_account_info(DBusPendingCall *pending, void *data) break; case DBUS_MESSAGE_TYPE_ERROR: - DEBUG(0,("The Data Provider returned an error [%s], closing connection.\n", - dbus_message_get_error_name(reply))); + SYSLOG_ERROR("The Data Provider returned an error [%s], closing connection.\n", + dbus_message_get_error_name(reply)); /* Falling through to default intentionally*/ default: /* @@ -468,7 +470,7 @@ static int dp_send_acct_req(struct dp_be_request *bereq, DP_CLI_INTERFACE, DP_CLI_METHOD_GETACCTINFO); if (msg == NULL) { - DEBUG(0,("Out of memory?!\n")); + SYSLOG_ERROR("Out of memory?!\n"); return ENOMEM; } @@ -492,7 +494,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. */ - DEBUG(0, ("D-BUS send failed.\n")); + SYSLOG_ERROR("D-BUS send failed.\n"); dbus_message_unref(msg); return EIO; } @@ -688,7 +690,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. */ - 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"); /* Destroy this connection */ sbus_disconnect(bereq->be->dpcli->conn); @@ -715,8 +717,8 @@ static void be_got_pam_reply(DBusPendingCall *pending, void *data) break; case DBUS_MESSAGE_TYPE_ERROR: - DEBUG(0,("The Data Provider returned an error [%s], closing connection.\n", - dbus_message_get_error_name(reply))); + SYSLOG_ERROR("The Data Provider returned an error [%s], closing connection.\n", + dbus_message_get_error_name(reply)); /* Falling through to default intentionally*/ default: /* @@ -765,7 +767,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) { - DEBUG(0,("Out of memory?!\n")); + SYSLOG_ERROR("Out of memory?!\n"); return ENOMEM; } @@ -786,7 +788,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. */ - DEBUG(0, ("D-BUS send failed.\n")); + SYSLOG_ERROR("D-BUS send failed.\n"); dbus_message_unref(msg); return EIO; } @@ -827,7 +829,7 @@ static int dp_pamhandler(DBusMessage *message, struct sbus_connection *conn) ret = dp_unpack_pam_request(message, pd, &dbus_error); if (!ret) { - DEBUG(0,("Failed, to parse message!\n")); + SYSLOG_ERROR("Failed, to parse message!\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); talloc_free(pd); return EIO; @@ -838,7 +840,7 @@ static int dp_pamhandler(DBusMessage *message, struct sbus_connection *conn) reply = dbus_message_new_method_return(message); if (!reply) { - DEBUG(0,("Out of memory?!\n")); + SYSLOG_ERROR("Out of memory?!\n"); talloc_free(pd); return ENOMEM; } @@ -964,7 +966,7 @@ static int dp_process_init(TALLOC_CTX *mem_ctx, dpctx = talloc_zero(mem_ctx, struct dp_ctx); if (!dpctx) { - DEBUG(0, ("fatal error initializing dp_ctx\n")); + SYSLOG_ERROR("fatal error initializing dp_ctx\n"); return ENOMEM; } dpctx->ev = ev; @@ -972,13 +974,13 @@ static int dp_process_init(TALLOC_CTX *mem_ctx, ret = dp_monitor_init(dpctx); if (ret != EOK) { - DEBUG(0, ("fatal error setting up monitor bus\n")); + SYSLOG_ERROR("fatal error setting up monitor bus\n"); return ret; } ret = dp_srv_init(dpctx); if (ret != EOK) { - DEBUG(0, ("fatal error setting up server bus\n")); + SYSLOG_ERROR("fatal error setting up server bus\n"); return ret; } @@ -1011,8 +1013,11 @@ 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("sssd[dp]", 0, DP_CONF_ENTRY, &main_ctx); + ret = server_setup(PRG_NAME, 0, DP_CONF_ENTRY, &main_ctx); if (ret != EOK) return 2; ret = die_if_parent_died(); @@ -1029,6 +1034,9 @@ 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 2e83ab6e..b8630e6a 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) { - DEBUG(0, ("Could not locate monitor address.\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to connect to monitor services.\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to identify to the monitor!\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("Could not locate monitor address.\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to connect to monitor services.\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to identify to the data provider!\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to set up automatic reconnection\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to send id to the data provider!\n")); + SYSLOG_ERROR("Failed to send id to the data provider!\n"); } else { return; } } /* Handle failure */ - DEBUG(0, ("Could not reconnect to data provider.\n")); + SYSLOG_ERROR("Could not reconnect to data provider.\n"); /* Kill the backend and let the monitor restart it */ ret = be_finalize(be_ctx); if (ret != EOK) { - DEBUG(0, ("Finalizing back-end failed with error [%d] [%s]\n", - ret, strerror(ret))); + SYSLOG_ERROR("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 */ - DEBUG(0, ("Finalizing auth module failed with error [%d] [%s]\n", - status, errstr ? : strerror(status))); + SYSLOG_ERROR("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 */ - DEBUG(0, ("Finalizing auth module failed with error [%d] [%s]\n", - status, errstr ? : strerror(status))); + SYSLOG_ERROR("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. */ - DEBUG(0, ("ERROR: could not shut down cleanly.\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("Unable to load %s module with path (%s), error: %s\n", - mod_name, path, dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Unable to load init fn %s from module %s, error: %s\n", - mod_init_fn_name, mod_name, dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Error (%d) in module (%s) initialization (%s)!\n", - ret, mod_name, mod_init_fn_name)); + SYSLOG_ERROR("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) { - DEBUG(0, ("fatal error initializing be_ctx\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("Out of memory!?\n")); + SYSLOG_ERROR("Out of memory!?\n"); return ENOMEM; } ret = confdb_get_domain(cdb, be_domain, &ctx->domain); if (ret != EOK) { - DEBUG(0, ("fatal error retrieving domain configuration\n")); + SYSLOG_ERROR("fatal error retrieving domain configuration\n"); return ret; } ret = sysdb_domain_init(ctx, ev, ctx->domain, DB_PATH, &ctx->sysdb); if (ret != EOK) { - DEBUG(0, ("fatal error opening cache database\n")); + SYSLOG_ERROR("fatal error opening cache database\n"); return ret; } ret = mon_cli_init(ctx); if (ret != EOK) { - DEBUG(0, ("fatal error setting up monitor bus\n")); + SYSLOG_ERROR("fatal error setting up monitor bus\n"); return ret; } ret = be_cli_init(ctx); if (ret != EOK) { - DEBUG(0, ("fatal error setting up server bus\n")); + SYSLOG_ERROR("fatal error setting up server bus\n"); return ret; } ret = be_rewrite(ctx); if (ret != EOK) { - DEBUG(0, ("error rewriting provider types\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("fatal error initializing data providers\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("fatal error initializing data providers\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("fatal error initializing data providers\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("fatal error initializing data providers\n")); + SYSLOG_ERROR("fatal error initializing data providers\n"); return ret; } DEBUG(1, ("No change password module provided for [%s] !!\n", @@ -1012,9 +1012,12 @@ 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) { - DEBUG(0, ("Could not set up mainloop [%d]\n", ret)); + SYSLOG_ERROR("Could not set up mainloop [%d]\n", ret); return 2; } @@ -1029,7 +1032,7 @@ int main(int argc, const char *argv[]) main_ctx->event_ctx, main_ctx->confdb_ctx); if (ret != EOK) { - DEBUG(0, ("Could not initialize backend [%d]\n", ret)); + SYSLOG_ERROR("Could not initialize backend [%d]\n", ret); return 3; } @@ -1038,6 +1041,9 @@ 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 80e9f167..8bfa0849 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. */ - 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 ? */ goto done; @@ -266,8 +266,8 @@ static void id_callback(DBusPendingCall *pending, void *ptr) break; case DBUS_MESSAGE_TYPE_ERROR: - DEBUG(0,("The Monitor returned an error [%s]\n", - dbus_message_get_error_name(reply))); + SYSLOG_ERROR("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) { - DEBUG(0, ("Out of memory?!\n")); + SYSLOG_ERROR("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. */ - DEBUG(0, ("D-BUS send failed.\n")); + SYSLOG_ERROR("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 03e79032..0eac91f5 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: - DEBUG(0, ("unsupported PAM command [%d].\n", pd->cmd)); + SYSLOG_ERROR("unsupported PAM command [%d].\n", pd->cmd); } if (password == NULL) { - DEBUG(0, ("password not available, offline auth may not work.\n")); + SYSLOG_ERROR("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 72caf966..bd376f7c 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) { - DEBUG(0, ("FATAL: failed to setup enumeration task!\n")); + SYSLOG_ERROR("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) { - DEBUG(0, ("FATAL: failed to setup enumeration task!\n")); + SYSLOG_ERROR("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 22d238e6..7edcc3d8 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))) { - DEBUG(0, ("Failed to retrieve value for option (%s)\n", - opts->basic[i].opt_name)); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to retrieve value for option (%s)\n", - opts->basic[i].opt_name)); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to retrieve value for option (%s)\n", - opts->basic[i].opt_name)); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to retrieve value for option (%s)\n", - opts->basic[i].opt_name)); + SYSLOG_ERROR("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 { - DEBUG(0, ("Unrecognized schema type: %s\n", schema)); + SYSLOG_ERROR("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)) { - DEBUG(0, ("Failed to retrieve a value (%s)\n", - opts->user_map[i].opt_name)); + SYSLOG_ERROR("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)) { - DEBUG(0, ("Failed to retrieve a value (%s)\n", - opts->group_map[i].opt_name)); + SYSLOG_ERROR("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) { - 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))); + 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)); 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) { - 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))); + 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)); 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) { - 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))); + 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)); 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) { - 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))); + 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)); 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) { - 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))); + 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)); return false; } return opts[id].val.boolean; diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c index 6ab88679..f50750a2 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 */ - DEBUG(0, ("Fatal Internal error: aborting\n")); + SYSLOG_ERROR("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: - DEBUG(0, ("FATAL ERROR: Unhandled schema type! (%d)\n", - opts->schema_type)); + SYSLOG_ERROR("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 80a2a550..22717e86 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) { - DEBUG(0, ("Unable to load %s module with path, error: %s\n", - libpath, dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + SYSLOG_ERROR("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) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + SYSLOG_ERROR("Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } |