From 10836ebf5e2fc75b834e02fac0c0cd80cb1f5fc6 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Mon, 25 Jan 2021 13:33:37 +1000 Subject: [PATCH] * misc fixes --- src/daemon.c | 4 ++-- src/jail.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/daemon.c b/src/daemon.c index 91403ef..ed8e69c 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -280,9 +280,9 @@ int main(int argc, char *argv[]) { if (appconfig.nice != 0) { errno = 0; - nice(appconfig.nice); - if (errno) + if (nice(appconfig.nice) == -1 && errno) { f2b_log_msg(log_warn, "can't set process priority: %s", strerror(errno)); + } } if (appconfig.coredumps) { diff --git a/src/jail.c b/src/jail.c index 44556ff..48ac4ee 100644 --- a/src/jail.c +++ b/src/jail.c @@ -150,6 +150,7 @@ f2b_jail_set_defaults(f2b_config_section_t *section) { assert(section != NULL); assert(section->type == t_defaults); + strlcpy(defaults.name, "default", sizeof(defaults.name)); /* can't init before */ f2b_jail_apply_config(&defaults, section); return;