all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: emacs-devel@gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: Re: master 3139551: Don’t attempt to modify constant strings
Date: Mon, 18 May 2020 15:49:20 -0700	[thread overview]
Message-ID: <27a01a78-d56c-8d1f-6531-291638197a26@cs.ucla.edu> (raw)
In-Reply-To: <87h7wdrags.fsf@igel.home>

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

On 5/18/20 12:03 AM, Andreas Schwab wrote:
> On Mai 17 2020, Paul Eggert wrote:
> 
>> That would run afoul of the whole idea of clearing the string in the first
>> place, which was to avoid having one's password lying around in memory for a bad
>> actor to grab it.
> 
> But doing it in the caller is equally bad.

True, thanks, I installed the attached.

[-- Attachment #2: 0001-Improve-password-cache-add-example-in-comment.patch --]
[-- Type: text/x-patch, Size: 895 bytes --]

From 4d6e592cf5f48ca8aab9ec6569759f25cd1d1677 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 18 May 2020 15:42:18 -0700
Subject: [PATCH] Improve password-cache-add example in comment

* lisp/password-cache.el: Improve comment.  See Andreas Schwab in:
https://lists.gnu.org/r/emacs-devel/2020-05/msg02422.html
---
 lisp/password-cache.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/password-cache.el b/lisp/password-cache.el
index 86d802f283..f5007579a8 100644
--- a/lisp/password-cache.el
+++ b/lisp/password-cache.el
@@ -31,7 +31,8 @@
 ;; ;; Minibuffer prompt for password.
 ;;  => "foo"
 ;;
-;; (password-cache-add "test" (copy-sequence "foo"))
+;; (password-cache-add "test" (read-passwd "Password? "))
+;; ;; Minibuffer prompt from read-passwd, which returns "foo".
 ;;  => nil
 
 ;; (password-read "Password? " "test")
-- 
2.25.4


      reply	other threads:[~2020-05-18 22:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200517052512.20679.37725@vcs0.savannah.gnu.org>
     [not found] ` <20200517052513.C95BC20A2C@vcs0.savannah.gnu.org>
2020-05-17 11:22   ` master 3139551: Don’t attempt to modify constant strings Dmitry Gutov
2020-05-17 17:01     ` Paul Eggert
2020-05-17 11:24   ` Dmitry Gutov
2020-05-17 17:10     ` Paul Eggert
2020-05-17 18:02       ` Dmitry Gutov
2020-05-17 21:36         ` Paul Eggert
2020-05-17 21:54           ` Dmitry Gutov
2020-05-17 23:16             ` Paul Eggert
2020-05-17 23:24               ` Dmitry Gutov
2020-05-18  7:03               ` Andreas Schwab
2020-05-18 22:49                 ` Paul Eggert [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=27a01a78-d56c-8d1f-6531-291638197a26@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@linux-m68k.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.