ffd328462d99eb679e14c0d81e8dde21e046c59fJonathan von Schroeder Copyright (C) Jakub Hrozek <jhrozek@redhat.com> 2009
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder This program is free software; you can redistribute it and/or modify
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder it under the terms of the GNU General Public License as published by
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder the Free Software Foundation; either version 3 of the License, or
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder (at your option) any later version.
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder This program is distributed in the hope that it will be useful,
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder but WITHOUT ANY WARRANTY; without even the implied warranty of
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder GNU General Public License for more details.
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder You should have received a copy of the GNU General Public License
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder along with this program. If not, see <http://www.gnu.org/licenses/>.
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroederstatic int setup_db(struct tools_ctx *ctx)
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder confdb_path = talloc_asprintf(ctx, "%s/%s", DB_PATH, CONFDB_FILE);
ffd328462d99eb679e14c0d81e8dde21e046c59fJonathan von Schroeder /* Connect to the conf db */
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder ret = confdb_init(ctx, &ctx->confdb, confdb_path);
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder "Could not initialize connection to the confdb\n");
return ret;
return EOK;
if (error) {
n = orig;
tokens++;
if (!out) {
return ENOMEM;
n = o = orig;
for (i = 0; i < tokens; i++) {
return EOK;
char **groups)
if (!groups) {
return EOK;
for (i = 0; groups[i]; ++i) {
if (domain) {
return EINVAL;
return ENOMEM;
return EOK;
const char *fullname)
return ret;
if (domain) {
return EINVAL;
return EINVAL;
return EOK;
char **grouplist,
char **badgroup)
if (!groupinfo) {
return ENOMEM;
for (i=0; grouplist[i]; ++i) {
grouplist[i],
if (ret) {
return ret;
if (id &&
return ERANGE;
return EOK;
if (c == NULL) {
errno = 0;
if (c == NULL) {
return errno;
errno = 0;
if (c == NULL) {
return errno;
return EOK;
return ENOMEM;
goto fini;
goto fini;
goto fini;
fini:
return ret;
if (ret != 0) {
return ret;
return EOK;
const char *maildir,
const char *username,
bool force)
goto fail;
if (force == false) {
switch (ret) {
goto fail;
if (ret != 0) {
goto fail;
fail:
return ret;
const char *homedir,
const char *maildir,
const char *username,
return EPERM;
return ret;
return EOK;
const char *username,
const char *maildir,
goto fail;
if (fd < 0) {
goto fail;
if (ret != 0) {
goto fail;
if (ret != 0) {
goto fail;
if (ret != 0) {
fail:
if (fd >= 0) {
if (ret != 0) {
return ret;
const char *homedir,
goto done;
done:
return ret;
if (!conf_path) {
goto done;
goto done;
errno = 0;
if (pid == 0) {
goto done;
if (ret != 0) {
goto done;
goto done;
goto done;
goto done;
done:
return ret;