From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9250 invoked by alias); 28 Nov 2017 15:28:14 -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 9237 invoked by uid 89); 28 Nov 2017 15:28:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= X-HELO: limerock02.mail.cornell.edu Received: from limerock02.mail.cornell.edu (HELO limerock02.mail.cornell.edu) (128.84.13.242) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Nov 2017 15:28:12 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite3.serverfarm.cornell.edu [10.16.197.8]) by limerock02.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id vASFSAWk023056 for ; Tue, 28 Nov 2017 10:28:10 -0500 Received: from [192.168.0.4] (mta-68-175-129-7.twcny.rr.com [68.175.129.7] (may be forged)) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id vASFS9RK008867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Tue, 28 Nov 2017 10:28:10 -0500 Subject: Re: [PATCH setup 0/3] Fix "extrakeys" issues To: cygwin-apps@cygwin.com References: <20171128145605.12860-1-kbrown@cornell.edu> From: Ken Brown Message-ID: Date: Tue, 28 Nov 2017 15:28:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.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-PMX-Cornell-Gauge: Gauge=XXXXX X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none; X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00124.txt.bz2 On 11/28/2017 9:56 AM, 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. I've now made a pretty complete search, and the only use of a comment in setup.rc I can find is the one in site.cc. When reading and writing lists of URLs, it treats '#' as a comment only at the beginning of a line. So I think my change is safe. Ken