summaryrefslogtreecommitdiff
path: root/server/db
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/db
parent9570ca098cd0e92d1eb6aabc00fb8cac9fddd442 (diff)
downloadsssd-8c50bd085c0efe5fde354deee2c8118887aae29d.tar.gz
sssd-8c50bd085c0efe5fde354deee2c8118887aae29d.tar.bz2
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/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 87d0de96..b63a5a49 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) {
- DEBUG(0,("Wrong DB version [%s],"
- " expected [%s] for this upgrade!\n",
- version, SYSDB_VERSION));
+ SYSLOG_ERROR("Wrong DB version [%s],"
+ " expected [%s] for this upgrade!\n",
+ version, SYSDB_VERSION);
ret = EINVAL;
goto done;
}
}
talloc_zfree(res);
- DEBUG(0, ("UPGRADING DB TO VERSION %s\n", SYSDB_VERSION_0_3));
+ SYSLOG_NOTICE("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) {
- 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)));
+ 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));
}
ret = ldb_delete(local->ldb, msg->dn);
if (ret != LDB_SUCCESS) {
- 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)));
+ 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));
}
}
@@ -1129,8 +1129,8 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
}
if (!allow_upgrade) {
- DEBUG(0, ("Wrong DB version (got %s expected %s)\n",
- version, SYSDB_VERSION));
+ SYSLOG_ERROR("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) {
- DEBUG(0, ("Fatal: providers other than 'local'"
- " shouldn't present v0.2, db corrupted?\n"));
+ SYSLOG_ERROR("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 {
- DEBUG(0, ("DB file seem to need an upgrade,"
- " but upgrade flag is not provided,"
- " db corrupted?\n"));
+ SYSLOG_ERROR("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,
}
- DEBUG(0,("Unknown DB version [%s], expected [%s] for domain %s!\n",
- version?version:"not found", SYSDB_VERSION, domain->name));
+ SYSLOG_ERROR("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) {
- DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
- ret, ldb_errstring(ctx->ldb), domain->name));
+ SYSLOG_ERROR("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) {
- DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
- ret, ldb_errstring(ctx->ldb), domain->name));
+ SYSLOG_ERROR("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) {
- DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
- ret, ldb_errstring(ctx->ldb), domain->name));
+ SYSLOG_ERROR("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) {
- DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!",
- ret, ldb_errstring(ctx->ldb), domain->name));
+ SYSLOG_ERROR("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) {
- 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));
+ 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);
talloc_zfree(ctx_list);
return ret;
}
diff --git a/server/db/sysdb_ops.c b/server/db/sysdb_ops.c
index 3a53c9e5..c0a48328 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)) {
- DEBUG(0, ("Failed to allocate new id, out of range (%u/%u)\n",
- 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);
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)) {
- DEBUG(0, ("Failed to allocate new id, out of range (%u/%u)\n",
- 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);
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) {
- DEBUG(0, ("Cannot add user with arbitrary GID in MPG domain!\n"));
+ SYSLOG_ERROR("Cannot add user with arbitrary GID in MPG domain!\n");
ERROR_OUT(ret, EINVAL, fail);
}
state->gid = state->uid;