Krzysztof Piotr Oledzki | 9610504 | 2010-01-29 17:50:44 +0100 | [diff] [blame] | 1 | /* |
| 2 | * User authentication & authorization. |
| 3 | * |
| 4 | * Copyright 2010 Krzysztof Piotr Oledzki <ole@ans.pl> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | */ |
| 12 | |
| 13 | #ifndef _TYPES_AUTH_H |
| 14 | #define _TYPES_AUTH_H |
| 15 | |
| 16 | #include <common/config.h> |
| 17 | #include <common/mini-clist.h> |
| 18 | |
| 19 | #include <types/auth.h> |
| 20 | |
| 21 | #define MAX_AUTH_GROUPS (unsigned int)(sizeof(int)*8) |
| 22 | |
| 23 | #define AU_O_INSECURE 0x00000001 /* insecure, unencrypted password */ |
| 24 | |
Krzysztof Piotr Oledzki | 9610504 | 2010-01-29 17:50:44 +0100 | [diff] [blame] | 25 | struct auth_users { |
| 26 | struct auth_users *next; |
| 27 | unsigned int flags; |
| 28 | char *user, *pass; |
| 29 | union { |
| 30 | char *groups; |
| 31 | unsigned int group_mask; |
Willy Tarreau | b4c06b7 | 2010-02-02 11:28:20 +0100 | [diff] [blame] | 32 | } u; |
Krzysztof Piotr Oledzki | 9610504 | 2010-01-29 17:50:44 +0100 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | struct userlist { |
| 36 | struct userlist *next; |
| 37 | char *name; |
| 38 | struct auth_users *users; |
| 39 | int grpcnt; |
| 40 | char *groups[MAX_AUTH_GROUPS]; |
| 41 | char **groupusers; |
| 42 | }; |
| 43 | |
| 44 | #endif /* _TYPES_AUTH_H */ |
| 45 | |
| 46 | /* |
| 47 | * Local variables: |
| 48 | * c-indent-level: 8 |
| 49 | * c-basic-offset: 8 |
| 50 | * End: |
| 51 | */ |
| 52 | |