paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Functions
user_list.c File Reference

User handling for para_server. More...

#include <regex.h>
#include <sys/types.h>
#include "para.h"
#include "error.h"
#include "crypt.h"
#include "fd.h"
#include "string.h"
#include "list.h"
#include "user_list.h"

Functions

void user_list_deplete (void)
 Remove all entries from the user list. More...
 
void user_list_init (const char *user_list_file)
 Initialize the list of users allowed to connect to para_server. More...
 
const struct useruser_list_lookup (const char *name)
 Lookup a user in the user list. More...
 

Detailed Description

User handling for para_server.

Function Documentation

◆ user_list_deplete()

void user_list_deplete ( void  )

Remove all entries from the user list.

This is called on shutdown and when the user list is reloaded because the server received SIGHUP.

References list_for_each_entry_safe.

Referenced by user_list_init().

◆ user_list_init()

void user_list_init ( const char *  user_list_file)

Initialize the list of users allowed to connect to para_server.

Parameters
user_list_fileThe file containing access information.

If this function is called for the second time, the contents of the previous call are discarded, i.e. the user list is reloaded.

This function either succeeds or calls exit(3).

References user_list_deplete().

◆ user_list_lookup()

const struct user* user_list_lookup ( const char *  name)

Lookup a user in the user list.

Parameters
nameThe name of the user.
Returns
A pointer to the corresponding user struct if the user was found, NULL otherwise.

References list_for_each_entry.