aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJulien Dessaux2019-03-14 17:40:04 +0100
committerJulien Dessaux2019-03-14 17:40:04 +0100
commit3933311d47b236aec9c92b8b64f3a94d6b031a79 (patch)
treecdfa5b07dc80e86f661237b98c587d1752c2bd9f /common
parentFixed build problem with SESSION_RECORDING flag set to OFF and updated the re... (diff)
downloadbastion-3933311d47b236aec9c92b8b64f3a94d6b031a79.tar.gz
bastion-3933311d47b236aec9c92b8b64f3a94d6b031a79.tar.bz2
bastion-3933311d47b236aec9c92b8b64f3a94d6b031a79.zip
Use proper directories configuration from cmake
Diffstat (limited to 'common')
-rw-r--r--common/CMakeLists.txt1
-rw-r--r--common/config.h.in21
-rw-r--r--common/mysql.c2
3 files changed, 23 insertions, 1 deletions
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 8636758..2de8714 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -1,3 +1,4 @@
+include_directories("${CMAKE_CURRENT_BINARY_DIR}")
file(GLOB_RECURSE SOURCES *.c)
ADD_LIBRARY(common STATIC ${SOURCES})
diff --git a/common/config.h.in b/common/config.h.in
new file mode 100644
index 0000000..1263c7c
--- /dev/null
+++ b/common/config.h.in
@@ -0,0 +1,21 @@
+#ifndef COMMON_CONFIG_H_
+#define COMMON_CONFIG_H_
+
+#define LISTEN_PORT 2222
+#define MAX_HOSTNAME_LENGTH 64
+#define MAX_USERNAME_LENGTH 64
+
+#define DSAKEY_PATH "@CMAKE_INSTALL_PREFIX@/etc/ssh_host_dsa_key"
+#define RSAKEY_PATH "@CMAKE_INSTALL_PREFIX@/etc/ssh_host_rsa_key"
+#define ECDSAKEY_PATH "@CMAKE_INSTALL_PREFIX@/etc/ssh_host_ecdsa_key"
+
+#define MYSQL_HOST "localhost"
+#define MYSQL_USER "sshportal"
+#define MYSQL_PASS "graou"
+#define MYSQL_DB "sshportal"
+
+#define LOG_FILENAME_FORMAT "@CMAKE_INSTALL_PREFIX@/var/log/$d/$h/$u/$i.gz" // $d : date in iso format, $h : hostname, $u : username : $i session id
+#define LOG_FILENAME_MAX_LEN 255
+#define LOG_DIRECTORY_MODE S_IRUSR | S_IWUSR | S_IXUSR
+
+#endif
diff --git a/common/mysql.c b/common/mysql.c
index 0931116..83a7930 100644
--- a/common/mysql.c
+++ b/common/mysql.c
@@ -4,7 +4,7 @@
#include <stdio.h>
#include <string.h>
-#include "../config.h"
+#include "config.h"
#include "mysql.h"
static MYSQL *db;