chiark / gitweb /
load-private: Use cfgfile_log, not system_log
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 16:30:17 +0000 (16:30 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:54 +0000 (21:56 +0000)
Otherwise if this goes wrong, we segfault, because system_log is in
fact not available this early.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
privcache.c

index b3c3e65585aa9fdd25a1c230b6cdf4602ccbddf5..5377c9049452500d36ce409cdee35fdcfc575f31 100644 (file)
@@ -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);