This is the mail archive of the
mailing list for the Cygwin project.
Re: [PATCH setup 0/3] Fix "extrakeys" issues
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin-apps at cygwin dot com
- Date: Tue, 28 Nov 2017 10:28:11 -0500
- Subject: Re: [PATCH setup 0/3] Fix "extrakeys" issues
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
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
- Saved keys contain several '#' characters. These are treated as
comment characters in setup.rc, so that all keys are truncated when
- 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.