[Tails-dev] [htp] 0001-When-date-header-cannot-be-fetched-p…

Borrar esta mensaxe

Responder a esta mensaxe
Autor: Linus Nordberg
Data:  
Para: tails-dev
Asunto: [Tails-dev] [htp] 0001-When-date-header-cannot-be-fetched-print-URL-too.patch
Hi devs,

Please find attached a very minor patch for slightly improved
diagnostics in htp.

Since late February, I've seen 75 requests from 18 sites fail to
retrieve a date header:

--8<---------------cut here---------------start------------->8---
cat /var/log/htpdate.log | awk '/Could not get any Date header from/{print $8}'| sort | uniq -c | sort -rn
      8 https://encrypted.google.com
      6 https://www.stackexchange.com
      6 https://www.paypal.com
      6 https://www.myspace.com
      6 https://twitter.com
      5 https://www.duckduckgo.com
      4 https://www.sony.com
      4 https://tumblr.com
      4 https://login.yahoo.com
      4 https://lkml.org
      4 https://espiv.net
      3 https://www.privacyinternational.org
      3 https://www.mozilla.org
      3 https://www.eff.org
      3 https://www.1984.is
      2 https://www.immerda.ch
      2 https://thepiratebay.org
      2 https://en.wikipedia.org
--8<---------------cut here---------------end--------------->8---


I'm afraid I don't have any numbers on how often date header fetches
From the above sites _succeed_ so maybe not so useful.

From 3f37745585c5ac25584e6a4bb09bddc65fed13ee Mon Sep 17 00:00:00 2001
From: Linus Nordberg <linus@???>
Date: Tue, 27 Feb 2018 09:31:20 +0100
Subject: [PATCH] When date header cannot be fetched, print URL too.

For easier diagnostics of failing servers.
---
sbin/htpdate | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/htpdate b/sbin/htpdate
index 454ba8b..e6bae8f 100755
--- a/sbin/htpdate
+++ b/sbin/htpdate
@@ -244,7 +244,7 @@ sub getUrlDateDiff {

     rmtree($tmpdir);


-    defined $newestdt or error "Could not get any Date header";
+    defined $newestdt or error "Could not get any Date header from $url";
     my $newest_epoch = $newestdt->epoch();


     my $diff = $newest_epoch - $local;
-- 
2.11.0