Gnus development mailing list
 help / color / mirror / Atom feed
* nnimap-authinfo-file customization proposes "inline" format
@ 2008-10-30 21:00 Paul R
  2008-10-31 17:36 ` Ted Zlatanov
  0 siblings, 1 reply; 9+ messages in thread
From: Paul R @ 2008-10-30 21:00 UTC (permalink / raw)
  To: ding

Hello,

customize offers to "inline" in a list the tokens of
nnimap-authinfo-file but the backend does not seem to hanldle it after.
This is very unfortunate because I do not like to write passwords in
cleartext in files, and because it forces to ducplicate information in
different files. Does anyone have a plan to fix that please ? Thank you

-- 
  Paul



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

* Re: nnimap-authinfo-file customization proposes "inline" format
  2008-10-30 21:00 nnimap-authinfo-file customization proposes "inline" format Paul R
@ 2008-10-31 17:36 ` Ted Zlatanov
  2008-10-31 18:42   ` Paul R
  0 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2008-10-31 17:36 UTC (permalink / raw)
  To: ding

On Thu, 30 Oct 2008 22:00:33 +0100 Paul R <paul.r.ml@gmail.com> wrote: 

PR> customize offers to "inline" in a list the tokens of
PR> nnimap-authinfo-file but the backend does not seem to hanldle it after.
PR> This is very unfortunate because I do not like to write passwords in
PR> cleartext in files, and because it forces to ducplicate information in
PR> different files. Does anyone have a plan to fix that please ? Thank you

You can use EPA, which comes with the CVS version of Emacs and can be
downloaded otherwise, to automatically encrypt certain files so on disk
they are encrypted, but to Emacs they will open as regular text files
and thus can be used for authinfo.

That's what I do with my authinfo.gpg file.

I'm not sure what customization issue you're reporting.  What is
happening, and what is the problem?

Ted




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

* Re: nnimap-authinfo-file customization proposes "inline" format
  2008-10-31 17:36 ` Ted Zlatanov
@ 2008-10-31 18:42   ` Paul R
  2008-11-03 21:02     ` Ted Zlatanov
  0 siblings, 1 reply; 9+ messages in thread
From: Paul R @ 2008-10-31 18:42 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

On Fri, 31 Oct 2008 12:36:21 -0500, Ted Zlatanov <tzz@lifelogs.com> said:

Ted> You can use EPA, which comes with the CVS version of Emacs and can
Ted> be downloaded otherwise, to automatically encrypt certain files so
Ted> on disk they are encrypted, but to Emacs they will open as regular
Ted> text files and thus can be used for authinfo.

Thank for the tip, I'll look into it soon

Ted> I'm not sure what customization issue you're reporting. What is
Ted> happening, and what is the problem?

M-x customize-variable RET nnimap-authinfo-file RET
From 'Value menu' choose "inline", then INS a new entry.

Save it, try to use it : That won't work, because netrc-parse expects
a file name and nothing else.

-- 
  Paul



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

