From 75f3c6403b47b490e41a8e6a863700524813e4f9 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 5 Mar 2018 11:58:31 +0100 Subject: [PATCH] Print absolute paths when file caches cannot be written --- dnscrypt-proxy/sources.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dnscrypt-proxy/sources.go b/dnscrypt-proxy/sources.go index 83b6fb22..95687de5 100644 --- a/dnscrypt-proxy/sources.go +++ b/dnscrypt-proxy/sources.go @@ -9,6 +9,7 @@ import ( "net/http" "net/url" "os" + "path/filepath" "strings" "time" "unicode" @@ -170,12 +171,16 @@ func NewSource(xTransport *XTransport, url string, minisignKeyStr string, cacheF } if !cached { if err = AtomicFileWrite(cacheFile, []byte(in)); err != nil { - dlog.Warnf("%s: %s", cacheFile, err) + if absPath, err2 := filepath.Abs(cacheFile); err2 == nil { + dlog.Warnf("%s: %s", absPath, err) + } } } if !sigCached { if err = AtomicFileWrite(sigCacheFile, []byte(sigStr)); err != nil { - dlog.Warnf("%s: %s", sigCacheFile, err) + if absPath, err2 := filepath.Abs(sigCacheFile); err2 == nil { + dlog.Warnf("%s: %s", absPath, err) + } } } dlog.Noticef("Source [%s] loaded", url)