aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2019-02-14 20:51:41 +0100
committerJulien Dessaux2019-02-14 21:07:27 +0100
commita3f34674c6317930362c99f0fc40d835234843e5 (patch)
tree6c4c3afa605acf567b6b5997db4a3277738c9c68
parentSwitched from standard makefile to cmake (diff)
downloadbastion-a3f34674c6317930362c99f0fc40d835234843e5.tar.gz
bastion-a3f34674c6317930362c99f0fc40d835234843e5.tar.bz2
bastion-a3f34674c6317930362c99f0fc40d835234843e5.zip
Moved code around
-rw-r--r--CMakeLists.txt4
-rw-r--r--bastion/CMakeLists.txt (renamed from src/CMakeLists.txt)3
-rw-r--r--bastion/client.c (renamed from src/client.c)0
-rw-r--r--bastion/client.h (renamed from src/client.h)0
-rw-r--r--bastion/main.c (renamed from src/main.c)0
-rw-r--r--bastion/proxy.c (renamed from src/proxy.c)0
-rw-r--r--bastion/proxy.h (renamed from src/proxy.h)0
-rw-r--r--bastion/recording.c (renamed from src/recording.c)0
-rw-r--r--bastion/recording.h (renamed from src/recording.h)0
-rw-r--r--bastion/session.c (renamed from src/session.c)0
-rw-r--r--bastion/session.h (renamed from src/session.h)0
-rw-r--r--bastion/state.c (renamed from src/state.c)0
-rw-r--r--bastion/state.h (renamed from src/state.h)0
-rw-r--r--common/CMakeLists.txt3
-rw-r--r--common/mysql.c (renamed from src/mysql.c)0
-rw-r--r--common/mysql.h (renamed from src/mysql.h)0
-rw-r--r--config.h3
17 files changed, 8 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3234c1..d542ec0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,5 +10,7 @@ set(CMAKE_C_FLAGS_RELEASE "-Os")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os -g")
option(LIBSSH_VERBOSE_OUTPOUT "whether or not verbose output for libssh mode is activated" OFF)
+option(SESSION_RECORDING "whether or not recording feature based on lib termrec is activated" ON)
-add_subdirectory(src)
+add_subdirectory(bastion)
+add_subdirectory(common)
diff --git a/src/CMakeLists.txt b/bastion/CMakeLists.txt
index f885850..aab97e4 100644
--- a/src/CMakeLists.txt
+++ b/bastion/CMakeLists.txt
@@ -1,9 +1,10 @@
include_directories("${bastion_SOURCE_DIR}/termrec/libtty/")
+include_directories("${bastion_SOURCE_DIR}/common")
file(GLOB_RECURSE SOURCES *.c)
add_executable(bastion ${SOURCES})
add_library(libtty.a STATIC IMPORTED)
set_property(TARGET libtty.a PROPERTY IMPORTED_LOCATION "${bastion_SOURCE_DIR}/libtty.a")
-target_link_libraries(bastion libtty.a)
+target_link_libraries(bastion libtty.a common)
target_link_libraries(bastion bz2 curl lzma mysqlclient pthread ssh z)
diff --git a/src/client.c b/bastion/client.c
index 11757fc..11757fc 100644
--- a/src/client.c
+++ b/bastion/client.c
diff --git a/src/client.h b/bastion/client.h
index 307b115..307b115 100644
--- a/src/client.h
+++ b/bastion/client.h
diff --git a/src/main.c b/bastion/main.c
index 6ea6bcb..6ea6bcb 100644
--- a/src/main.c
+++ b/bastion/main.c
diff --git a/src/proxy.c b/bastion/proxy.c
index 7d410db..7d410db 100644
--- a/src/proxy.c
+++ b/bastion/proxy.c
diff --git a/src/proxy.h b/bastion/proxy.h
index 0e42bdc..0e42bdc 100644
--- a/src/proxy.h
+++ b/bastion/proxy.h
diff --git a/src/recording.c b/bastion/recording.c
index 7692ff1..7692ff1 100644
--- a/src/recording.c
+++ b/bastion/recording.c
diff --git a/src/recording.h b/bastion/recording.h
index fec76af..fec76af 100644
--- a/src/recording.h
+++ b/bastion/recording.h
diff --git a/src/session.c b/bastion/session.c
index 3d3b1b7..3d3b1b7 100644
--- a/src/session.c
+++ b/bastion/session.c
diff --git a/src/session.h b/bastion/session.h
index d0c8eab..d0c8eab 100644
--- a/src/session.h
+++ b/bastion/session.h
diff --git a/src/state.c b/bastion/state.c
index dd9cbf3..dd9cbf3 100644
--- a/src/state.c
+++ b/bastion/state.c
diff --git a/src/state.h b/bastion/state.h
index 0ab70bc..0ab70bc 100644
--- a/src/state.h
+++ b/bastion/state.h
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
new file mode 100644
index 0000000..8636758
--- /dev/null
+++ b/common/CMakeLists.txt
@@ -0,0 +1,3 @@
+file(GLOB_RECURSE SOURCES *.c)
+
+ADD_LIBRARY(common STATIC ${SOURCES})
diff --git a/src/mysql.c b/common/mysql.c
index 0931116..0931116 100644
--- a/src/mysql.c
+++ b/common/mysql.c
diff --git a/src/mysql.h b/common/mysql.h
index 8c6040f..8c6040f 100644
--- a/src/mysql.h
+++ b/common/mysql.h
diff --git a/config.h b/config.h
index 2823095..6f773cb 100644
--- a/config.h
+++ b/config.h
@@ -14,11 +14,8 @@
#define MYSQL_PASS "graou"
#define MYSQL_DB "sshportal"
-#define SESSION_RECORDING // comment this to deactivate
#define LOG_FILENAME_FORMAT "./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
-#define LIBSSH_VERBOSE_OUTPOUT // comment this to deactivate
-
#endif