From 02a03710dc32c3710cdbc24b12e84dfabc94310e Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Tue, 15 Aug 2023 09:51:52 +0200 Subject: [PATCH] don't try to (non-recursively) remove directories from the data tmp dir mox only creates files there. directories could be a backup that is being transferred to elsewhere. --- serve.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serve.go b/serve.go index 55327a9..52f2f54 100644 --- a/serve.go +++ b/serve.go @@ -364,7 +364,7 @@ requested, other TLS certificates are requested on demand. for _, e := range tmps { if fi, err := e.Info(); err != nil { log.Errorx("stat tmp file", err, mlog.Field("filename", e.Name())) - } else if now.Sub(fi.ModTime()) > 7*24*time.Hour { + } else if now.Sub(fi.ModTime()) > 7*24*time.Hour && !fi.IsDir() { p := filepath.Join(tmpdir, e.Name()) if err := os.Remove(p); err != nil { log.Errorx("removing stale temporary file", err, mlog.Field("path", p))