From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: ozzloy Newsgroups: gmane.emacs.bugs Subject: bug#65973: [PATCH] ; send filename, not full path, on EWW form submit Date: Sat, 2 Dec 2023 07:02:20 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000da1404060b882ce4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33582"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65973@debbugs.gnu.org To: daniel watson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 02 16:04:24 2023 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 1r9RXc-0008X8-3f for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Dec 2023 16:04:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9RX9-0006aF-MG; Sat, 02 Dec 2023 10:03:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9RX7-0006Zp-K9 for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 10:03:53 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9RX7-000097-23 for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 10:03:53 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r9RXG-0004ER-C7 for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 10:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: ozzloy Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Dec 2023 15:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65973 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170152938216174 (code B ref -1); Sat, 02 Dec 2023 15:04:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Dec 2023 15:03:02 +0000 Original-Received: from localhost ([127.0.0.1]:58412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9RWH-0004Cf-Hg for submit@debbugs.gnu.org; Sat, 02 Dec 2023 10:03:02 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:48002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9RWF-0004CM-E7 for submit@debbugs.gnu.org; Sat, 02 Dec 2023 10:03:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9RVw-0006Nn-T0 for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 10:02:43 -0500 Original-Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9RVu-0007hl-Id for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 10:02:40 -0500 Original-Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6d8750718adso645784a34.0 for ; Sat, 02 Dec 2023 07:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701529356; x=1702134156; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Wcr+VdE2lbwZZqabc+gJ6SjIDEf+7gp9hM+zl/z8gTA=; b=fHppf5BfFkc5U3dvnlMlCc3mCTDdri/0nyy6tTXI0YLMRGtm28c7ePVbc09r9n8O3y 6yXzyyn2et/RjquIqRigXgjeiFH1uJV2pE82o8+kn0hkKBCt7k9xMr8P2qEbyl0dX2FI OjzVYaNwkk/XNb+fXF1m7rGEsXi/vt9QCa+80AnHBVX4A6irRuQfM1Eg86eg1G8EBUSL W/uZqupWjeq0BEM0HPg7Npd3FntLsRSaUR2u2Z5u6QpS3X8JiKK9n1hOZQuqVtO8Hk6/ /HG9nTEb42691izyvfjIl4QnA/fz9TuPoOXkvlbxeyrxmjR5Ol1Vz0jLTwrhnX6NUpGE 3dhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701529356; x=1702134156; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Wcr+VdE2lbwZZqabc+gJ6SjIDEf+7gp9hM+zl/z8gTA=; b=Vn4ZwIRGZVJ0zBCrCrbU0YFieBc6mI+O1kQ5RP3WzKHtQwiKxnXNVZlABAsIvcDdxV /jBp1dUknsgRbuhiqyZHddsAe8l7P7WWNShyjvGFOFuBzYfkx8CZqL8aXkKg+8IVVHBy ArSamHoNeCqOZ0CSGAXzpHdMqZP+IsRFbMrddw177Jl40GwsCKzCcuo8wXY627TpDZQ2 J6whFjRsm5JVFLDwj3uyiOYiJIjZkjVPrymbILVSyNE7nEqvYfP97C0FRxYlL9+TvDOm WcGzjdA/d7sOIBzvssge8zMXZEsXnKOYuqe0kcYhIqU2tCeBBiW97LjpfWoKo4LSpjYw vY7Q== X-Gm-Message-State: AOJu0YyEhin8uGAlONswlEFqnT/VppC9IzmURLQ59j7a7BwVeCOlz7Uw 3/6QxdkG4/385thi2/p7DZnotf2pneVIOIh25+ZPoBNL X-Google-Smtp-Source: AGHT+IG2qdsetdJ6ow0mpzcbbdEO1Ge9ID/6Ay+d0MlnhlrY2emhD19XirgEWLOkfyV6c0bH0JhFowmZWuxoBdqmE+k= X-Received: by 2002:a05:6870:649e:b0:1fa:fff4:5a15 with SMTP id cz30-20020a056870649e00b001fafff45a15mr1823160oab.45.1701529356209; Sat, 02 Dec 2023 07:02:36 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::331; envelope-from=ozzloy@gmail.com; helo=mail-ot1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275390 Archived-At: --000000000000da1404060b882ce4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable bump On Wed, Sep 13, 2023 at 11:10=E2=80=AFPM daniel watson wrote: > > 0. in one terminal, run this http server > https://git.sr.ht/~ozzloy/emacs-bug-63941/tree/master/item/server.py > 1. in another terminal, run > socat -v tcp-listen:8086,fork tcp:localhost:8085 > 2. browse to the page with EWW, > M-x eww localhost:8086 > 3. put the cursor on the word "Browse" > 4. select any file to which you have read access for uploading > 5. put cursor on "Submit" > 6. observe the full path of the file is sent to the server. this is > visible in both the python output and the socat output. > > i'm including the diff inline to make it easier to review without > downloading the attached file. > > --- > lisp/net/eww.el | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lisp/net/eww.el b/lisp/net/eww.el > index 4ddda216afc..f28273dcc58 100644 > --- a/lisp/net/eww.el > +++ b/lisp/net/eww.el > @@ -1849,7 +1849,7 @@ eww-submit > (insert-file-contents file) > (buffer-string))) > (cons "name" name) > - (cons "filename" file)) > + (cons "filename" (file-name-nondirectory file)= )) > values))) > ((equal (plist-get input :type) "submit") > ;; We want the values from buttons if we hit a button if > -- > 2.39.2 > > > > > In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, > cairo version 1.16.0) of 2023-08-03 built on bos03-amd64-031 > Repository revision: cf57ec68c2a5ac5b721f445928869ca14232a4d1 > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.1210100= 7 > System Description: Ubuntu 23.04 > > Configured using: > 'configure --prefix=3D/snap/emacs/current/usr --with-x-toolkit=3Dgtk3 > --without-xaw3d --with-modules --with-cairo > --with-native-compilation=3Daot --with-xinput2 --with-tree-sitter > --with-json > 'CFLAGS=3D-isystem/build/emacs/parts/emacs/install/usr/include > -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu > -isystem/build/emacs/stage/usr/include -O2' > 'CPPFLAGS=3D-isystem/build/emacs/parts/emacs/install/usr/include > -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu > -isystem/build/emacs/stage/usr/include' > 'LDFLAGS=3D-L/build/emacs/parts/emacs/install/lib > -L/build/emacs/parts/emacs/install/usr/lib > -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu > -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu > -L/build/emacs/stage/usr/lib'' > > > --000000000000da1404060b882ce4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
bump

