summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb_upgrade.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-04-20 17:06:03 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-06-23 13:40:11 +0200
commit72dbcd0a3361f1c0f0c3e348aa2fbcabd926188b (patch)
tree2446de5bdb60544ac793b3dbb00d051b7b2f0350 /src/db/sysdb_upgrade.c
parente732d23f3ec986a463d757781a334040e03d1f59 (diff)
downloadsssd-72dbcd0a3361f1c0f0c3e348aa2fbcabd926188b.tar.gz
sssd-72dbcd0a3361f1c0f0c3e348aa2fbcabd926188b.tar.xz
sssd-72dbcd0a3361f1c0f0c3e348aa2fbcabd926188b.zip
SYSDB: Refactor database connection
Changes the functions in sysdb_init.c so that the functions are usable to initialize a second cache to store timestamps. In particular, functions that operated on sysdb->ldb now operate on a generic ldb context so that a new ldb_ts context can be used later. Existing functions that initialize the sysdb cache call the generic functions with sysdb->ldb as a parameter. Splits out a function to initialize an empty ldb database with a generic LDIF. Splits out the sysdb upgrade function because the upgrade will only be used by the sysdb cache, the timestamp cache will start with a different version and might receive separate upgrade functions in the future. The ldb connection function accepts ldb flags parameter, currently unused. Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/db/sysdb_upgrade.c')
-rw-r--r--src/db/sysdb_upgrade.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/db/sysdb_upgrade.c b/src/db/sysdb_upgrade.c
index 113f24644..873c8eede 100644
--- a/src/db/sysdb_upgrade.c
+++ b/src/db/sysdb_upgrade.c
@@ -289,7 +289,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
goto exit;
}
- ret = sysdb_ldb_connect(tmp_ctx, ldb_file, &ldb);
+ ret = sysdb_ldb_connect(tmp_ctx, ldb_file, 0, &ldb);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_ldb_connect failed.\n");
return ret;
@@ -380,7 +380,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
}
/* reopen */
- ret = sysdb_ldb_connect(tmp_ctx, ldb_file, &ldb);
+ ret = sysdb_ldb_connect(tmp_ctx, ldb_file, 0, &ldb);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_ldb_connect failed.\n");
return ret;