From: Ian Jackson Date: Sat, 7 Dec 2019 16:30:17 +0000 (+0000) Subject: load-private: Use cfgfile_log, not system_log X-Git-Tag: v0.6.0~37 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=secnet.git;a=commitdiff_plain;h=af36a51646d7021cfc0e066733cc8c8c3bf78279 load-private: Use cfgfile_log, not system_log Otherwise if this goes wrong, we segfault, because system_log is in fact not available this early. Signed-off-by: Ian Jackson --- diff --git a/privcache.c b/privcache.c index b3c3e65..5377c90 100644 --- a/privcache.c +++ b/privcache.c @@ -236,10 +236,13 @@ static list_t *loadprivate_apply(closure_t *self, struct cloc loc, struct hash_if *defhash= find_cl_if(context,"hash",CL_HASH,False,"load-private",loc); + struct cfgfile_log log; + cfgfile_log_init(&log,loc,"load-private"); + struct sigprivkey_if *sigpriv; closure_t *cl; bool_t ok= - uncached_load_file(sch,path,&databuf,defhash,&sigpriv,&cl,system_log); + uncached_load_file(sch,path,&databuf,defhash,&sigpriv,&cl,&log.log); if (!ok) cfgfatal(loc,"load-private","private key loading failed"); BUF_FREE(&databuf);