From unknown Thu Jun 19 14:33:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35688: url-auth prompt is blank when realm is the empty string Resent-From: Thomas Fitzsimmons Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 May 2019 20:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35688 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 35688@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155760712319177 (code B ref -1); Sat, 11 May 2019 20:39:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 May 2019 20:38:43 +0000 Received: from localhost ([127.0.0.1]:41260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPYlX-0004zF-DZ for submit@debbugs.gnu.org; Sat, 11 May 2019 16:38:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPYlU-0004z1-PQ for submit@debbugs.gnu.org; Sat, 11 May 2019 16:38:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:59935) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hPYlP-0003Ax-IZ for submit@debbugs.gnu.org; Sat, 11 May 2019 16:38:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPYlO-0004FE-Ep for bug-gnu-emacs@gnu.org; Sat, 11 May 2019 16:38:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPYlL-00038y-GE for bug-gnu-emacs@gnu.org; Sat, 11 May 2019 16:38:34 -0400 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]:34969) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hPYlL-00038F-3K for bug-gnu-emacs@gnu.org; Sat, 11 May 2019 16:38:31 -0400 Received: by mail-io1-xd30.google.com with SMTP id p2so7177359iol.2 for ; Sat, 11 May 2019 13:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fitzsim-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=J+KxRH/Wp2qIIMwaoeVovmIWFTn0SKi3SFwAtFfwzOY=; b=NUq4y+XtO68Tj4PC/+tGcWW6mfpB8N7hTtbckIM7pXY6V+dTev6Zy/I2hHz9hPifTz 3rE7wc+4qeW4hYNu6qjfDeiG/mIjTpFVEaGDOJ5UX7ftXSoHxTCpY5Id7iP1V352uvCl AuVhreaQ/U9RMMNqpavXgEBWARkvA3cI1CtPLtXU5jkQnvDPAJcxzP+G+6eT73KBJ+D8 chwUHcOD2JStXM8IUKrjB6LDe5v6v8txM5Bg8LqpfFCJEPscMzUgLp7rENeFFAw66Z5J EOdi6K34V17fCrbuN0kkjOCKhtnWx0j2zqqP8yrJsmaSR0CJ8X4PrTaPK2E7zU04qUJN wrHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=J+KxRH/Wp2qIIMwaoeVovmIWFTn0SKi3SFwAtFfwzOY=; b=XSml1SotszSSbWvw8Cudgzoqq8YepS50DCSw8cwMcvBtK53pnZVbVnkgK+ofBuytF5 yufe7Pn94e56fxfwmtEuc7RB3j4Puwa+BeWvN1uys68lAN6GjLABJxTH+gBvjciJkgtt bdOg3E7xOMdU8dR8OfysrJIIVDFHKo8DHFcJ/MQKqqp1cSMwb7DX1dAdjdIfgQRMu5jb MXs+JV+PQtsqDlvMkcmuZbMrkkIDaqceJLZXgfjUAo5F8+DZMjGo249R8krw3kQLYoFx n1FxS93v8p42klfqozAhwPKky5bw6Y79aijlxR2rJSFqHPGG+43Va4LOb3PwECP/R5yA W0Fg== X-Gm-Message-State: APjAAAXyTI2yuRJRREOQWWDLejUqKOHC1a2U13yUpbbkrhi25K+wLe9o dd45MLfoCMdtJyvFkyszRDIfJLC9Ypg= X-Google-Smtp-Source: APXvYqxyx7yq81snJwJUMk9ryZZQeIPCbBF7VuV1Pt0yJzDuvva1qNgcxwIyDXXkVrPxjMvu0ihC+Q== X-Received: by 2002:a6b:b7ce:: with SMTP id h197mr11299436iof.169.1557607109616; Sat, 11 May 2019 13:38:29 -0700 (PDT) Received: from localhost.localdomain (69-165-165-189.dsl.teksavvy.com. [69.165.165.189]) by smtp.gmail.com with ESMTPSA id b18sm4334701itd.40.2019.05.11.13.38.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 May 2019 13:38:28 -0700 (PDT) From: Thomas Fitzsimmons Date: Sat, 11 May 2019 16:38:27 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d30 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, When a website returns an empty string for realm, url-get-authentication prompts: Username [for ]: See for example: (url-retrieve-synchronously "https://outlook.office365.com/EWS/Exchange.asmx") The attached patch makes the prompt contain the full URL, and applies to all auth schemes. However, maybe each auth scheme should decide how to handle a "" realm and to fix this particular case I should just change url-basic-auth? I'm open to suggestions. Anyway, I'm filing this bug because I think prompting for a username and password while not showing the user the requested URL is a usability problem. Thomas diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index 0746cfd96c..f644787cc6 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el @@ -478,6 +478,8 @@ url-get-authentication if one cannot be found in the cache" (if (not realm) (setq realm (cdr-safe (assoc "realm" args)))) + (if (equal realm "") + (setq realm nil)) (if (stringp url) (setq url (url-generic-parse-url url))) (if (or (null type) (eq type 'any)) From unknown Thu Jun 19 14:33:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35688: url-auth prompt is blank when realm is the empty string Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 May 2019 04:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35688 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Thomas Fitzsimmons Cc: 35688@debbugs.gnu.org Received: via spool by 35688-submit@debbugs.gnu.org id=B35688.15578937146970 (code B ref 35688); Wed, 15 May 2019 04:16:02 +0000 Received: (at 35688) by debbugs.gnu.org; 15 May 2019 04:15:14 +0000 Received: from localhost ([127.0.0.1]:50675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQlJy-0001o1-CT for submit@debbugs.gnu.org; Wed, 15 May 2019 00:15:14 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:36426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQlJw-0001lB-1E for 35688@debbugs.gnu.org; Wed, 15 May 2019 00:15:13 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1hQlJs-0005UB-N2; Wed, 15 May 2019 06:15:10 +0200 From: Lars Ingebrigtsen References: Date: Wed, 15 May 2019 06:15:03 +0200 In-Reply-To: (Thomas Fitzsimmons's message of "Sat, 11 May 2019 16:38:27 -0400") Message-ID: <87h89wxsjc.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thomas Fitzsimmons writes: > See for example: > > (url-retrieve-synchronously "https://outlook.office365.com/EWS/Exchange.asmx") > > The attached patch makes the prompt contain the full URL, and applies to > all auth schemes. However, maybe each auth scheme should decide how to > handle a "" realm and to fix this particular case I should just change > url-basic-auth? I'm open to suggestions. > > Anyway, I'm filing this bug because I think prompting for a username and > password while not showing the user the requested URL is a usability > problem. I think your fix sounds sufficient, so I've applied it to Emacs 27.1 as is. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed May 15 00:15:22 2019 Received: (at control) by debbugs.gnu.org; 15 May 2019 04:15:22 +0000 Received: from localhost ([127.0.0.1]:50678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQlK5-0001wp-Mq for submit@debbugs.gnu.org; Wed, 15 May 2019 00:15:21 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:36435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQlK4-0001v0-G5 for control@debbugs.gnu.org; Wed, 15 May 2019 00:15:20 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1hQlK2-0007uW-3Y for control@debbugs.gnu.org; Wed, 15 May 2019 06:15:19 +0200 Date: Wed, 15 May 2019 06:15:12 +0200 Message-Id: <87ftpgxsj3.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #35688 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 35688 fixed close 35688