Fix uid counting.
authorAndre Noll <maan@systemlinux.org>
Fri, 30 May 2008 13:10:51 +0000 (15:10 +0200)
committerAndre Noll <maan@systemlinux.org>
Fri, 30 May 2008 13:10:51 +0000 (15:10 +0200)
It was only correct in create mode.

adu.c

diff --git a/adu.c b/adu.c
index 8077bd9..5728a31 100644 (file)
--- a/adu.c
+++ b/adu.c
@@ -243,13 +243,13 @@ static int open_user_table(struct user_info *ui, int create)
        ui->desc->column_descriptions = user_table_cols;
        ui->desc->dir = para_strdup(conf.database_dir_arg);
        ui->desc->name = make_message("%u", (unsigned)ui->uid);
-       num_uids++;
        INFO_LOG(".............................uid #%u: %u\n",
                (unsigned)num_uids, (unsigned)ui->uid);
        if (create) {
                ret = osl_create_table(ui->desc);
                if (ret < 0)
                        goto err;
+               num_uids++;
        }
        ret = osl_open_table(ui->desc, &ui->table);
        if (ret < 0)