gcrypt: Always initialize result pointer.
[paraslash.git] / user_list.h
1 /*
2  * Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>
3  *
4  * Licensed under the GPL v2. For licencing details see COPYING.
5  */
6
7 /** \file user_list.h exported functions from user_list.c */
8
9 /**
10  * Flags for server commands and user permissions.
11  *
12  * For each command, zero or more of these flags are ored to define the command
13  * permissions. A user is allowed to run the command if and only if all command
14  * permission flags are set for the user in the server.users config file which
15  * is read at server startup.
16  */
17 enum server_command_permissions {
18         AFS_READ = 1, /** Read-only operation on the AFS database. */
19         AFS_WRITE = 2, /** Read-write operation on the AFS database. */
20         VSS_READ = 4, /** Read-only operation on the virtual streaming system. */
21         VSS_WRITE = 8 /** Read-write operation on the virtual streaming system. */
22 };
23
24 /**
25  * data needed to authenticate the user
26  */
27 struct user {
28         /** The position of this user in the list of users. */
29         struct list_head node;
30         /** The username. */
31         char *name;
32         /** The public key. */
33         struct asymmetric_key *pubkey;
34         /** The privileges of this user. */
35         unsigned int perms;
36 };
37
38 void init_user_list(char *user_list_file);
39 struct user *lookup_user(const char *name);