From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#43003: 28.0.50; comint-password-prompt-regexp too restrictive Date: Mon, 31 Aug 2020 12:11:54 +0200 Message-ID: References: <87pn7hawal.fsf@gmx.net> <878se4dy9u.fsf@gnus.org> <87lfi1emz4.fsf@gmx.net> <873648xmvf.fsf@gnus.org> <87sgc83z3k.fsf@gmx.net> <87mu2evp51.fsf@gnus.org> <87tuwm95za.fsf@gmx.net> <87a6yctfmi.fsf@gnus.org> <87mu2btbd9.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33154"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43003@debbugs.gnu.org, Lars Ingebrigtsen To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 31 12:13:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kCgoH-0008Xf-2r for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Aug 2020 12:13:09 +0200 Original-Received: from localhost ([::1]:53660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCgoF-000377-Vs for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Aug 2020 06:13:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCgoA-00036z-V2 for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 06:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40051) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCgoA-0001xY-M7 for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 06:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kCgoA-0005iz-Gm for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2020 06:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Aug 2020 10:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43003 X-GNU-PR-Package: emacs Original-Received: via spool by 43003-submit@debbugs.gnu.org id=B43003.159886872921945 (code B ref 43003); Mon, 31 Aug 2020 10:13:02 +0000 Original-Received: (at 43003) by debbugs.gnu.org; 31 Aug 2020 10:12:09 +0000 Original-Received: from localhost ([127.0.0.1]:51597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCgnJ-0005hr-C0 for submit@debbugs.gnu.org; Mon, 31 Aug 2020 06:12:09 -0400 Original-Received: from mail-wr1-f65.google.com ([209.85.221.65]:43135) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCgnE-0005hL-Kp for 43003@debbugs.gnu.org; Mon, 31 Aug 2020 06:12:08 -0400 Original-Received: by mail-wr1-f65.google.com with SMTP id k15so5303243wrn.10 for <43003@debbugs.gnu.org>; Mon, 31 Aug 2020 03:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=MpQFzsC3ZUwTTxw/EAovdCZ0XhJwGy3l9cop82CY2M4=; b=gmKYhDVwJNt3AM+BG39qW/69G0JaX1LQdJlr8+VoaTWFrvP6rL/7btC62s4QI7aNQL jZjurl7YH3SKKu6Msw9oRIJ4J6h8ePBSpcnBOMnPh+Yi+Wag2f238BZUfaawnhs8ZPOI oP2hVdtNw7oMFat5KWxhs56i4alPyc41uhCgGtuHDyxgGDJny61x5ui9Sj4IsyZRubRV 9E/rpl1m+BglKgy5+K8gpKNdcIwR2IebfqYNzJw7FYuOvqodvOLqZbnKE9oKZyv9VhVR Fw5FDe7K/uf5TLvrcL8M5DS3WJR7HdKUMCrB/8wiNSlcqR7ub8p+YuRsrChcqRt/hhPy 56eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=MpQFzsC3ZUwTTxw/EAovdCZ0XhJwGy3l9cop82CY2M4=; b=VQOcYbJS15EhyW7kSZTEiRiMhDyVkIqcPddSvAde0uSH2JhK4MQgcXvs019YxAi5KS +inUa7VGt6xaatx9HwGWfv6PmpXC5QJYgCsHXW/XYI8aSlJduyK3n9jHc0jlScQAU6ic dwVwDmgloGXUhntkdCzT+JsVfqqW4CZBRjqq1HbxlY7ylMkUtfo9KRxtgf47xb27VVah ePzmqJbYgZH5aEEm0US88OBCSAR9ebDh8nzNiWpj9TUD9SpzpHv1qaT79Zcxj+TXT2Qd ny0A1vD+mRc0N00+VkyTagfwYUcYF7+EG/n/26Nu+muow2SwJfX7nyK8sAopWi5PvdYX BhsA== X-Gm-Message-State: AOAM531zRgaVCgEy29dPbz8UAw75l4FF4tgVA5KPtXfiYmtyEKtqndZV K0HQEJxtCAy2XEaLdNxcndMGdCTYlo8= X-Google-Smtp-Source: ABdhPJxf0AhyqV5C4JS2NfC3kOoWNn2EWTH3doIsCGIBJCI90w1wJnsrxEe4Tsxw6Se8CECnrJIueQ== X-Received: by 2002:a5d:574e:: with SMTP id q14mr867682wrw.281.1598868718296; Mon, 31 Aug 2020 03:11:58 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:4833:59bb:ac1c:3d8d]) by smtp.gmail.com with ESMTPSA id g8sm9926559wmd.12.2020.08.31.03.11.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 03:11:57 -0700 (PDT) In-Reply-To: <87mu2btbd9.fsf@gmx.net> (Stephen Berman's message of "Mon, 31 Aug 2020 11:26:10 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186754 Archived-At: >>>>> On Mon, 31 Aug 2020 11:26:10 +0200, Stephen Berman said: Stephen> On Sun, 30 Aug 2020 15:41:57 +0200 Lars Ingebrigtsen wrote: >> Stephen Berman writes: >> >>> True, I wasn't thinking about that. Then I guess it's best to leave >>> comint-password-prompt-regexp as is and I'll just change it locally. >>> The problem I have with it doesn't seem to be widespread, to say the >>> least. So feel free to close the bug. >> >> OK; done. Stephen> A postscript with additional datapoints: In my OP, the the system that Stephen> the problem occurs on (Linux From Scratch) uses openssh 8.2p1, while the Stephen> system without the problem (an older Linux From Scratch) uses openssh Stephen> 7.9p1. I've now reproduced the problem on two other GNU/Linux systems: Stephen> current openSUSE Tumbleweed, which uses openssh 8.3p1 (and I see the Stephen> problem here on two different machines), and openSUSE Leap 15.2, which Stephen> uses openssh 8.1p1. This supports my conjecture that the problematic Stephen> carriage return in the prompt comes from openssh. If anyone else Stephen> running a system with openssh 8.{1,2,3}p1 can reproduce the problem, Stephen> then perhaps a different way of handling it than changing the default Stephen> value of comint-password-prompt-regexp can be found. That matches the analysis done in https://emacs.stackexchange.com/questions/60394/unable-to-push-into-github-using-magit which leads to: https://github.com/magit/magit/issues/3843 TL;DR magit decided to strip the \r from the prompt received from openssh. We could strip control characters in comint-watch-for-password-prompt, but then people who've legitimately put control characters in comint-password-prompt-regexp will get annoyed. Perhaps just strip '\r'? (And document it, of course) diff --git a/lisp/comint.el b/lisp/comint.el index be0e32b9e0..74c5c7f94f 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2427,7 +2427,8 @@ comint-watch-for-password-prompt This function could be in the list `comint-output-filter-functions'." (when (let ((case-fold-search t)) - (string-match comint-password-prompt-regexp string)) + (string-match comint-password-prompt-regexp + (replace-regexp-in-string "\r" "" string))) (when (string-match "^[ \n\r\t\v\f\b\a]+" string) (setq string (replace-match "" t t string))) (let ((comint--prompt-recursion-depth (1+ comint--prompt-recursion-depth)))