X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=user.c;h=ed16463afed9372426c5c08284a65ec863a19e2e;hb=6744ce67f91c410f69de0763fb6faa01a8a53b28;hp=026d65be741fdc3a100c24f6cce379f8eaa124e0;hpb=bd0166ae6242deafc9b3436199965420517033b5;p=adu.git diff --git a/user.c b/user.c index 026d65b..ed16463 100644 --- a/user.c +++ b/user.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Andre Noll + * Copyright (C) 2008 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -10,7 +10,6 @@ #include /* readdir() */ #include #include -#include "cmdline.h" /* TODO: This file should be independent of command line options */ #include "user.h" #include "fd.h" #include "string.h" @@ -45,7 +44,7 @@ enum uid_info_flags { * * 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; @@ -267,7 +266,7 @@ static int open_user_table(struct user_info *ui, int create) 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) @@ -452,7 +451,7 @@ int create_user_table(uint32_t uid, struct user_info **ui_ptr) 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. @@ -467,7 +466,7 @@ static char *get_uid_list_name(void) * \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) { @@ -512,7 +511,7 @@ int read_uid_file(void) 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) {