all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: 12511@debbugs.gnu.org
Subject: bug#12511: 24.1; parse-netrc does not properly handle newlines
Date: Sat, 15 Jun 2013 04:18:57 -0400	[thread overview]
Message-ID: <m2wqpvu6q6.fsf@lifelogs.com> (raw)
In-Reply-To: <87r4pq20ev.wl%egh@e6h.org>

On Wed, 26 Sep 2012 07:46:53 -0700 Erik Hetzner <egh@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






      reply	other threads:[~2013-06-15  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25  4:26 bug#12511: 24.1; parse-netrc does not properly handle newlines Erik Hetzner
2012-09-25 22:12 ` Glenn Morris
2012-09-26 14:46   ` Erik Hetzner
2013-06-15  8:18     ` Ted Zlatanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2wqpvu6q6.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=12511@debbugs.gnu.org \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.