From 75d90856c9bb1b21df115612ca268897ceca5448 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Mon, 15 Jan 2018 00:54:35 +0200 Subject: [PATCH] Handle the reverter file registration before opening file handle --- certbot-apache/certbot_apache/http_01.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/certbot-apache/certbot_apache/http_01.py b/certbot-apache/certbot_apache/http_01.py index 4a501eb94..3b942823d 100644 --- a/certbot-apache/certbot_apache/http_01.py +++ b/certbot-apache/certbot_apache/http_01.py @@ -101,9 +101,9 @@ Alias /.well-known/acme-challenge {0} name = os.path.join(self.challenge_dir, achall.chall.encode("token")) + self.configurator.reverter.register_file_creation(True, name) with open(name, 'wb') as f: f.write(validation.encode()) - self.configurator.reverter.register_file_creation(True, name) os.chmod(name, 0o644) return response