view src/auth/db-passwd-file.h @ 4035:335ac59efffd HEAD

If passwd-file is being used as userdb, complain immediately if some entries don't have userdb information. Also some other cleanups and crashfix for today's earlier changes.
author Timo Sirainen <tss@iki.fi>
date Mon, 20 Feb 2006 18:31:46 +0200
parents b533c52196e3
children 25204e1faeb6
line wrap: on
line source

#ifndef __DB_PASSWD_FILE_H
#define __DB_PASSWD_FILE_H

struct passwd_user {
	uid_t uid;
	gid_t gid;

	char *home;
        char *password;
        char **extra_fields;
};

struct passwd_file {
        struct db_passwd_file *db;
	pool_t pool;

	char *path;
	time_t stamp;
	off_t size;
	int fd;

	struct hash_table *users;

	const char *first_missing_userdb_info;
	unsigned int missing_userdb_info_count;
};

struct db_passwd_file {
	struct db_passwd_file *next;

	int refcount;

	char *path;
	struct hash_table *files;
        struct passwd_file *default_file;

	unsigned int domain_var:1;
	unsigned int vars:1;
	unsigned int userdb:1;
	unsigned int debug:1;
};

struct passwd_user *
db_passwd_file_lookup(struct db_passwd_file *db, struct auth_request *request);

struct db_passwd_file *
db_passwd_file_init(const char *path, bool userdb, bool debug);
void db_passwd_file_parse(struct db_passwd_file *db);
void db_passwd_file_unref(struct db_passwd_file **db);

#endif