summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-12-10 15:48:16 -0500
committerStephen Gallagher <sgallagh@redhat.com>2009-12-10 17:20:20 -0500
commit8d6964aa2c0f2bf6ecfeeb69f2481a189805d77e (patch)
treef6437c8024d85f85c494dc192ba4a63feb48542d /server
parenta3725a2ea077509915ac63231f8580580bf1b0da (diff)
downloadsssd-8d6964aa2c0f2bf6ecfeeb69f2481a189805d77e.tar.gz
sssd-8d6964aa2c0f2bf6ecfeeb69f2481a189805d77e.tar.xz
sssd-8d6964aa2c0f2bf6ecfeeb69f2481a189805d77e.zip
Fix for #322, update from old database versions.
Diffstat (limited to 'server')
-rw-r--r--server/db/sysdb.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/server/db/sysdb.c b/server/db/sysdb.c
index 10da9750f..f22cea3b2 100644
--- a/server/db/sysdb.c
+++ b/server/db/sysdb.c
@@ -1087,6 +1087,8 @@ static int sysdb_upgrade_02(struct confdb_ctx *cdb,
for (j = 0; j < res->count; j++) {
+ struct ldb_dn *orig_dn;
+
msg = res->msgs[j];
/* skip pre-created congtainers */
@@ -1096,6 +1098,17 @@ static int sysdb_upgrade_02(struct confdb_ctx *cdb,
continue;
}
+ /* regenerate the DN against the new ldb as it may have different
+ * casefolding rules (example: name changing from case insensitive
+ * to case sensitive) */
+ orig_dn = msg->dn;
+ msg->dn = ldb_dn_new(msg, ctx->ldb,
+ ldb_dn_get_linearized(orig_dn));
+ if (!msg->dn) {
+ ret = ENOMEM;
+ goto done;
+ }
+
ret = ldb_add(ctx->ldb, msg);
if (ret != LDB_SUCCESS) {
DEBUG(0, ("WARNING: Could not add entry %s,"
@@ -1104,7 +1117,7 @@ static int sysdb_upgrade_02(struct confdb_ctx *cdb,
ret, ldb_errstring(ctx->ldb)));
}
- ret = ldb_delete(local->ldb, msg->dn);
+ ret = ldb_delete(local->ldb, orig_dn);
if (ret != LDB_SUCCESS) {
DEBUG(0, ("WARNING: Could not remove entry %s,"
" from old ldb file! (%d [%s])\n",