From patchwork Tue Sep 22 09:05:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Darbyshire-Bryant X-Patchwork-Id: 520887 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7EC7414012C for ; Tue, 22 Sep 2015 19:05:48 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 75CFF28C6C0; Tue, 22 Sep 2015 11:04:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAD_ENC_HEADER,BAYES_00 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 97C2328C6BF for ; Tue, 22 Sep 2015 11:04:21 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 HELO_IP_IN_CL_SUBNET=-1.2 (check from: .darbyshire-bryant. - helo: .emea01-db3-obe.outbound.protection.outlook. - helo-domain: .outlook.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7.7 Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0083.outbound.protection.outlook.com [157.55.234.83]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 22 Sep 2015 11:04:20 +0200 (CEST) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kevin@darbyshire-bryant.me.uk; Received: from Animal.darbyshire-bryant.me.uk (151.226.15.214) by AM2PR07MB0932.eurprd07.prod.outlook.com (10.162.37.14) with Microsoft SMTP Server (TLS) id 15.1.268.17; Tue, 22 Sep 2015 09:05:34 +0000 From: Kevin Darbyshire-Bryant To: Date: Tue, 22 Sep 2015 10:05:18 +0100 Message-ID: <1442912718-6840-1-git-send-email-kevin@darbyshire-bryant.me.uk> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [151.226.15.214] X-ClientProxiedBy: AM2PR03CA0083.eurprd03.prod.outlook.com (25.162.68.179) To AM2PR07MB0932.eurprd07.prod.outlook.com (25.162.37.14) X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0932; 2:TCYV7v4vY2I1MP1+uQEyOYZQ8vmyIXHMWAcbnlJqpeF7MptG3PIW1yGAwblQA7KgP6Hqn0QrDUnsV4otre94DY2OYEMmkTc+bYli2V8gK+dOM+8ICzbOKFLCBAMMAjmc23EclA1Ug7vHF0q0+xtqNxBTJuPKJMgzZFioQy0KGuY=; 3:LWsSFdvZD+AO9fz7i4x6jGVL/e3EdMuTxQmYuq5lewV9H+JwdiwZw2FUKSbKS9SrKOK+bc7gt5QhGkJ1uA3fQKNE8mzoVtDk70gRKEiGQ2VdFL/78TKxMfl3h/LBa6EFrSr88QpOcC+HPP2OUpFHCA==; 25:2UUUqMmLP2P36jVZ8Ai07DpMpyerYy5WBTMCNvV9CkhePLJmIAx1mZldnEeJSpBncFudDsigSI1j7AlRKZ6/jKy4NKWY5U0KGtOfDgJwmIw7v+DSWKRwSwyAceKEoTFSofjvm+bgTgQvV6Yoza/rqOiPNevU3r7uN8wDvA5zhuxS3m5q+xjMoTxOYhZWNg5jeBS+k0moGKqhOpIa4/JjyUadZfNCy9tUCE+hWVEdOPrfgBbOOn1lrIYGLYr+HjFr7QU7QXhV0HE3qccRt2BOPQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM2PR07MB0932; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001); SRVR:AM2PR07MB0932; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0932; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0932; 4:IomzsRGpnSnpJqhm4AtX+wAJEOgctbNbM5kAZ1851AXBGxg8lFaNCPLZ3VlNVyrNg/cadjVyN7cOT7+tdsYn1S5kSASQShkBP8NiauZSM2/ZM2+R8Y5umqLRR5gvo3YWjlB5TZwqTRxu7B/UoqVShC8BCwORbz9l7TbftN/3D77MI4sB0276UuA4uLcIoYQPGYzsSW9NrrcCJAAEimE+g4Hg+H027X0oMKckqdEMHg7g/fKnMP/WNp+PeCojdpWvQySkng4IBVXgBCmm7wPIjk8AZTyU/4/cILMK2cRhht1KUyqqTvFBf+rdpw4zJr+9fQ1nlYVGYYjQ3SYTLqbiOP9MPYQjmlX2xyYccGQfsmw= X-Forefront-PRVS: 0707248B64 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(189002)(199003)(53416004)(5001960100002)(105586002)(19580405001)(110136002)(66066001)(229853001)(47776003)(36756003)(5001920100001)(50986999)(42186005)(2351001)(86362001)(68736005)(450100001)(50226001)(106356001)(107886002)(19580395003)(92566002)(189998001)(77156002)(81156007)(48376002)(74482002)(101416001)(69596002)(62966003)(5001860100001)(46102003)(5004730100002)(5003940100001)(50466002)(33646002)(122386002)(97736004)(87976001)(64706001)(5001830100001)(5007970100001)(77096005)(4001540100001)(40100003)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR07MB0932; H:Animal.darbyshire-bryant.me.uk; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: darbyshire-bryant.me.uk does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR07MB0932; 23:8Tmt4P5+5bsLDyC1XvGa2AUyHMwzOsY/3wsoywQje?=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pisvWnRMxaLoQaQRlhstYeJGodlZG8XVc9Wsf7Rgv0W7BnR5A?= =?us-ascii?Q?fAzySZG48Qfb5mQ2HNag04bv6Q2LA2cAWuOh1lPsbeQD+Cn2HyyMM1vOUXuq?= =?us-ascii?Q?Rq3+WmZpjsW3bQO6Kgy+a1SglM/GlPSq46nNQQik1taSEGMvIrLbZPBE+nj9?= =?us-ascii?Q?R5KCyQnCIO2k6v5wDDkvQ0IS/mNdgORsVXs3DrZ7erH1h15BN3xZAF0oyaE4?= =?us-ascii?Q?e3TQzlTL5K4zvShENnyzVCNsFt5nLdosOZ1hkFpi/kH0jqcgWQjnfbSbpzOM?= =?us-ascii?Q?j+YGUikDsF+LMdLUH6z8O1R2apTHEAyDLFvgiF3YA+k4nM87QPg1wPbtHHNp?= =?us-ascii?Q?yYPZsSXcjW4MddnqK+Jo7KVEFsbCg3OBrCQQwPjDq8xofvTM18/fl8pE6WKT?= =?us-ascii?B?dz09?= X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0932; 5:uw9yVLTRSqHug5ewcDHGebYPx7Zyo+ytFRY+5rk+AjN6c2OjHFPBd5TdXdMNRj1CMnv8OqhQStL4FTs8arOTY3u5Tthn5l+A9VmqVGQSIYOHt/ECNMgAhF/PRLtfEAYZI1gYzr18rASRRJv9g+dTVQ==; 24:YFw9Be6YOu4/ab4R4qFcRAJY0Ja5vKWjxw9X5Xa6cub2rICk+uPzdpgxfVI2VKbdbAylFiMi4TzTscu5euphLk7VLVPh2a3LfhZeOPkMRP0=; 20:vLKdXT/o+oNnHuEUqiNRQ19PSsTXfyAPOGLVQo/zqOi8m+llWvH0KZ9IHZpSqKQfx6sPEy0bZzj0SzALji2LCQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: darbyshire-bryant.me.uk X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2015 09:05:34.5618 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR07MB0932 Subject: [OpenWrt-Devel] [PATCH] base-files: sysfixtime exclude dnsmasq.time X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" dnsmasq maintains dnsmasq.time across reboots and uses it as a means of determining if current time is good enough to validate dnssec time stamps. By including /etc/dnsmasq.time as a time source for sysfixtime, the mechanism was effectively defeated because time was set to the last time that dnsmasq considered current even though that time is in the past. Since that time is out of date, dns(sec) resolution would fail thus defeating any ntp based mechanisms for setting the clock correctly. In theory the process is defeated by any files in /etc that are newer than /etc/dnsmasq.time however dnsmasq now updates the file's timestamp on process TERM so hopefully /etc/dnsmasq.time is the latest file timestamp in /etc as part of openWrt shutdown/reboot. Either way, including /etc/dnsmasq.time as a time source for sysfixtime is not helpful. Signed-off-by: Kevin Darbyshire-Bryant --- package/base-files/files/etc/init.d/sysfixtime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/etc/init.d/sysfixtime b/package/base-files/files/etc/init.d/sysfixtime index 4010e06..218ef20 100755 --- a/package/base-files/files/etc/init.d/sysfixtime +++ b/package/base-files/files/etc/init.d/sysfixtime @@ -5,7 +5,7 @@ START=00 boot() { local curtime="$(date +%s)" - local maxtime="$(find /etc -type f -exec date -r {} +%s \; | sort -nr | head -n1)" + local maxtime="$(find /etc -type f -path /etc/dnsmasq.time -prune -o -exec date -r {} +%s \; | sort -nr | head -n1)" [ $curtime -lt $maxtime ] && date -s @$maxtime }