From 9df8091c0a30276b181796993b883f7e3b8f609a Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sat, 5 Dec 2015 11:42:14 -0500 Subject: fix auth again --- src/netcosm.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/netcosm.h') diff --git a/src/netcosm.h b/src/netcosm.h index d7251ad..4f04e5b 100644 --- a/src/netcosm.h +++ b/src/netcosm.h @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -14,12 +15,17 @@ #include #include #include +#include #include #define USERFILE "users.dat" #define MAX_FAILURES 3 #define NETCOSM_VERSION "v0.1" +#define PRIV_NONE -1 +#define PRIV_USER 0 +#define PRIV_ADMIN 1337 + struct authinfo_t { bool success; const char *user; @@ -30,3 +36,7 @@ void client_main(int fd, struct sockaddr_in *addr, int); void __attribute__((noreturn)) error(const char *fmt, ...); void first_run_setup(void); struct authinfo_t auth_check(const char*, const char*); + +/* add or change a user */ +bool add_change_user(const char *user2, const char *pass2, int level); +bool auth_remove(const char*); -- cgit v1.1