[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moving files from lisp/gnus/ to lisp/net/?

From: Simon Josefsson
Subject: Re: Moving files from lisp/gnus/ to lisp/net/?
Date: Wed, 27 Oct 2004 21:08:28 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

> It occurs to me that paranoid people might be worried about saving
> passwords in a cache like this.  What do people know about that issue?

Yes, that is a valid concern.  That was one reason I didn't think of
changing the existing read-passwd interface.

Other applications typically ask the user whether they want to
remember the password in memory.  If read-passwd is changed to cache
passwords (however, to use the cache, callers of read-passwd must be
updated, to provide the "key" into the hash table), it could ask the
user this.  Opinions on this welcome.

> The text added to the manual is clear enough.  I have some issues
> about the substance:
>      -- Function: read-passwd prompt &optional confirm default
>        This function reads a password, prompting with PROMPT.  It does
>        not echo the password as the user types it; instead, it echoes `.'
>        for each character in the password.
> This ought to use the cache now, but the text does not say so.
> (Later): It looks like all you did was move read-passwd into
> password.el without changing it.  What I suggested was to integrate
> read-passwd into this file--which means, make it use the cache.

Sorry, I did not get this at first.

> So if its definition is to remain unchanged, it should stay in subr.el
> where it is preloaded.  But I would rather see it move to password.el
> and *take advantage of the facilities of password.el*.
> Can this be done?

Yes.  I'll work on it.

>      -- Function: password-read prompt key
>        Read a password from the user, using `read-passwd', prompting with
>        PROMPT.  If a password has been stored in the password cache,
>        using `password-cache-add' on the same KEY, it is returned
>        directly, without querying the user.
> Once read-passwd uses the cache, won't password-read be obsolete?


> Why have both password-read and password-read-and-add?
> Why not always add?  Is the idea that for some purposes
> it is ok to cache, but for others it is too risky?

No, the reason was this: if the user entered an incorrect password, it
should not be cached.  If an incorrect password is cached, the code
might infloop trying the incorrect password automatically over and
over again.  It was considered safer to first read the password, then
try to use it, and if successful then it is cached.

I'm not sure my argument is good, it may be simpler to always cache,
and have the calling code invoke password-cache-remove whenever there
is a password failure.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]