From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#22027: 25.1.50; Return uncorrupted default string Date: Mon, 9 May 2016 12:26:13 +0900 (JST) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: ger.gmane.org 1462764262 659 80.91.229.3 (9 May 2016 03:24:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 May 2016 03:24:22 +0000 (UTC) Cc: Tino Calancha To: 22027@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 09 05:24:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1azbno-0001Au-At for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 May 2016 05:24:12 +0200 Original-Received: from localhost ([::1]:38985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azbnm-00028H-Jg for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 May 2016 23:24:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azbni-00020s-71 for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 23:24:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azbnd-0006UP-TZ for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 23:24:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azbnd-0006UF-PR for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 23:24:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1azbnd-0000SC-IB for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 23:24:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 May 2016 03:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22027 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22027-submit@debbugs.gnu.org id=B22027.14627641851673 (code B ref 22027); Mon, 09 May 2016 03:24:01 +0000 Original-Received: (at 22027) by debbugs.gnu.org; 9 May 2016 03:23:05 +0000 Original-Received: from localhost ([127.0.0.1]:43650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azbmi-0000Qv-Uw for submit@debbugs.gnu.org; Sun, 08 May 2016 23:23:05 -0400 Original-Received: from calancha-ilc.kek.jp ([130.87.234.234]:40725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azbmf-0000Q9-Rj for 22027@debbugs.gnu.org; Sun, 08 May 2016 23:23:03 -0400 Original-Received: by calancha-ilc.kek.jp (Postfix, from userid 500) id A39D4726D; Mon, 9 May 2016 12:26:13 +0900 (JST) Original-Received: from localhost (localhost [127.0.0.1]) by calancha-ilc.kek.jp (Postfix) with ESMTP id 8501B4389; Mon, 9 May 2016 12:26:13 +0900 (JST) X-X-Sender: calancha@calancha-ilc.kek.jp User-Agent: Alpine 2.20 (LRH 67 2015-01-07) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118015 Archived-At: >*) first argument non-nil, >*) second argument string != "", Should read: *) second argument non-nil, *) third argument string != "", In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.30) of 2016-05-06 built on calancha-pc Repository revision: 80bea210ff14a64daa1d71765983aa3baa149555 >From 1ced98ba1a548749c119a93858f82f1210fe81bc Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 9 May 2016 12:01:31 +0900 Subject: [PATCH 1/3] Return uncorrupted default string * lisp/subr.el (read-passwd): Return DEFAULT when CONFIRM evaluates non-nil and user inputs the empty string (Bug#22027). --- lisp/subr.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 0fa6404..ef6af1d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2152,9 +2152,9 @@ read-passwd (let ((first (read-passwd prompt nil default)) (second (read-passwd "Confirm password: " nil default))) (if (equal first second) - (progn - (and (arrayp second) (clear-string second)) - (setq success first)) + (prog1 + (setq success (copy-sequence first)) + (and (arrayp second) (clear-string second))) (and (arrayp first) (clear-string first)) (and (arrayp second) (clear-string second)) (message "Password not repeated accurately; please start over") -- 2.8.1 >From 7124a681e17e4f33694e9f1c8ccb0261f6a0bf9c Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 9 May 2016 12:03:18 +0900 Subject: [PATCH 2/3] * lisp/subr.el (read-passwd): Clear also first password. --- lisp/subr.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/subr.el b/lisp/subr.el index ef6af1d..5c32299 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2154,6 +2154,7 @@ read-passwd (if (equal first second) (prog1 (setq success (copy-sequence first)) + (and (arrayp first) (clear-string first)) (and (arrayp second) (clear-string second))) (and (arrayp first) (clear-string first)) (and (arrayp second) (clear-string second)) -- 2.8.1 >From e3aa5b5d30b901c2533538b3a9d0d5bd69493cf0 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 9 May 2016 12:08:02 +0900 Subject: [PATCH 3/3] * lisp/subr.el (read-passwd): Clear non-empty passwords. --- lisp/subr.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 5c32299..344c416 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2153,11 +2153,11 @@ read-passwd (second (read-passwd "Confirm password: " nil default))) (if (equal first second) (prog1 - (setq success (copy-sequence first)) - (and (arrayp first) (clear-string first)) - (and (arrayp second) (clear-string second))) - (and (arrayp first) (clear-string first)) - (and (arrayp second) (clear-string second)) + (setq success (copy-sequence first)) + (when (and (arrayp first) + (not (string= first ""))) + (clear-string first) + (clear-string second))) (message "Password not repeated accurately; please start over") (sit-for 1)))) success) -- 2.8.1