* Re: nnimap-authinfo-file customization proposes "inline" format
  2008-10-31 18:42   ` Paul R
@ 2008-11-03 21:02     ` Ted Zlatanov
  2008-11-03 23:31       ` Paul R
  0 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2008-11-03 21:02 UTC (permalink / raw)
  To: ding

On Fri, 31 Oct 2008 19:42:32 +0100 Paul R <paul.r.ml@gmail.com> wrote: 

PR> M-x customize-variable RET nnimap-authinfo-file RET
PR> From 'Value menu' choose "inline", then INS a new entry.

PR> Save it, try to use it : That won't work, because netrc-parse expects
PR> a file name and nothing else.

Can you try the following patch?

Thanks
Ted


Index: netrc.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/netrc.el,v
retrieving revision 7.25
diff -c -r7.25 netrc.el
*** netrc.el	11 Jun 2008 14:19:44 -0000	7.25
--- netrc.el	3 Nov 2008 21:01:40 -0000
***************
*** 59,119 ****
  (defun netrc-parse (file)
    (interactive "fFile to Parse: ")
    "Parse FILE and return a list of all entries in the file."
!   (when (file-exists-p file)
!     (with-temp-buffer
!       (let ((tokens '("machine" "default" "login"
! 		      "password" "account" "macdef" "force"
! 		      "port"))
! 	    (encryption-model (when (netrc-bound-and-true-p encrypt-file-alist)
! 				(encrypt-find-model file)))
! 	    alist elem result pair)
! 	(if encryption-model
! 	    (encrypt-insert-file-contents file encryption-model)
! 	  (insert-file-contents file))
! 	(goto-char (point-min))
! 	;; Go through the file, line by line.
! 	(while (not (eobp))
! 	  (narrow-to-region (point) (point-at-eol))
! 	  ;; For each line, get the tokens and values.
  	  (while (not (eobp))
! 	    (skip-chars-forward "\t ")
! 	    ;; Skip lines that begin with a "#".
! 	    (if (eq (char-after) ?#)
! 		(goto-char (point-max))
! 	      (unless (eobp)
! 		(setq elem
! 		      (if (= (following-char) ?\")
! 			  (read (current-buffer))
! 			(buffer-substring
! 			 (point) (progn (skip-chars-forward "^\t ")
! 					(point)))))
! 		(cond
! 		 ((equal elem "macdef")
! 		  ;; We skip past the macro definition.
! 		  (widen)
! 		  (while (and (zerop (forward-line 1))
! 			      (looking-at "$")))
! 		  (narrow-to-region (point) (point)))
! 		 ((member elem tokens)
! 		  ;; Tokens that don't have a following value are ignored,
! 		  ;; except "default".
! 		  (when (and pair (or (cdr pair)
! 				      (equal (car pair) "default")))
! 		    (push pair alist))
! 		  (setq pair (list elem)))
! 		 (t
! 		  ;; Values that haven't got a preceding token are ignored.
! 		  (when pair
! 		    (setcdr pair elem)
! 		    (push pair alist)
! 		    (setq pair nil)))))))
! 	  (when alist
! 	    (push (nreverse alist) result))
! 	  (setq alist nil
! 		pair nil)
! 	  (widen)
! 	  (forward-line 1))
! 	(nreverse result)))))
  
  (defun netrc-machine (list machine &optional port defaultport)
    "Return the netrc values from LIST for MACHINE or for the default entry.
--- 59,121 ----
  (defun netrc-parse (file)
    (interactive "fFile to Parse: ")
    "Parse FILE and return a list of all entries in the file."
!   (if (listp file)
!       file
!     (when (file-exists-p file)
!       (with-temp-buffer
! 	(let ((tokens '("machine" "default" "login"
! 			"password" "account" "macdef" "force"
! 			"port"))
! 	      (encryption-model (when (netrc-bound-and-true-p encrypt-file-alist)
! 				  (encrypt-find-model file)))
! 	      alist elem result pair)
! 	  (if encryption-model
! 	      (encrypt-insert-file-contents file encryption-model)
! 	    (insert-file-contents file))
! 	  (goto-char (point-min))
! 	  ;; Go through the file, line by line.
  	  (while (not (eobp))
! 	    (narrow-to-region (point) (point-at-eol))
! 	    ;; For each line, get the tokens and values.
! 	    (while (not (eobp))
! 	      (skip-chars-forward "\t ")
! 	      ;; Skip lines that begin with a "#".
! 	      (if (eq (char-after) ?#)
! 		  (goto-char (point-max))
! 		(unless (eobp)
! 		  (setq elem
! 			(if (= (following-char) ?\")
! 			    (read (current-buffer))
! 			  (buffer-substring
! 			   (point) (progn (skip-chars-forward "^\t ")
! 					  (point)))))
! 		  (cond
! 		   ((equal elem "macdef")
! 		    ;; We skip past the macro definition.
! 		    (widen)
! 		    (while (and (zerop (forward-line 1))
! 				(looking-at "$")))
! 		    (narrow-to-region (point) (point)))
! 		   ((member elem tokens)
! 		    ;; Tokens that don't have a following value are ignored,
! 		    ;; except "default".
! 		    (when (and pair (or (cdr pair)
! 					(equal (car pair) "default")))
! 		      (push pair alist))
! 		    (setq pair (list elem)))
! 		   (t
! 		    ;; Values that haven't got a preceding token are ignored.
! 		    (when pair
! 		      (setcdr pair elem)
! 		      (push pair alist)
! 		      (setq pair nil)))))))
! 	    (when alist
! 	      (push (nreverse alist) result))
! 	    (setq alist nil
! 		  pair nil)
! 	    (widen)
! 	    (forward-line 1))
! 	  (nreverse result))))))
  
  (defun netrc-machine (list machine &optional port defaultport)
    "Return the netrc values from LIST for MACHINE or for the default entry.




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

* Re: nnimap-authinfo-file customization proposes "inline" format
  2008-11-03 21:02     ` Ted Zlatanov
@ 2008-11-03 23:31       ` Paul R
  2008-11-04 16:51         ` Ted Zlatanov
  0 siblings, 1 reply; 9+ messages in thread
From: Paul R @ 2008-11-03 23:31 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

Hello Ted,

Ted> Can you try the following patch?

I did and it works as expected, thanks. What is next now ? Should this
be integrated upstream ?

Thank you for the effort,

-- 
  Paul



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

