|
CWB
|
#include "auth.h"#include <arpa/inet.h>#include <string.h>#include <stdio.h>#include <stdlib.h>#include <assert.h>#include "../cl/macros.h"| typedef struct _HostEntry HostEntry |
Internal data structure: member of list of IP addresses from which messages are accepted.
| typedef struct _UserEntry UserEntry |
Internal data structure: a username, the user's password, and the top of a linked list of Grants.
| void add_grant_to_last_user | ( | char * | corpus | ) |
| void add_host_to_list | ( | char * | ipaddr | ) |
Referenced by add_hosts_in_subnet_to_list(), and main().
| void add_hosts_in_subnet_to_list | ( | char * | ipsubnet | ) |
| void add_user_to_list | ( | char * | user, |
| char * | passwd | ||
| ) |
| int authenticate_user | ( | char * | username, |
| char * | passwd | ||
| ) |
returns true if (user, passwd) pair is in list of allowed users
Referenced by main().
| int check_grant | ( | char * | username, |
| char * | corpus | ||
| ) |
returns true if user may access corpus
Referenced by main().
| int check_host | ( | struct in_addr | host_addr | ) |
returns true if host is in list of allowed hosts
Referenced by accept_connection().
| UserEntry* find_user | ( | char * | username | ) |
Finds an entry the user with the specified username on the global user list.
References authorized_users, _UserEntry::name, _UserEntry::next, and user.
Referenced by add_user_to_list(), authenticate_user(), and check_grant().
| void show_grants | ( | void | ) |
for debugging only
| HostEntry* authorized_hosts = NULL |
global variable for host list
Referenced by add_host_to_list().
| UserEntry* authorized_users = NULL |
global variable for user list
Referenced by add_user_to_list(), and find_user().
1.7.3