On Wed, Sep 13, 2023 at 11:10=E2=80=AFPM daniel wa= tson <ozzloy@challenge-bot.c= om> wrote:
https://git.sr.ht/~= ozzloy/emacs-bug-63941/tree/master/item/server.py
1. in another terminal, run
=C2=A0 =C2=A0socat -v tcp-listen:8086,fork tcp:localhost:8085
2. browse to the page with EWW,
=C2=A0 =C2=A0M-x eww <ENTER> localhost:8086 <ENTER>
3. put the cursor on the word "Browse" <ENTER>
4. select any file to which you have read access for uploading
5. put cursor on "Submit" <ENTER>
6. observe the full path of the file is sent to the server.=C2=A0 this is =C2=A0 =C2=A0visible in both the python output and the socat output.

i'm including the diff inline to make it easier to review without
downloading the attached file.

---
=C2=A0lisp/net/eww.el | 2 +-
=C2=A01 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 4ddda216afc..f28273dcc58 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1849,7 +1849,7 @@ eww-submit
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(insert-file-contents f= ile)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(buffer-string)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(cons "name" name)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (cons "filename" file))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (cons "filename" (file-name-nondirectory file))= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0values)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((equal (plist-get input :type) &q= uot;submit")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; We want the values from button= s if we hit a button if
--
2.39.2




In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
=C2=A0cairo version 1.16.0) of 2023-08-03 built on bos03-amd64-031
Repository revision: cf57ec68c2a5ac5b721f445928869ca14232a4d1
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.1= 2101007
System Description: Ubuntu 23.04

Configured using:
=C2=A0'configure --prefix=3D/snap/emacs/current/usr --with-x-toolkit=3D= gtk3
=C2=A0--without-xaw3d --with-modules --with-cairo
=C2=A0--with-native-compilation=3Daot --with-xinput2 --with-tree-sitter
=C2=A0--with-json
=C2=A0'CFLAGS=3D-isystem/build/emacs/parts/emacs/install/usr/include =C2=A0-isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu=
=C2=A0-isystem/build/emacs/stage/usr/include -O2'
=C2=A0'CPPFLAGS=3D-isystem/build/emacs/parts/emacs/install/usr/include<= br> =C2=A0-isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu=
=C2=A0-isystem/build/emacs/stage/usr/include'
=C2=A0'LDFLAGS=3D-L/build/emacs/parts/emacs/install/lib
=C2=A0-L/build/emacs/parts/emacs/install/usr/lib
=C2=A0-L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
=C2=A0-L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
=C2=A0-L/build/emacs/stage/usr/lib''


--000000000000da1404060b882ce4--