* Re: nnimap-authinfo-file customization proposes "inline" format
  2008-11-03 23:31       ` Paul R
@ 2008-11-04 16:51         ` Ted Zlatanov
  2008-11-04 18:43           ` Paul R
  0 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2008-11-04 16:51 UTC (permalink / raw)
  To: ding

On Tue, 04 Nov 2008 00:31:36 +0100 Paul R <paul.r.ml@gmail.com> wrote: 

Ted> Can you try the following patch?

PR> I did and it works as expected, thanks. What is next now ? Should this
PR> be integrated upstream ?

I'd like at least one more person to use it and let us know if it's OK.
Otherwise we'll commit to CVS in a week (to give us time to find
potential bugs).

Thanks
Ted




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

* Re: nnimap-authinfo-file customization proposes "inline" format
  2008-11-04 16:51         ` Ted Zlatanov
@ 2008-11-04 18:43           ` Paul R
  2008-11-10 22:00             ` Ted Zlatanov
  0 siblings, 1 reply; 9+ messages in thread
From: Paul R @ 2008-11-04 18:43 UTC (permalink / raw)
  To: ding

On Tue, 04 Nov 2008 10:51:51 -0600, Ted Zlatanov <tzz@lifelogs.com> said:

Ted> I'd like at least one more person to use it and let us know if it's
Ted> OK. Otherwise we'll commit to CVS in a week (to give us time to
Ted> find potential bugs).

Yes, that's wise. Keep in mind that I now only use the patched function
with already-built lists, and never with netrc file path, so although
I can say that it works flowlessly my way, I have no idea about any
regression in netrc file parsing.

Also, if you want to commit, you may want to change the docstring and
the parameter name to reflect new versatility.

Thank you,


-- 
  Paul



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

* Re: nnimap-authinfo-file customization proposes "inline" format
  2008-11-04 18:43           ` Paul R
@ 2008-11-10 22:00             ` Ted Zlatanov
  2009-02-13 22:38               ` auth-source documentation (was: nnimap-authinfo-file customization proposes "inline" format) Ted Zlatanov
  0 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2008-11-10 22:00 UTC (permalink / raw)
  To: ding

On Tue, 04 Nov 2008 19:43:08 +0100 Paul R <paul.r.ml@gmail.com> wrote: 

PR> On Tue, 04 Nov 2008 10:51:51 -0600, Ted Zlatanov <tzz@lifelogs.com> said:
Ted> I'd like at least one more person to use it and let us know if it's
Ted> OK. Otherwise we'll commit to CVS in a week (to give us time to
Ted> find potential bugs).

PR> Yes, that's wise. Keep in mind that I now only use the patched function
PR> with already-built lists, and never with netrc file path, so although
PR> I can say that it works flowlessly my way, I have no idea about any
PR> regression in netrc file parsing.

PR> Also, if you want to commit, you may want to change the docstring and
PR> the parameter name to reflect new versatility.

I comitted the change.

I think it's better to leave this undocumented, I'd rather push people
towards using a netrc file.  Then they can store it with GPG encryption
separately from the rest of their configuration, which is the better
practice IMHO.

If you and others feel that Gnus should explicitly discuss and promote
inline password storage in addition to GPG-encrypted netrc files, please
let me know.

Either way, I should write a guide for setting up netrc files for Gnus
and Emacs in general, using auth-source.el which I comitted recently.

Thanks
Ted




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

* auth-source documentation (was: nnimap-authinfo-file customization proposes "inline" format)
  2008-11-10 22:00             ` Ted Zlatanov
@ 2009-02-13 22:38               ` Ted Zlatanov
  0 siblings, 0 replies; 9+ messages in thread
From: Ted Zlatanov @ 2009-02-13 22:38 UTC (permalink / raw)
  To: ding

On Mon, 10 Nov 2008 16:00:31 -0600 Ted Zlatanov <tzz@lifelogs.com> wrote: 

TZ> Either way, I should write a guide for setting up netrc files for Gnus
TZ> and Emacs in general, using auth-source.el which I comitted recently.

Finally I got around to it.  I wrote a quick guide (auth.texi) for the
auth-source library.  Please take a look and let me know if it needs any
changes.  I know the library well so I probably missed something
essential for new users :)  Also I haven't written Texinfo in years so I
wouldn't be surprised if something is off in the markup.

Thanks
Ted




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

end of thread, other threads:[~2009-02-13 22:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-30 21:00 nnimap-authinfo-file customization proposes "inline" format Paul R
2008-10-31 17:36 ` Ted Zlatanov
2008-10-31 18:42   ` Paul R
2008-11-03 21:02     ` Ted Zlatanov
2008-11-03 23:31       ` Paul R
2008-11-04 16:51         ` Ted Zlatanov
2008-11-04 18:43           ` Paul R
2008-11-10 22:00             ` Ted Zlatanov
2009-02-13 22:38               ` auth-source documentation (was: nnimap-authinfo-file customization proposes "inline" format) 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).