GNU bug report logs -
#12511
24.1; parse-netrc does not properly handle newlines
Previous Next
Reported by: Erik Hetzner <egh <at> e6h.org>
Date: Tue, 25 Sep 2012 06:36:02 UTC
Severity: normal
Merged with 22081
Found in versions 24.1, 24.5
Done: Ted Zlatanov <tzz <at> lifelogs.com>
Bug is archived. No further changes may be made.
Full log
Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):
On Wed, 26 Sep 2012 07:46:53 -0700 Erik Hetzner <egh <at> e6h.org> wrote:
EH> At Tue, 25 Sep 2012 18:12:27 -0400,
EH> Glenn Morris wrote:
>>
>> Just to comment that there is also ange-ftp-parse-netrc, which looks
>> like it might handle newlines. I don't know why Emacs needs this and
>> also netrc-parse (and also tramp-parse-netrc).
Sorry for the late reply.
Basically, the answer is "cruft."
`ange-ftp-parse-netrc' is a very different beast from the auth-source
netrc parser. It mixes file handling, security checks, and other
functionality with the actual parsing. It doesn't handle queries on the
parsed contents, limiting the number of matches, or enclosing the
password token in a closure so it's not visible when printed (this is an
auth-source feature: all passwords it returns are thus enclosed).
The original auth-source netrc parser came from Gnus' netrc.el parser
but also got the features above and more. Gnus used to be a standalone
package that had to work with Emacs and XEmacs so I assume it needed a
standalone reliable netrc parser... Perhaps `tramp-parse-netrc' was
motivated similarly.
I didn't remove netrc.el because other packages may use it and may even
depend on its particular parsing behavior. But Gnus doesn't, AFAIK.
EH> And, in fact, it seems my problem with auth-source-netrc-parse, which
EH> url.el uses.
EH> So: netrc-parse, tramp-parse-netrc, and auth-source-netrc-parse all do
EH> not handle linefeeds in ~/.netrc files.
EH> ange-ftp-parse-netrc, on the other hand, does.
EH> For what it’s worth, I didn’t create a ~/.netrc file myself with
EH> linefeeds; it was created for me by other software.
I've comitted a new version of the auth-source netrc parser to the Gnus
repo (it will be synchronized to Emacs later) that can handle
single-quoted strings and multiline entries. Basically what "man netrc"
says it should, except for "macdef" which I have never seen in the wild.
I've tested the code but please let me know if it works for you.
Ted
This bug report was last modified 9 years and 159 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.