From 22a4f361329ed4e303e2f1bdce9edf49e70970f3 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Wed, 10 Jul 2019 19:09:59 +0100 Subject: Make setting configuration option "replayseconds" optional if "replaymode" != "time". --- TODO | 2 -- blabouncer.c | 3 ++- functions.c | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 08e2f32..e60ebb9 100644 --- a/TODO +++ b/TODO @@ -1,3 +1 @@ -Make some unnecessary configuration options optional (e.g. replaytime if replaymode != "time") - Fuzzing. diff --git a/blabouncer.c b/blabouncer.c index 143b366..8f5afad 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -911,7 +911,8 @@ int main(int argc, char *argv[]) { // How many seconds of replay log should automatically be replayed - TODO - Can we do error checking on this? settings.replayseconds = getconfint("replayseconds", settings.conffile); - if (errno == ECONFINT) { + // Don't worry if replaymode != "time" + if (errno == ECONFINT && strcmp(settings.replaymode, "time") == 0) { printf("main(): error getting 'replayseconds' from configuration file.\n"); exit(1); } diff --git a/functions.c b/functions.c index a67776f..8bbc213 100644 --- a/functions.c +++ b/functions.c @@ -1104,7 +1104,8 @@ int rehash(struct settings *settings, char *failuremsg) { // How many seconds of replay log should automatically be replayed - TODO - Can we do error checking on this? int oldreplayseconds = settings->replayseconds; settings->replayseconds = getconfint("replayseconds", settings->conffile); - if (errno == ECONFINT) { + // Don't worry if replaymode != "time" + if (errno == ECONFINT && strcmp(settings->replaymode, "time") == 0) { settings->replayseconds = oldreplayseconds; strcpy(failuremsg, "error getting 'replayseconds' from configuration file"); return 0; -- cgit v1.2.3