Gnus development mailing list
 help / color / mirror / Atom feed
* gmail and pop3
@ 2013-03-01 18:57 Alex Romosan
  2013-03-01 20:33 ` John Wiegley
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Romosan @ 2013-03-01 18:57 UTC (permalink / raw)
  To: ding; +Cc: jwiegley

after not being able to log on my gmail account using gnus and pop3 for
the last couple of months i finally decided to do a git bisect to find
the commit that broke it and came up with this:

152b8331ec8e0d49c005b2b19bfacc77df882c46 is the first bad commit
commit 152b8331ec8e0d49c005b2b19bfacc77df882c46
Author: John Wiegley <jwiegley@gmail.com>
Date:   Tue Dec 25 18:31:47 2012 +0100

    Allow "password" as netrc passwords
    
    * auth-source.el (auth-source-netrc-parse): Allow using "password" as
    the password (bug#12097).

:040000 040000 2cf066be80165460b8e824414098c87f22000089 548900db7ba3abbefe3c201fd304892dcf398c2c M      lisp


furthermore, if i rename my .netrc file to something else then i can
access my gmail account. so it looks like this patch rather than allow
"password" as netrc passwords made it as require password if .netrc
exists.

--alex--

-- 
| I believe the moment is at hand when, by a paranoiac and active |
|  advance of the mind, it will be possible (simultaneously with  |
|  automatism and other passive states) to systematize confusion  |
|  and thus to help to discredit completely the world of reality. |



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gmail and pop3
  2013-03-01 18:57 gmail and pop3 Alex Romosan
@ 2013-03-01 20:33 ` John Wiegley
  2013-03-01 23:29   ` Alex Romosan
  2013-06-06 15:43   ` Ted Zlatanov
  0 siblings, 2 replies; 7+ messages in thread
From: John Wiegley @ 2013-03-01 20:33 UTC (permalink / raw)
  To: Alex Romosan; +Cc: ding

>>>>> Alex Romosan <romosan@sycorax.lbl.gov> writes:

> furthermore, if i rename my .netrc file to something else then i can access
> my gmail account. so it looks like this patch rather than allow "password"
> as netrc passwords made it as require password if .netrc exists.

Sorry about, Alex.  I did find the parsing code in this area of Gnus rather
difficult to reason about.  Maybe someone with more familiarity would be
willing to look over my commit?

Thanks,
  John



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gmail and pop3
  2013-03-01 20:33 ` John Wiegley
@ 2013-03-01 23:29   ` Alex Romosan
  2013-06-06 15:43   ` Ted Zlatanov
  1 sibling, 0 replies; 7+ messages in thread
From: Alex Romosan @ 2013-03-01 23:29 UTC (permalink / raw)
  To: John Wiegley; +Cc: ding

"John Wiegley" <jwiegley@gmail.com> writes:

>>>>>> Alex Romosan <romosan@sycorax.lbl.gov> writes:
>
>> furthermore, if i rename my .netrc file to something else then i can
>> access my gmail account. so it looks like this patch rather than
>> allow "password" as netrc passwords made it as require password if
>> .netrc exists.
>
> Sorry about, Alex. I did find the parsing code in this area of Gnus
> rather difficult to reason about. Maybe someone with more familiarity
> would be willing to look over my commit?

no problem. hopefully somebody will find the solution so i can log on
gmail and keep my .netrc file. or, i guess, i can just try to add my
gmail username/password to the .netrc file (which i haven't tried yet).

--alex--

-- 
| I believe the moment is at hand when, by a paranoiac and active |
|  advance of the mind, it will be possible (simultaneously with  |
|  automatism and other passive states) to systematize confusion  |
|  and thus to help to discredit completely the world of reality. |



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gmail and pop3
  2013-03-01 20:33 ` John Wiegley
  2013-03-01 23:29   ` Alex Romosan
@ 2013-06-06 15:43   ` Ted Zlatanov
  2013-06-06 18:06     ` Ted Zlatanov
  1 sibling, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2013-06-06 15:43 UTC (permalink / raw)
  To: ding

On Fri, 01 Mar 2013 14:33:50 -0600 "John Wiegley" <jwiegley@gmail.com> wrote: 

>>>>>> Alex Romosan <romosan@sycorax.lbl.gov> writes:
>> furthermore, if i rename my .netrc file to something else then i can access
>> my gmail account. so it looks like this patch rather than allow "password"
>> as netrc passwords made it as require password if .netrc exists.

JW> Sorry about, Alex.  I did find the parsing code in this area of Gnus rather
JW> difficult to reason about.

It's a bit outdated and can't handle multi-line netrc entries, so I'll
probably rewrite it at some point.

JW> Maybe someone with more familiarity would be willing to look over my
JW> commit?

I have no idea what your commit:

+                   ((and (member elem tokens) (null pair))

does without re-reading all of the surrounding code.  Can you give an
example of what it supports that didn't work before?  I thought quoted
password were already supported.

Thanks!
Ted




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gmail and pop3
  2013-06-06 15:43   ` Ted Zlatanov
@ 2013-06-06 18:06     ` Ted Zlatanov
  2013-06-10  6:26       ` netrc parser revamp (was: gmail and pop3) Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2013-06-06 18:06 UTC (permalink / raw)
  To: ding

On Thu, 06 Jun 2013 11:43:51 -0400 Ted Zlatanov <tzz@lifelogs.com> wrote: 

