CWB
Data Structures | Typedefs | Functions | Variables

auth.c File Reference

#include "auth.h"
#include <arpa/inet.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "../cl/macros.h"

Data Structures

Typedefs

Functions

Variables


Typedef Documentation

typedef struct _Grant Grant

Internal data structure: name of a corpus to which access is granted.

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.


Function Documentation

void add_grant_to_last_user ( char *  corpus)
void add_host_to_list ( char *  ipaddr)
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.

See also:
authorized_users

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


Variable Documentation

global variable for host list

Referenced by add_host_to_list().

global variable for user list

Referenced by add_user_to_list(), and find_user().