summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2021-01-17 01:18:13 +0100
committerDirk Engling <erdgeist@erdgeist.org>2021-01-17 01:18:13 +0100
commit4a04baa7154a2adf736967e8b8da4916676db8ed (patch)
treec792662eb8876cfe6e2fefc010c7d162a9d74292
parentaab88fa8ebd9af971c1fc9e2f81b9cd9db538f90 (diff)
Make session log dir a command line argument
-rw-r--r--receiver.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/receiver.cpp b/receiver.cpp
index aaf9673..6064694 100644
--- a/receiver.cpp
+++ b/receiver.cpp
@@ -262,7 +262,7 @@ static void import_sessions(const char *root_dir) {
262 closedir(dirp); 262 closedir(dirp);
263} 263}
264 264
265int main() { 265int main(int args, char **argv) {
266 mbedtls_ctr_drbg_context ctr_drbg; 266 mbedtls_ctr_drbg_context ctr_drbg;
267 mbedtls_entropy_context entropy; 267 mbedtls_entropy_context entropy;
268 mbedtls_pk_context pk; 268 mbedtls_pk_context pk;
@@ -271,7 +271,9 @@ int main() {
271 unsigned char input[256]; 271 unsigned char input[256];
272 size_t inputlen = 0; 272 size_t inputlen = 0;
273 273
274 chdir("sessions"); 274 if (args != 2)
275 errx(-1, "Syntax: %s [sessionlogdir]", argv[0]);
276 chdir(argv[1]);
275 277
276 mbedtls_pk_init( &pk ); 278 mbedtls_pk_init( &pk );
277 mbedtls_entropy_init( &entropy ); 279 mbedtls_entropy_init( &entropy );