Adding debian version 3.35-1.
[syslinux-debian/hramrach.git] / menu / libmenu / passwords.h
blob00e5702dbd6963e06c98957228885dfaa5299d01
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();
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