Password Module


Data Structures

struct  password_entry

Defines

#define BSMOD_PASSWORD_FILE   "passwd"

Functions

static char * hash_string (const char *str)
static bs_status add_user (const char *name, const char *pass)
static bs_status remove_user (const char *name)
static bs_status bsmod_password_init (void)
static bs_status bsmod_password_cleanup (void)
static bs_service_responsecreate_status_response (const bs_service_request *request, bs_status status)
static bs_status bsmod_password_handle_service (const bs_service_request *request, bs_service_response **response, void *extra)

Variables

apr_pool_t * password_pool
bs_listpassword_list
bs_module bsmod_symtable
bs_module bsmod_symtable

Define Documentation

#define BSMOD_PASSWORD_FILE   "passwd"

Definition at line 52 of file bsmod_password.c.

Referenced by bsmod_password_cleanup(), and bsmod_password_init().


Function Documentation

static bs_status add_user ( const char *  name,
const char *  pass 
) [static]

Add a user to the list of known users. Calculate his/her password by hashing the given pass (SHA-1).

Parameters:
name The name of the user
pass The plaintext password of the user
Returns:
Status code

Definition at line 99 of file bsmod_password.c.

References BS_ERROR, BS_OK, password_entry::hash, hash_string(), list_append(), list_index(), list_size(), password_list, password_pool, streq(), and password_entry::username.

Referenced by bsmod_password_handle_service().

Here is the call graph for this function:

static bs_status bsmod_password_cleanup ( void   )  [static]

Cleanup the password module.

Definition at line 193 of file bsmod_password.c.

References BS_OK, BSMOD_PASSWORD_FILE, list_index(), list_size(), password_list, password_pool, runtestsuite::rv, and write_buf_into_file().

Here is the call graph for this function:

static bs_status bsmod_password_handle_service ( const bs_service_request request,
bs_service_response **  response,
void *  extra 
) [static]

Service handling routine.

Definition at line 245 of file bsmod_password.c.

References add_user(), BS_ERROR, BS_NO_SERVICE, BS_OK, create_status_response(), bs_part_instance::data, hash_string(), bs_service_request::input, list_index(), list_size(), bs_message_instance::num_parts, bs_service_request::operation, bs_message_instance::parts, password_list, bs_service_request::port, remove_user(), runtestsuite::rv, bs_service_request::service, and streq().

Here is the call graph for this function:

static bs_status bsmod_password_init ( void   )  [static]

Initialize the password module by reading the list of users.

Definition at line 144 of file bsmod_password.c.

References BS_ERROR, BS_OK, BSMOD_PASSWORD_FILE, len(), list_append(), list_index(), list_size(), new_list(), password_list, password_pool, read_file_into_buf(), runtestsuite::rv, and strtokenize().

Here is the call graph for this function:

static bs_service_response* create_status_response ( const bs_service_request request,
bs_status  status 
) [static]

Definition at line 215 of file bsmod_password.c.

References data, new_bs_data_type(), new_bs_message_instance(), new_bs_part_instance(), new_bs_service_response(), bs_service_request::operation, bs_message_instance::parts, password_pool, bs_service_request::port, bs_service_request::service, and bs_service_request::uuid.

Here is the call graph for this function:

static char* hash_string ( const char *  str  )  [static]

Calculate the SHA-1 hash of a given string and return the digest in hex form.

Parameters:
str The string to hash
Returns:
The digest of the string, in hex form.

Definition at line 77 of file bsmod_password.c.

References password_pool.

Referenced by add_user(), and bsmod_password_handle_service().

static bs_status remove_user ( const char *  name  )  [static]

Remove the named user from the list.

Parameters:
name The name of the user
Returns:
Status code.

Definition at line 126 of file bsmod_password.c.

References BS_OK, list_index(), list_remove(), list_size(), password_list, and streq().

Referenced by bsmod_password_handle_service().

Here is the call graph for this function:


Variable Documentation

bs_module bsmod_symtable

Initial value:

 {
        
        0,
        0,
        
        
        0,
        1,
        
        
        "password module",
        "M.A.Hartman",
        "may 9, 2007",
        "(c) 2007, M.A.Hartman. See distributed LICENSE file for more information.",
        "A module which offers password functions. ",
        
        
        bsmod_password_init,
        bsmod_password_cleanup,
        
        
        bsmod_password_handle_service,
        NULL,
        "bsmod_password.wsdl"
}

Definition at line 295 of file bsmod_password.c.

bs_module bsmod_symtable

Definition at line 58 of file bsmod_password.c.

bs_list* password_list

Definition at line 55 of file bsmod_password.c.

Referenced by add_user(), bsmod_password_cleanup(), bsmod_password_handle_service(), bsmod_password_init(), and remove_user().

apr_pool_t* password_pool

Definition at line 54 of file bsmod_password.c.

Referenced by add_user(), bsmod_password_cleanup(), bsmod_password_init(), create_status_response(), and hash_string().


Generated on Tue Jul 17 09:51:40 2007 for Bio-SPHERE by  doxygen 1.5.1