Gnus development mailing list
 help / color / mirror / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: ding@gnus.org, emacs-devel@gnu.org
Subject: Re: auth-source patch for secure logging
Date: Thu, 16 Jul 2009 11:32:48 -0400	[thread overview]
Message-ID: <87zlb4iqxr.fsf@stupidchicken.com> (raw)
In-Reply-To: <87vdlsr9jy.fsf@lifelogs.com> (Ted Zlatanov's message of "Thu, 16 Jul 2009 09:23:29 -0500")

Ted Zlatanov <tzz@lifelogs.com> writes:

> Attached is a patch to auth-source.el that:
>
> - introduces auth-source-debug
> - sets it to nil by default, so no logging is done (this changes the
>   previous behavior where we always log to *Messages*)
> - allows t (relay to 'message) and any function as options for that
>   variable
>
> It's against the Gnus CVS, but Emacs CVS has the same contents.
>
> If it's possible to include this in the upcoming release, I think it
> would improve security for Emacs users.  It's not a critical fix,
> however, so I will defer to the maintainers to decide.
>
> If it's accepted, please commit it to the Emacs CVS and then Miles can
> sync it back to the Gnus CVS.

Let's not check this into the branch.  These messages are not logged by
default anyway, since gnus-verbose defaults to 7.

It may be checked into the trunk, with the following caveats:

> (defcustom auth-source-debug nil
>   "Whether auth-source should log debug messages.
> Also see `auth-source-hide-passwords'.
>
> Can be t, which means to use `message'.  Be careful, your
> authentication data will be in the clear (except for passwords,
> which are always cleared)..
>
> Can also be a function, in which case the function should take
> the same parameters as `message'."

This docstring could be improved.  I suggest:

  "Whether auth-source should log debug messages.
Also see `auth-source-hide-passwords'.

If the value is nil, debug messages are not logged.
If the value is t, debug messages are logged with `message'.
 In that case, your authentication data will be in the
 clear (except for passwords, which are always stripped out).
If the value is a function, debug messages are logged by calling
 that function using the same arguments as `message'."

The docstring of auth-source-hide-passwords should also mention that
it's only relevant if auth-source-debug is non-nil.

> (defun auth-source-do-debug (&rest msg)
>   ;; set logger to either the function in auth-source-debug or 'message
>   ;; note that it will be 'message if auth-source-debug is nil, so
>   ;; we also check the value
>   (let ((logger (if (functionp auth-source-debug)
> 		    auth-source-debug
> 		  'message)))
>     (when auth-source-debug
>       (apply logger msg))))

You should put the `when' check on the outside.




  parent reply	other threads:[~2009-07-16 15:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16 14:23 Ted Zlatanov
2009-07-16 14:33 ` Ted Zlatanov
2009-07-16 15:55   ` Davis Herring
2009-07-16 16:21     ` Ted Zlatanov
2009-07-16 15:32 ` Chong Yidong [this message]
2009-07-16 16:15   ` Ted Zlatanov
2009-07-16 18:09     ` Ted Zlatanov
2009-07-17 17:31   ` Glenn Morris
2009-07-17 17:53   ` Ted Zlatanov
2009-07-17 18:01     ` Glenn Morris
2009-07-17 18:09       ` Ted Zlatanov
2009-07-17 18:35         ` Chong Yidong
2009-07-18 17:21           ` Chong Yidong
2009-07-17 19:42         ` Sven Joachim

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=87zlb4iqxr.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=tzz@lifelogs.com \
    /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.
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).