/*
- * Copyright (C) 2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2008 Andre Noll <maan@tuebingen.mpg.de>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
#include <dirent.h> /* readdir() */
#include <sys/types.h>
#include <pwd.h>
-#include "cmdline.h" /* TODO: This file should be independent of command line options */
#include "user.h"
#include "fd.h"
#include "string.h"
*
* Even users that are not taken into account because of the --uid
* option occupy a slot in this hash table. This allows to find out
- * quicky whether a uid is admissible. And yes, this has to be fast.
+ * quickly whether a uid is admissible. And yes, this has to be fast.
*/
static struct user_info *uid_hash_table;
ui->desc->num_columns = NUM_UT_COLUMNS;
ui->desc->flags = 0;
ui->desc->column_descriptions = user_table_cols;
- ui->desc->dir = adu_strdup(conf.database_dir_arg);
+ ui->desc->dir = adu_strdup(database_dir);
ui->desc->name = make_message("%u", (unsigned)ui->uid);
pw = getpwuid(ui->uid);
if (pw && pw->pw_name)
static char *get_uid_list_name(void)
{
- return make_message("%s/uid_list", conf.database_dir_arg);
+ return make_message("%s/uid_list", database_dir);
}
/**
* Open the osl tables for all admissible uids.
* \a admissible_uids. If so, it sets the admissible bit for this slot and
* opens the osl table of the uid.
*
- * \return Stamdard.
+ * \return Standard.
*/
int open_admissible_user_tables(struct uid_range *admissible_uids)
{
size_t size;
uint32_t n;
char *filename = get_uid_list_name(), *map;
- int ret = mmap_full_file(filename, O_RDONLY, (void **)&map, &size, NULL);
+ int ret = mmap_file_ro(filename, (void **)&map, &size);
unsigned bits;
if (ret < 0) {