diff options
author | Julien Dessaux | 2018-08-26 15:55:38 +0200 |
---|---|---|
committer | Julien Dessaux | 2018-08-26 16:04:11 +0200 |
commit | beff818f25ae69cfe8501e18271b2509320de8df (patch) | |
tree | d132e9d366aaebac9f7b91b8a63fcafbbe550af8 /src/main.c | |
parent | Added address sanitization and fixed found bugs (diff) | |
download | bastion-beff818f25ae69cfe8501e18271b2509320de8df.tar.gz bastion-beff818f25ae69cfe8501e18271b2509320de8df.tar.bz2 bastion-beff818f25ae69cfe8501e18271b2509320de8df.zip |
Added session recording with https://github.com/kilobyte/termrec
Diffstat (limited to '')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -14,12 +14,13 @@ static void sigchld_handler(int signo) { } /* SIGINT handler for cleaning up on forced exit. */ -static ssh_bind sshbind; -static ssh_session session; +static ssh_bind sshbind = NULL; +static ssh_session session = NULL; __attribute__((noreturn)) static void sigint_handler(int signo) { (void) signo; + ssh_disconnect(session); ssh_free(session); ssh_bind_free(sshbind); ssh_finalize(); @@ -75,8 +76,10 @@ int main() fprintf(stderr, "Error initializing ssh_session\n"); break; } +#ifdef LIBSSH_VERBOSE_OUTPOUT int verbosity = SSH_LOG_PROTOCOL; ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity); +#endif // Blocks until there is a new incoming connection if (ssh_bind_accept(sshbind,session) == SSH_OK){ @@ -87,6 +90,7 @@ int main() sigaction(SIGCHLD, &sa, NULL); /* Remove socket binding, which allows us to restart the parent process, without terminating existing sessions. */ ssh_bind_free(sshbind); + sshbind = NULL; ssh_event event = ssh_event_new(); if (event != NULL) { |