Adding upstream version 4.02+dfsg.
[syslinux-debian/hramrach.git] / com32 / cmenu / libmenu / passwords.h
blob2e0ec27c6444c75700bead1c4e5307c2c0acd5aa
1 #ifndef _PASSWORDS_H_
2 #define _PASSWORDS_H_
4 char authenticate_user(const char *username, const char *pwd);
6 char isallowed(const char *username, const char *perm);
8 // Initialise the list of of user passwords permissions from file
9 void init_passwords(const char *filename);
10 // Free all space used for internal data structures
11 void close_passwords(void);
13 #define MAX_USERS 128 // Maximum number of users
14 #define USERNAME_LENGTH 12 // Max length of user name
15 #define PWDHASH_LENGTH 40 // Max lenght of pwd hash
17 typedef struct {
18 char username[USERNAME_LENGTH + 1];
19 char pwdhash[PWDHASH_LENGTH + 1];
20 char *perms; // pointer to string containing ":" delimited permissions
21 } pwdentry;
23 typedef pwdentry *p_pwdentry;
25 #define GUEST_USER "guest"
27 #endif