TZ> On Fri, 01 Mar 2013 14:33:50 -0600 "John Wiegley" <jwiegley@gmail.com> wrote: 
>>>>>>> Alex Romosan <romosan@sycorax.lbl.gov> writes:
>>> furthermore, if i rename my .netrc file to something else then i can access
>>> my gmail account. so it looks like this patch rather than allow "password"
>>> as netrc passwords made it as require password if .netrc exists.

JW> Sorry about, Alex.  I did find the parsing code in this area of Gnus rather
JW> difficult to reason about.

TZ> It's a bit outdated and can't handle multi-line netrc entries, so I'll
TZ> probably rewrite it at some point.

JW> Maybe someone with more familiarity would be willing to look over my
JW> commit?

TZ> I have no idea what your commit:

TZ> +                   ((and (member elem tokens) (null pair))

TZ> does without re-reading all of the surrounding code.  Can you give an
TZ> example of what it supports that didn't work before?  I thought quoted
TZ> password were already supported.

After sending this, I saw bug#12097 which has some background on this.

So definitely a TODO for me is to rewrite that parser.  Sorry for the
trouble.

Ted




^ permalink raw reply	[flat|nested] 7+ messages in thread

* netrc parser revamp (was: gmail and pop3)
  2013-06-06 18:06     ` Ted Zlatanov
@ 2013-06-10  6:26       ` Ted Zlatanov
  2013-06-15  8:04         ` netrc parser revamp Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2013-06-10  6:26 UTC (permalink / raw)
  To: ding

On Thu, 06 Jun 2013 14:06:35 -0400 Ted Zlatanov <tzz@lifelogs.com> wrote: 

TZ> After sending this, I saw bug#12097 which has some background on this.

TZ> So definitely a TODO for me is to rewrite that parser.  Sorry for the
TZ> trouble.

Take a look at the following.  It implements a parser that will go
through the current buffer and extract all the netrc entries, respecting
multiline entries and other weird things.  Also, netrc used single
quotes (double quotes are a Gnusism apparently), so this supports both
single and double quotes.  Entries must start with "machine" which is
required in the netrc format.

It doesn't treat "macdef" entries especially because I have never seen
them used by anyone and didn't want the extra complexity.  If you feel
they must be supported, speak up.

e.g. try it on this netrc content:

#+begin_src text
machine A login tzz@lifelogs.com password "A lovely A"
# test again
machine B login tzz@lifelogs.com
 password 'B single quotes B'
default other info goes here
#+end_src

If this works as expected I'll put it into auth-source.el.  So please
try it on your weird wacky netrc files :)

Thanks
Ted

#+begin_src lisp
(defun auth-source-netrc-parse-next-interesting ()
  "Advance to the next interesting position in the current buffer."
  ;; If we're looking at a comment or are at the end of the line, move forward
  (while (or (looking-at "#")
             (and (eolp)
                  (not (eobp))))
    (forward-line 1))
  (skip-chars-forward "\t "))

(defun auth-source-netrc-parse-one ()
  "Read one thing from the current buffer."
  (auth-source-netrc-parse-next-interesting)

  (when (or (looking-at "'\\([^']+\\)'")
            (looking-at "\"\\([^\"]+\\)\"")
            (looking-at "\\([^ \t\n]+\\)"))
    (forward-char (length (match-string 0)))
    (auth-source-netrc-parse-next-interesting)
    (match-string-no-properties 1)))

(defun auth-source-netrc-parse-entries ()
  "Parse all the netrc entries from the current buffer."
  (let (item item2 all alist default)
    (while (setq item (auth-source-netrc-parse-one))

      (setq default (equal item "default"))
      ;; We're starting a new machine.  Save the old one.
      (when (or default
                (equal item "machine"))
        (when alist
          (push alist all))
        (setq alist nil))

      ;; In default entries, we don't have a next token.
      ;; We store them as ("machine" . t)
      (if default
          (push (cons "machine" t) alist)
        ;; Not a default entry.  Grab the next item.
        (when (setq item2 (auth-source-netrc-parse-one))
          (push (cons item item2) alist))))
    (when alist
      (push alist all))
    (nreverse all)))

#+end_src




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: netrc parser revamp
  2013-06-10  6:26       ` netrc parser revamp (was: gmail and pop3) Ted Zlatanov
@ 2013-06-15  8:04         ` Ted Zlatanov
  0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2013-06-15  8:04 UTC (permalink / raw)
  To: ding

On Mon, 10 Jun 2013 02:26:42 -0400 Ted Zlatanov <tzz@lifelogs.com> wrote: 

TZ> On Thu, 06 Jun 2013 14:06:35 -0400 Ted Zlatanov <tzz@lifelogs.com> wrote: 
TZ> After sending this, I saw bug#12097 which has some background on this.

TZ> So definitely a TODO for me is to rewrite that parser.  Sorry for the
TZ> trouble.

I've comitted a new version of the netrc parser that can handle
single-quoted strings and multiline entries.  I've tested it but please
let me know if you notice issues.

Ted




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-15  8:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-01 18:57 gmail and pop3 Alex Romosan
2013-03-01 20:33 ` John Wiegley
2013-03-01 23:29   ` Alex Romosan
2013-06-06 15:43   ` Ted Zlatanov
2013-06-06 18:06     ` Ted Zlatanov
2013-06-10  6:26       ` netrc parser revamp (was: gmail and pop3) Ted Zlatanov
2013-06-15  8:04         ` netrc parser revamp Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).