summaryrefslogtreecommitdiffstats
path: root/server/db
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-09-22 13:11:29 -0400
committerSimo Sorce <ssorce@redhat.com>2009-09-23 07:33:31 -0400
commit87b8670b2749d02ffdc6c06506ac692b09db5be2 (patch)
treeead3f62f72c3522d3dc7703cd9f009aabc86a023 /server/db
parent091df02f920b5f5a658962d3add6f965d84375ac (diff)
downloadsssd-87b8670b2749d02ffdc6c06506ac692b09db5be2.tar.gz
sssd-87b8670b2749d02ffdc6c06506ac692b09db5be2.tar.xz
sssd-87b8670b2749d02ffdc6c06506ac692b09db5be2.zip
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.
Diffstat (limited to 'server/db')
-rw-r--r--server/db/sysdb.c66
-rw-r--r--server/db/sysdb_ops.c10
2 files changed, 38 insertions, 38 deletions
diff --git a/server/db/sysdb.c b/server/db/sysdb.c
index b63a5a494..87d0de965 100644
--- a/server/db/sysdb.c
+++ b/server/db/sysdb.c
@@ -808,16 +808,16 @@ static int sysdb_upgrade_02(struct confdb_ctx *cdb,
}
if (strcmp(version, SYSDB_VERSION_0_2) != 0) {
- SYSLOG_ERROR("Wrong DB version [%s],"
- " expected [%s] for this upgrade!\n",
- version, SYSDB_VERSION);
+ DEBUG(0,("Wrong DB version [%s],"
+ " expected [%s] for this upgrade!\n",
+ version, SYSDB_VERSION));
ret = EINVAL;
goto done;
}
}
talloc_zfree(res);
- SYSLOG_NOTICE("UPGRADING DB TO VERSION %s\n", SYSDB_VERSION_0_3);
+ DEBUG(0, ("UPGRADING DB TO VERSION %s\n", SYSDB_VERSION_0_3));
/* ldb uses posix locks,
* posix is stupid and kills all locks when you close *any* file
@@ -924,18 +924,18 @@ static int sysdb_upgrade_02(struct confdb_ctx *cdb,
ret = ldb_add(ctx->ldb, msg);
if (ret != LDB_SUCCESS) {
- SYSLOG_ERROR("WARNING: Could not add entry %s,"
- " to new ldb file! (%d [%s])\n",
- ldb_dn_get_linearized(msg->dn),
- ret, ldb_errstring(ctx->ldb));
+ DEBUG(0, ("WARNING: Could not add entry %s,"
+ " to new ldb file! (%d [%s])\n",
+ ldb_dn_get_linearized(msg->dn),
+ ret, ldb_errstring(ctx->ldb)));
}
ret = ldb_delete(local->ldb, msg->dn);
if (ret != LDB_SUCCESS) {
- SYSLOG_ERROR("WARNING: Could not remove entry %s,"
- " from old ldb file! (%d [%s])\n",
- ldb_dn_get_linearized(msg->dn),
- ret, ldb_errstring(local->ldb));
+ DEBUG(0, ("WARNING: Could not remove entry %s,"
+ " from old ldb file! (%d [%s])\n",
+ ldb_dn_get_linearized(msg->dn),
+ ret, ldb_errstring(local->ldb)));
}
}
@@ -1129,8 +1129,8 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
}
if (!allow_upgrade) {
- SYSLOG_ERROR("Wrong DB version (got %s expected %s)\n",
- version, SYSDB_VERSION);
+ DEBUG(0, ("Wrong DB version (got %s expected %s)\n",
+ version, SYSDB_VERSION));
ret = EINVAL;
goto done;
}
@@ -1144,8 +1144,8 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
if (strcmp(version, SYSDB_VERSION_0_2) == 0) {
/* if this is not local we have a big problem */
if (strcasecmp(domain->provider, "local") != 0) {
- SYSLOG_ERROR("Fatal: providers other than 'local'"
- " shouldn't present v0.2, db corrupted?\n");
+ DEBUG(0, ("Fatal: providers other than 'local'"
+ " shouldn't present v0.2, db corrupted?\n"));
ret = EFAULT;
goto done;
}
@@ -1155,9 +1155,9 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
if (need_02_upgrade) {
*need_02_upgrade = true;
} else {
- SYSLOG_ERROR("DB file seem to need an upgrade,"
- " but upgrade flag is not provided,"
- " db corrupted?\n");
+ DEBUG(0, ("DB file seem to need an upgrade,"
+ " but upgrade flag is not provided,"
+ " db corrupted?\n"));
ret = EFAULT;
goto done;
}
@@ -1168,8 +1168,8 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
}
- SYSLOG_ERROR("Unknown DB version [%s], expected [%s] for domain %s!\n",
- version?version:"not found", SYSDB_VERSION, domain->name);
+ DEBUG(0,("Unknown DB version [%s], expected [%s] for domain %s!\n",
+ version?version:"not found", SYSDB_VERSION, domain->name));
ret = EINVAL;
goto done;
}
@@ -1180,8 +1180,8 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
while ((ldif = ldb_ldif_read_string(ctx->ldb, &base_ldif))) {
ret = ldb_add(ctx->ldb, ldif->msg);
if (ret != LDB_SUCCESS) {
- SYSLOG_ERROR("Failed to initialize DB (%d, [%s]) for domain %s!",
- ret, ldb_errstring(ctx->ldb), domain->name);
+ DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
+ ret, ldb_errstring(ctx->ldb), domain->name));
ret = EIO;
goto done;
}
@@ -1208,8 +1208,8 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
/* do a synchronous add */
ret = ldb_add(ctx->ldb, msg);
if (ret != LDB_SUCCESS) {
- SYSLOG_ERROR("Failed to initialize DB (%d, [%s]) for domain %s!",
- ret, ldb_errstring(ctx->ldb), domain->name);
+ DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
+ ret, ldb_errstring(ctx->ldb), domain->name));
ret = EIO;
goto done;
}
@@ -1236,8 +1236,8 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
/* do a synchronous add */
ret = ldb_add(ctx->ldb, msg);
if (ret != LDB_SUCCESS) {
- SYSLOG_ERROR("Failed to initialize DB (%d, [%s]) for domain %s!",
- ret, ldb_errstring(ctx->ldb), domain->name);
+ DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
+ ret, ldb_errstring(ctx->ldb), domain->name));
ret = EIO;
goto done;
}
@@ -1264,8 +1264,8 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
/* do a synchronous add */
ret = ldb_add(ctx->ldb, msg);
if (ret != LDB_SUCCESS) {
- SYSLOG_ERROR("Failed to initialize DB (%d, [%s]) for domain %s!",
- ret, ldb_errstring(ctx->ldb), domain->name);
+ DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
+ ret, ldb_errstring(ctx->ldb), domain->name));
ret = EIO;
goto done;
}
@@ -1360,10 +1360,10 @@ int sysdb_init(TALLOC_CTX *mem_ctx,
ret = sysdb_upgrade_02(cdb, ev, ctx, ctx_list);
if (ret != EOK) {
- SYSLOG_ERROR("FATAL: Upgrade form db version %s failed!\n",
- SYSDB_VERSION_0_2);
- SYSLOG_ERROR("You can find a backup of the database "
- "in file named %s.bak", ctx->ldb_file);
+ DEBUG(0, ("FATAL: Upgrade form db version %d failed!\n",
+ SYSDB_VERSION_0_2));
+ DEBUG(0, ("You can find a backup of the database here: %s\n",
+ backup_file));
talloc_zfree(ctx_list);
return ret;
}
diff --git a/server/db/sysdb_ops.c b/server/db/sysdb_ops.c
index c0a48328c..3a53c9e5e 100644
--- a/server/db/sysdb_ops.c
+++ b/server/db/sysdb_ops.c
@@ -1352,8 +1352,8 @@ static void sysdb_get_new_id_base(struct tevent_req *subreq)
if ((state->domain->id_max != 0) &&
(state->new_id > state->domain->id_max)) {
- SYSLOG_ERROR("Failed to allocate new id, out of range (%u/%u)\n",
- state->new_id, state->domain->id_max);
+ DEBUG(0, ("Failed to allocate new id, out of range (%u/%u)\n",
+ state->new_id, state->domain->id_max));
tevent_req_error(req, ERANGE);
return;
}
@@ -1484,8 +1484,8 @@ static void sysdb_get_new_id_verify(struct tevent_req *subreq)
/* check again we are not falling out of range */
if ((state->domain->id_max != 0) &&
(state->new_id > state->domain->id_max)) {
- SYSLOG_ERROR("Failed to allocate new id, out of range (%u/%u)\n",
- state->new_id, state->domain->id_max);
+ DEBUG(0, ("Failed to allocate new id, out of range (%u/%u)\n",
+ state->new_id, state->domain->id_max));
tevent_req_error(req, ERANGE);
return;
}
@@ -1733,7 +1733,7 @@ struct tevent_req *sysdb_add_user_send(TALLOC_CTX *mem_ctx,
if (domain->mpg) {
if (gid != 0) {
- SYSLOG_ERROR("Cannot add user with arbitrary GID in MPG domain!\n");
+ DEBUG(0, ("Cannot add user with arbitrary GID in MPG domain!\n"));
ERROR_OUT(ret, EINVAL, fail);
}
state->gid = state->uid;