After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615323 - Can't save file with forwardslash in name
Can't save file with forwardslash in name
Status: RESOLVED DUPLICATE of bug 628644
Product: epiphany
Classification: Core
Component: Downloads
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-09 19:25 UTC by Sam Morris
Modified: 2011-02-01 16:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sam Morris 2010-04-09 19:25:13 UTC
Following the link at http://code.google.com/p/msysgit/issues/detail?id=277#c10 presents me with the 'save as' 'cancel' 'open' dialog box.

If I click 'open' then nothing happens; the file is not downloaded or opened. According to strace, I see:

open("/home/sam/.gnome2/epiphany/downloads/share/WinGit/ReleaseNotes.rtf", O_WRONLY|O_CREAT|O_EXCL, 0666) = -1 ENOENT (No such file or directory)

If I click 'save as' then Save, the file chooser does not go away but remains on screen. I have to remove the slashes from the filename in order for the Save action to work.

While those seem like two separate bugs, they both have the same cause:

$ HEAD 'http://repo.or.cz/w/msysgit.git/blob_plain/devel:/share/WinGit/ReleaseNotes.rtf' | grep filename
Content-Disposition: inline; filename="share/WinGit/ReleaseNotes.rtf"

If you use take the basename of the path suggested by the server and use that as the filename, rather than the full path itself, then I think things will behave more sensibly.
Comment 1 Sam Morris 2010-04-09 19:31:27 UTC
Thinking about this further: are there security issues? Say the file was served with a suggested filename of "../../../.profile"; would that create a file that will be executed when I next log in?
Comment 2 Dan Winship 2010-04-09 22:11:07 UTC
yes, epiphany should definitely be ignoring any path components in Content-Disposition, for just that reason.

If you use soup_message_headers_get_content_disposition(), it automatically strips the path for you.

(It's been suggested that there should probably be a "soup_message_get_filename()" that would use the Request URI, Content-Location, or Content-Disposition as appropriate to come up with a good filename.)
Comment 3 Diego Escalante Urrelo (not reading bugmail) 2011-02-01 16:07:06 UTC

*** This bug has been marked as a duplicate of bug 628644 ***