From 03f712e58327e5b15856082074062b22fccb30bd Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 3 Nov 2018 00:49:22 +0100 Subject: Implemented session id management and session logs in database --- src/state.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index d9577e7..dd9cbf3 100644 --- a/src/state.c +++ b/src/state.c @@ -6,10 +6,9 @@ #include "state.h" struct state { + unsigned long long session_id; char * destination; char * bastion_username; - int session_id; - int padding; // makes compiler happy }; static struct state state = {0}; @@ -59,17 +58,17 @@ const char * state_get_bastion_username(void) } char // return 0 if ok, greater than 0 otherwise -state_set_session_id(const int id) +state_set_session_id(const unsigned long long id) { if (state.session_id != 0) { - fprintf(stderr, "BUG found, attempting to overwrite state.username that has already been set\n"); + fprintf(stderr, "BUG found, attempting to set a state.session_id that has already been set\n"); return 1; } state.session_id = id; return 0; } -int state_get_session_id(void) +unsigned long long state_get_session_id(void) { return state.session_id; } -- cgit v1.2.3