sysdb_init.c revision f983b400bf4f6fb14a2174d6f58071e06e9ec832
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen System Database - initialization
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen Copyright (C) 2008-2011 Simo Sorce <ssorce@redhat.com>
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen Copyright (C) 2008-2011 Stephen Gallagher <ssorce@redhat.com>
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen This program is free software; you can redistribute it and/or modify
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen it under the terms of the GNU General Public License as published by
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen the Free Software Foundation; either version 3 of the License, or
2e533fb1283b5f06a4063b519e47f1861c910386Timo Sirainen (at your option) any later version.
863f2bc9983c33221f5936421fc9c06caf21639aTimo Sirainen This program is distributed in the hope that it will be useful,
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen but WITHOUT ANY WARRANTY; without even the implied warranty of
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen GNU General Public License for more details.
cd18d7bb3e8d5921c3c852bd0a27fbeff9a9babbTimo Sirainen You should have received a copy of the GNU General Public License
cd18d7bb3e8d5921c3c852bd0a27fbeff9a9babbTimo Sirainen along with this program. If not, see <http://www.gnu.org/licenses/>.
1358e2c58ce29231485a5cfa454756d429ad3d2cTimo Sirainen/* If an entry differs only in these attributes, they are written to
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen * the timestamp cache only. In addition, objectclass is added so that
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen * we can distinguish between users and groups.
return EIO;
return EIO;
return EOK;
const char *ldb_file,
int flags,
return ret;
if (ret != 0) {
return ret;
if (ret != 0) {
return ret;
return EOK;
const char *provider,
const char *name,
const char *base_path,
char **_ldb_file,
char **_ts_file)
char *ldb_file;
return ENOMEM;
if (!ldb_file) {
return ENOMEM;
return EOK;
const char *domain_name)
int ret;
goto done;
if (!msg) {
goto done;
goto done;
goto done;
goto done;
if (!msg) {
goto done;
goto done;
goto done;
goto done;
if (!msg) {
goto done;
goto done;
goto done;
goto done;
done:
return ret;
static errno_t
const char *received)
int ret;
return EOK;
return EINVAL;
return EINVAL;
return ERR_SYSDB_VERSION_TOO_NEW;
return ERR_SYSDB_VERSION_TOO_OLD;
return ERR_SYSDB_VERSION_TOO_NEW;
return ERR_SYSDB_VERSION_TOO_OLD;
return EOK;
const char *base_ldif,
const char *domain_name)
int ret;
return EIO;
return EOK;
const char *base_ldif,
int ret;
return ret;
return ret;
return EOK;
const char *cur_version,
const char **_new_version)
return EFAULT;
const char *cur_version,
const char **_new_version)
const char *version;
return ENOMEM;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
const char *ldb_file,
int flags,
const char *exp_version,
const char *base_ldif,
const char **_version)
int ret;
if (!tmp_ctx) {
goto done;
goto done;
if (!verdn) {
goto done;
goto done;
goto done;
if (!el) {
goto done;
goto done;
if (!version) {
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
bool allow_upgrade)
const char *version;
return ENOMEM;
switch (ret) {
if (allow_upgrade == false) {
goto done;
&version);
goto done;
goto done;
done:
return ret;
bool allow_upgrade)
const char *version;
return EOK;
return ENOMEM;
switch (ret) {
if (allow_upgrade == false) {
&version);
&ldb);
return ret;
return ret;
const char *db_path,
bool allow_upgrade,
int ret;
return ENOMEM;
if (!sysdb) {
goto done;
goto done;
goto done;
goto done;
done:
return ret;
bool allow_upgrade)
bool allow_upgrade,
bool chown_dbfile,
int ret;
if (allow_upgrade) {
return ret;
return ret;
if (chown_dbfile) {
return ret;
return EOK;
const char *db_path,