diff options
| author | Franklin Wei <git@fwei.tk> | 2015-12-05 11:42:14 -0500 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2015-12-05 11:42:14 -0500 |
| commit | 9df8091c0a30276b181796993b883f7e3b8f609a (patch) | |
| tree | df725b4475226e89628b7e912f019ec7ae636893 /src/netcosm.h | |
| parent | bbeb7cda3071c7a872ee9c5127e02983b25efda0 (diff) | |
| download | netcosm-9df8091c0a30276b181796993b883f7e3b8f609a.zip netcosm-9df8091c0a30276b181796993b883f7e3b8f609a.tar.gz netcosm-9df8091c0a30276b181796993b883f7e3b8f609a.tar.bz2 netcosm-9df8091c0a30276b181796993b883f7e3b8f609a.tar.xz | |
fix auth again
Diffstat (limited to 'src/netcosm.h')
| -rw-r--r-- | src/netcosm.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 <arpa/inet.h> +#include <ctype.h> #include <errno.h> #include <fcntl.h> #include <gcrypt.h> @@ -14,12 +15,17 @@ #include <sys/socket.h> #include <sys/types.h> #include <sys/wait.h> +#include <time.h> #include <unistd.h> #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*); |