summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-12-16 16:48:58 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-12-16 16:48:58 +0100
commit7f7041b1ff851bed8932fecb8d2a4a991d177721 (patch)
tree1de2227f8502436aaa2de0217e91155f7d66e30f /src/fastd.c
parent8e9c9bc6ec2877f73e0ecdfd25fbf96464f08885 (diff)
downloadfastd-7f7041b1ff851bed8932fecb8d2a4a991d177721.tar
fastd-7f7041b1ff851bed8932fecb8d2a4a991d177721.zip
Never write to syslog/log files during key generation
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fastd.c b/src/fastd.c
index c75fa9b..3cc7d37 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -133,6 +133,8 @@ static void init_log(fastd_context_t *ctx) {
ctx->log_files = file;
}
+ ctx->log_initialized = true;
+
if (seteuid(uid) < 0)
pr_debug_errno(ctx, "seteuid");
if (setegid(gid) < 0)
@@ -757,15 +759,11 @@ int main(int argc, char *argv[]) {
fastd_config_t conf;
fastd_configure(&ctx, &conf, argc, argv);
- init_log(&ctx);
-
if (conf.generate_key) {
conf.protocol->generate_key(&ctx);
exit(0);
}
- init_signals(&ctx);
-
conf.protocol_config = conf.protocol->init(&ctx);
if (conf.show_key) {
@@ -773,6 +771,9 @@ int main(int argc, char *argv[]) {
exit(0);
}
+ init_log(&ctx);
+ init_signals(&ctx);
+
update_time(&ctx);
conf.long_ago = ctx.now;