GNU bug report logs - #65973
[PATCH] ; send filename, not full path, on EWW form submit

Previous Next

Package: emacs;

Reported by: daniel watson <ozzloy <at> challenge-bot.com>

Date: Thu, 14 Sep 2023 07:48:01 UTC

Severity: normal

Tags: patch

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: daniel watson <ozzloy <at> challenge-bot.com>
Subject: bug#65973: closed (Re: bug#65973: [PATCH] ; send filename, not
 full path, on EWW form submit)
Date: Thu, 07 Nov 2024 19:01:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#65973: [PATCH] ; send filename, not full path, on EWW form submit

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 65973 <at> debbugs.gnu.org.

-- 
65973: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65973
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas <stefankangas <at> gmail.com>
Cc: sebastian <at> sebasmonia.com, ozzloy <at> challenge-bot.com, ozzloy <at> gmail.com,
 65973-done <at> debbugs.gnu.org
Subject: Re: bug#65973: [PATCH] ; send filename, not full path, on EWW form
 submit
Date: Thu, 7 Nov 2024 10:58:57 -0800
On 11/6/2024 10:20 PM, Eli Zaretskii wrote:
> But since the RFC says to ignore the leading directories, I think the
> change is okay, provided we describe the rationale in the comments to
> the code.  It is very unusual thing in Emacs to remove leading
> directories from a file name, so doing so generally begs for some
> commentary.

It sounds like we all agree on doing this for various reasons. I've now 
merged this to the master branch as f6b55678d76 with some commentary 
mentioning RFC 2183, so closing this bug.

Of course, if the commentary is insufficient or anyone notices any other 
issues, just let me know.

[Message part 3 (message/rfc822, inline)]
From: daniel watson <ozzloy <at> challenge-bot.com>
To: bug-gnu-emacs <at> gnu.org
Cc: daniel watson <ozzloy <at> gmail.com>
Subject: [PATCH] ; send filename, not full path, on EWW form submit
Date: Wed, 13 Sep 2023 23:10:11 -0700
[Message part 4 (text/plain, inline)]
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 <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.  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.12101007
System Description: Ubuntu 23.04

Configured using:
 'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
 --without-xaw3d --with-modules --with-cairo
 --with-native-compilation=aot --with-xinput2 --with-tree-sitter
 --with-json
 'CFLAGS=-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=-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=-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''


[0001-send-filename-not-full-path-on-EWW-form-submit.patch (text/x-diff, attachment)]

This bug report was last modified 194 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.