From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102923 invoked by alias); 30 Nov 2017 12:53:33 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 100165 invoked by uid 89); 30 Nov 2017 12:53:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=Hx-languages-length:1724, Hx-spam-relays-external:ESMTPA X-HELO: out4-smtp.messagingengine.com Received: from out4-smtp.messagingengine.com (HELO out4-smtp.messagingengine.com) (66.111.4.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 Nov 2017 12:53:25 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EF17D20D61 for ; Thu, 30 Nov 2017 07:53:23 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Thu, 30 Nov 2017 07:53:23 -0500 X-ME-Sender: Received: from [192.168.1.102] (host86-179-113-49.range86-179.btcentralplus.com [86.179.113.49]) by mail.messagingengine.com (Postfix) with ESMTPA id 8C47A24EE1 for ; Thu, 30 Nov 2017 07:53:23 -0500 (EST) Subject: Re: [PATCH setup 0/3] Fix "extrakeys" issues To: cygwin-apps@cygwin.com References: <20171128145605.12860-1-kbrown@cornell.edu> From: Jon Turney Message-ID: Date: Thu, 30 Nov 2017 12:53:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171128145605.12860-1-kbrown@cornell.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-11/txt/msg00125.txt.bz2 On 28/11/2017 14:56, Ken Brown wrote: > The "extrakeys" user setting contains saved extra gpg keys. It was > introduced in 2009 to replace the use of a file > /etc/setup/last-extrakeys. It has apparently never worked right. > Here are the issues I've found: > > - User settings are read and written as NUL-terminated strings, but > extra keys are terminated by LF instead. On writing, this causes > garbage to be written into setup.rc. On reading, this causes the > final saved key to be discarded. > > - The ExtraKeysSetting constructor calls count_keys() without setting > bufsize to a positive value. This causes *all* saved keys to be > discarded. > > - Saved keys contain several '#' characters. These are treated as > comment characters in setup.rc, so that all keys are truncated when > read. > > - There are still references to the "last-extrakeys" file in comments > and in a help string. > > This patch series attempts to fix all these problems. In the case of > '#', the fix is to treat '#' as a comment character only if it's the > first non-whitespace character on a line. I don't think this will > cause problems for any existing uses of '#', but I haven't done a > thorough check of this yet. Comments in setup.rc seem to have very little value (since they will be destroyed the next time setup writes it) > > Ken Brown (3): > Fix the reading and writing of the "extrakeys" user setting > Change the interpretation of '#' in setup.rc > Remove references to "last-extrakeys" > > KeysSetting.cc | 9 ++++++++- > KeysSetting.h | 2 +- > UserSettings.cc | 8 ++++---- > crypto.cc | 8 ++++---- > 4 files changed, 17 insertions(+), 10 deletions(-) Great. Please apply.