6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek System Database - initialization
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek Copyright (C) 2008-2011 Simo Sorce <ssorce@redhat.com>
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek Copyright (C) 2008-2011 Stephen Gallagher <ssorce@redhat.com>
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek This program is free software; you can redistribute it and/or modify
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek it under the terms of the GNU General Public License as published by
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek the Free Software Foundation; either version 3 of the License, or
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek (at your option) any later version.
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek This program is distributed in the hope that it will be useful,
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek but WITHOUT ANY WARRANTY; without even the implied warranty of
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek GNU General Public License for more details.
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek You should have received a copy of the GNU General Public License
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek along with this program. If not, see <http://www.gnu.org/licenses/>.
f983b400bf4f6fb14a2174d6f58071e06e9ec832Jakub Hrozek/* If an entry differs only in these attributes, they are written to
0e238c259c066cf997aaa940d33d6bda96c15925Sumit Bose * the timestamp cache only. In addition, objectclass/objectcategory is added
0e238c259c066cf997aaa940d33d6bda96c15925Sumit Bose * so that we can distinguish between users and groups.
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek ret = ldb_set_debug(ldb, ldb_debug_messages, NULL);
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek DEBUG(SSSDBG_TRACE_ALL, "Setting ldb module path to [%s].\n", mod_path);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozekstatic errno_t sysdb_ldb_reconnect(TALLOC_CTX *mem_ctx,
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_ldb_connect(mem_ctx, ldb_file, flags, ldb);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_ldb_connect failed.\n");
f983b400bf4f6fb14a2174d6f58071e06e9ec832Jakub Hrozekstatic errno_t sysdb_chown_db_files(struct sysdb_ctx *sysdb,
f983b400bf4f6fb14a2174d6f58071e06e9ec832Jakub Hrozek "Cannot set sysdb ownership of %s to %"SPRIuid":%"SPRIgid"\n",
f983b400bf4f6fb14a2174d6f58071e06e9ec832Jakub Hrozek "Cannot set sysdb ownership of %s to %"SPRIuid":%"SPRIgid"\n",
f983b400bf4f6fb14a2174d6f58071e06e9ec832Jakub Hrozek const char *name,
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* special case for the local domain */
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek ldb_file = talloc_asprintf(mem_ctx, "%s/"LOCAL_SYSDB_FILE,
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek ldb_file = talloc_asprintf(mem_ctx, "%s/"CACHE_SYSDB_FILE,
f983b400bf4f6fb14a2174d6f58071e06e9ec832Jakub Hrozek ts_file = talloc_asprintf(mem_ctx, "%s/"CACHE_TIMESTAMPS_FILE,
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozekstatic errno_t sysdb_domain_create_int(struct ldb_context *ldb,
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* == create base domain object == */
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek msg->dn = ldb_dn_new_fmt(msg, ldb, SYSDB_DOM_BASE, domain_name);
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek ret = ldb_msg_add_string(msg, "cn", domain_name);
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* do a synchronous add */
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek DEBUG(SSSDBG_FATAL_FAILURE, "Failed to initialize DB (%d, [%s]) "
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek "for domain %s!\n",
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* == create Users tree == */
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* do a synchronous add */
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek DEBUG(SSSDBG_FATAL_FAILURE, "Failed to initialize DB (%d, [%s]) "
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek "for domain %s!\n",
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* == create Groups tree == */
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* do a synchronous add */
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek DEBUG(SSSDBG_FATAL_FAILURE, "Failed to initialize DB (%d, [%s]) for "
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek "domain %s!\n",
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozekerrno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name)
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek return sysdb_domain_create_int(sysdb->ldb, domain_name);
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek/* Compare versions of sysdb, returns ERRNO accordingly */
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek unsigned int exp_major, exp_minor, recv_major, recv_minor;
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek ret = sscanf(expected, "%u.%u", &exp_major, &exp_minor);
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek ret = sscanf(received, "%u.%u", &recv_major, &recv_minor);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozekstatic errno_t sysdb_cache_add_base_ldif(struct ldb_context *ldb,
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek while ((ldif = ldb_ldif_read_string(ldb, &base_ldif))) {
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek "Failed to initialize DB (%d, [%s]) for domain %s!\n",
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozekstatic errno_t sysdb_cache_create_empty(struct ldb_context *ldb,
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_cache_add_base_ldif(ldb, base_ldif, domain->name);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_domain_create_int(ldb, domain->name);
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozekstatic errno_t sysdb_ts_cache_upgrade(TALLOC_CTX *mem_ctx,
2927da49dd8a16fff6312d89ad43cc355655800cSumit Bose /* The upgrade process depends on having ldb around, yet the upgrade
2927da49dd8a16fff6312d89ad43cc355655800cSumit Bose * function shouldn't set the ldb pointer, only the connect function
2927da49dd8a16fff6312d89ad43cc355655800cSumit Bose * should after it's successful. To avoid hard refactoring, save the
2927da49dd8a16fff6312d89ad43cc355655800cSumit Bose * ldb pointer here and restore in the 'done' handler
2927da49dd8a16fff6312d89ad43cc355655800cSumit Bose "Upgrading timstamp cache of DB [%s] from version: %s\n",
2927da49dd8a16fff6312d89ad43cc355655800cSumit Bose if (strcmp(version, SYSDB_TS_VERSION_0_1) == 0) {
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozekstatic errno_t sysdb_domain_cache_upgrade(TALLOC_CTX *mem_ctx,
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek /* The upgrade process depends on having ldb around, yet the upgrade
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek * function shouldn't set the ldb pointer, only the connect function
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek * should after it's successful. To avoid hard refactoring, save the
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek * ldb pointer here and restore in the 'done' handler
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek "Upgrading DB [%s] from version: %s\n",
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek if (strcmp(version, SYSDB_VERSION_0_10) == 0) {
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_upgrade_10(sysdb, domain, &version);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek if (strcmp(version, SYSDB_VERSION_0_11) == 0) {
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_upgrade_11(sysdb, domain, &version);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek if (strcmp(version, SYSDB_VERSION_0_12) == 0) {
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek if (strcmp(version, SYSDB_VERSION_0_13) == 0) {
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek if (strcmp(version, SYSDB_VERSION_0_14) == 0) {
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek if (strcmp(version, SYSDB_VERSION_0_15) == 0) {
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek if (strcmp(version, SYSDB_VERSION_0_16) == 0) {
8531bd4585f9135ffd4cbb9bb4c880dc77b5adc4Jakub Hrozek if (strcmp(version, SYSDB_VERSION_0_17) == 0) {
8531bd4585f9135ffd4cbb9bb4c880dc77b5adc4Jakub Hrozek ret = sysdb_upgrade_17(sysdb, upgrade_ctx, &version);
9023bf51de6c84337af024388f1860ac1051924cFabiano Fidênciostatic errno_t remove_ts_cache(struct sysdb_ctx *sysdb)
b6d1cd5eaab4c7c73df8ee041944ec05630a9630Fabiano Fidênciostatic errno_t sysdb_cache_connect_helper(TALLOC_CTX *mem_ctx,
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_ldb_connect(tmp_ctx, ldb_file, flags, &ldb);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_ldb_connect failed.\n");
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek el = ldb_msg_find_element(res->msgs[0], "version");
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_version_check(exp_version, version);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek /* This is not the latest version. Return what version it is
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek * and appropriate error
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek /* SYSDB_BASE does not exists, means db is empty, populate */
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_cache_create_empty(ldb, base_ldif, domain);
9023bf51de6c84337af024388f1860ac1051924cFabiano Fidêncio /* We need to reopen the LDB to ensure that
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek * all of the special values take effect
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek * (such as enabling the memberOf plugin and
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek * the various indexes).
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_ldb_reconnect(tmp_ctx, ldb_file, flags, &ldb);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek /* If we connect to a new database, then the version is the
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek * latest one
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek *_version = talloc_strdup(mem_ctx, exp_version);
b6d1cd5eaab4c7c73df8ee041944ec05630a9630Fabiano Fidênciostatic errno_t sysdb_cache_connect(TALLOC_CTX *mem_ctx,
9023bf51de6c84337af024388f1860ac1051924cFabiano Fidêncio ldb_file_exists = !(access(sysdb->ldb_file, F_OK) == -1 && errno == ENOENT);
adb9823dc6b6247cd477fa7b050959f264f6582bLukas Slebodnik ret = sysdb_cache_connect_helper(mem_ctx, domain, sysdb->ldb_file,
9023bf51de6c84337af024388f1860ac1051924cFabiano Fidêncio /* The cache has been newly created. */
9023bf51de6c84337af024388f1860ac1051924cFabiano Fidêncio if (ret == EOK && newly_created && !ldb_file_exists) {
9023bf51de6c84337af024388f1860ac1051924cFabiano Fidêncio "Could not delete the timestamp ldb file (%d) (%s)\n",
b6d1cd5eaab4c7c73df8ee041944ec05630a9630Fabiano Fidênciostatic errno_t sysdb_ts_cache_connect(TALLOC_CTX *mem_ctx,
adb9823dc6b6247cd477fa7b050959f264f6582bLukas Slebodnik return sysdb_cache_connect_helper(mem_ctx, domain, sysdb->ldb_ts_file,
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozekstatic int sysdb_domain_cache_connect(struct sysdb_ctx *sysdb,
b6d1cd5eaab4c7c73df8ee041944ec05630a9630Fabiano Fidêncio ret = sysdb_cache_connect(tmp_ctx, sysdb, domain, &ldb, &version);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek "DB version too old [%s], expected [%s] for domain %s!\n",
6d66c2c465861ff2558f2574eddf8315628ccc6dJakub Hrozek ret = sysdb_domain_cache_upgrade(tmp_ctx, sysdb, upgrade_ctx,
3b67fc6488ac10ca13561d9032f59951f82203e6Jakub Hrozek /* To be on the safe side, nuke the timestamp cache on upgrades.
3b67fc6488ac10ca13561d9032f59951f82203e6Jakub Hrozek * This is just a one-time performance hit after an upgrade
3b67fc6488ac10ca13561d9032f59951f82203e6Jakub Hrozek "Could not delete the timestamp ldb file (%d) (%s)\n",
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* The version should now match SYSDB_VERSION.
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek * If not, it means we didn't match any of the
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek * known older versions. The DB might be
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek * corrupt or generated by a newer version of
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_version_check(SYSDB_VERSION, version);
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* The cache has been upgraded.
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek * We need to reopen the LDB to ensure that
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek * any changes made above take effect.
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek ret = sysdb_ldb_reconnect(tmp_ctx, sysdb->ldb_file, 0, &ldb);
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek "DB version too new [%s], expected [%s] for domain %s!\n",
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozekstatic int sysdb_timestamp_cache_connect(struct sysdb_ctx *sysdb,
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek DEBUG(SSSDBG_TRACE_FUNC, "No timestamp cache for %s\n", domain->name);
b6d1cd5eaab4c7c73df8ee041944ec05630a9630Fabiano Fidêncio ret = sysdb_ts_cache_connect(tmp_ctx, sysdb, domain, &ldb, &version);
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek "DB version too old [%s], expected [%s] for domain %s!\n",
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek ret = sysdb_ts_cache_upgrade(tmp_ctx, sysdb, ldb, domain, version,
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek "Could not upgrade the timestamp ldb file (%d) (%s)\n",
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek /* The version should now match SYSDB_VERSION.
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek * If not, it means we didn't match any of the
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek * known older versions. The DB might be
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek * corrupt or generated by a newer version of
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek ret = sysdb_version_check(SYSDB_TS_VERSION, version);
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek /* The cache has been upgraded.
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek * We need to reopen the LDB to ensure that
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek * any changes made above take effect.
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek "Could not reopen the timestamp ldb file (%d) (%s)\n",
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek "DB version too new [%s], expected [%s] for domain %s!\n",
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek "The timestamps cache could not be opened. "
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek "Throwing away the database and opening a new one\n");
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek "Could not delete the timestamp ldb file (%d) (%s)\n",
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek /* Now the connect must succeed because the previous cache doesn't
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek * exist anymore.
b6d1cd5eaab4c7c73df8ee041944ec05630a9630Fabiano Fidêncio ret = sysdb_ts_cache_connect(tmp_ctx, sysdb, domain, &ldb, &version);
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek "Could not delete the timestamp ldb file (%d) (%s)\n",
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozekint sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek sysdb = talloc_zero(mem_ctx, struct sysdb_ctx);
f983b400bf4f6fb14a2174d6f58071e06e9ec832Jakub Hrozek ret = sysdb_get_db_file(sysdb, domain->provider, domain->name, db_path,
72dbcd0a3361f1c0f0c3e348aa2fbcabd926188bJakub Hrozek "DB File for %s: %s\n", domain->name, sysdb->ldb_file);
f983b400bf4f6fb14a2174d6f58071e06e9ec832Jakub Hrozek "Timestamp file for %s: %s\n", domain->name, sysdb->ldb_ts_file);
6d66c2c465861ff2558f2574eddf8315628ccc6dJakub Hrozek ret = sysdb_domain_cache_connect(sysdb, domain, upgrade_ctx);
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek "Could not open the sysdb cache [%d]: %s\n",
6d66c2c465861ff2558f2574eddf8315628ccc6dJakub Hrozek ret = sysdb_timestamp_cache_connect(sysdb, domain, upgrade_ctx);
f21b3cce14055e77af8ccb98dd8e0fa1ec1f7944Jakub Hrozek "Could not open the timestamp cache [%d]: %s\n",
6d66c2c465861ff2558f2574eddf8315628ccc6dJakub Hrozek return sysdb_init_ext(mem_ctx, domains, NULL, false, 0, 0);
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* check if we have an old sssd.ldb to upgrade */
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek ret = sysdb_check_upgrade_02(domains, DB_PATH);
6e9d7cbe43fdfc866b18f9ef0779bbfc10ad6f3aJakub Hrozek /* open a db for each domain */
6d66c2c465861ff2558f2574eddf8315628ccc6dJakub Hrozek ret = sysdb_domain_init_internal(tmp_ctx, dom, DB_PATH,
f983b400bf4f6fb14a2174d6f58071e06e9ec832Jakub Hrozek "Cannot connect to database for %s: [%d]: %s\n",
f983b400bf4f6fb14a2174d6f58071e06e9ec832Jakub Hrozek "Cannot chown databases for %s: [%d]: %s\n",