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 658028 - web-apps: .desktop file creation fails if the name includes a filesystem forbidden character
web-apps: .desktop file creation fails if the name includes a filesystem forb...
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on: 658010
Blocks:
 
 
Reported: 2011-09-02 04:51 UTC by Diego Escalante Urrelo (not reading bugmail)
Modified: 2012-03-14 12:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
web apps: Remove G_DIRECTORY_SEPARATOR chars from filenames (959 bytes, patch)
2011-09-09 16:36 UTC, Claudio Saavedra
committed Details | Review
Convert app names to the proper encoding before using them as filenames (2.74 KB, patch)
2011-09-09 16:36 UTC, Claudio Saavedra
rejected Details | Review
Convert app names to the proper encoding before using them as filenames (5.19 KB, patch)
2011-09-12 15:12 UTC, Claudio Saavedra
accepted-commit_after_freeze Details | Review
Display an error dialog if the application name is somehow not valid (1.19 KB, patch)
2011-09-12 15:13 UTC, Claudio Saavedra
reviewed Details | Review
Convert app names to the proper encoding before using them as filenames (5.26 KB, patch)
2012-02-08 12:41 UTC, Claudio Saavedra
committed Details | Review

Description Diego Escalante Urrelo (not reading bugmail) 2011-09-02 04:51:33 UTC
I think we might want to use the domain instead of the page title in ".gnome2/epiphany/app-<name>/".

Agree? I'll cook a patch.
Comment 1 Xan Lopez 2011-09-02 07:42:07 UTC
I don't really agree no, I think title works much better by default. We should just try to not create names that won't work. Can you give examples?
Comment 2 Diego Escalante Urrelo (not reading bugmail) 2011-09-03 02:18:43 UTC
"Twitter / Home" triggered this for me, because of the "/". AFAICT glib has no API to clean filesystem unfriendly characters. It can URI encode or Markup encode, but nothing for illegal filesystem names.
Comment 3 Claudio Saavedra 2011-09-09 16:36:04 UTC
Created attachment 196123 [details] [review]
web apps: Remove G_DIRECTORY_SEPARATOR chars from filenames

To avoid nasty surprises
Comment 4 Claudio Saavedra 2011-09-09 16:36:07 UTC
Created attachment 196124 [details] [review]
Convert app names to the proper encoding before using them as filenames
Comment 5 Claudio Saavedra 2011-09-09 16:37:17 UTC
These patches depend on the one in bug 658010
Comment 6 Xan Lopez 2011-09-11 14:34:39 UTC
Review of attachment 196123 [details] [review]:

OK.
Comment 7 Xan Lopez 2011-09-11 14:37:47 UTC
Review of attachment 196124 [details] [review]:

Since we are bothering to do this I guess we should at least check if there was an error? Dunno, otherwise it's crash in the next line. Also this is borderline "factor this into a method" :P
Comment 8 Claudio Saavedra 2011-09-12 10:46:11 UTC
Comment on attachment 196123 [details] [review]
web apps: Remove G_DIRECTORY_SEPARATOR chars from filenames

Attachment 196123 [details] pushed as 253893c - web apps: Remove G_DIRECTORY_SEPARATOR chars from filenames
Comment 9 Claudio Saavedra 2011-09-12 13:35:23 UTC
(In reply to comment #7)
> Review of attachment 196124 [details] [review]:
> 
> Since we are bothering to do this I guess we should at least check if there was
> an error? Dunno, otherwise it's crash in the next line.

Maybe I am too naive, but the only reason why this would crash is that we get fed incomplete UTF-8 strings by GTK+, which shouldn't happen in theory..

> Also this is borderline "factor this into a method" :P

Yes, I thought about that, but in only two cases it's the same code, for a third one is slightly different.. also, in create_desktop_file() I do need the UTF-8 wm_class anyway.
Comment 10 Claudio Saavedra 2011-09-12 15:12:18 UTC
Created attachment 196272 [details] [review]
Convert app names to the proper encoding before using them as filenames

Also add proper conversion error handling where needed.
Comment 11 Claudio Saavedra 2011-09-12 15:13:16 UTC
Created attachment 196273 [details] [review]
Display an error dialog if the application name is somehow not valid
Comment 12 Xan Lopez 2011-09-22 10:16:37 UTC
Review of attachment 196272 [details] [review]:

Looks good to me.

::: src/window-commands.c
@@ +561,3 @@
 	if (response == GTK_RESPONSE_OK) {
 		profile_dir = ephy_web_application_get_profile_directory (gtk_entry_get_text (GTK_ENTRY (data->entry)));
+		if (!profile_dir) {

In theory the brace is wrong, although I can see there's another one wrong right before it :D
Comment 13 Xan Lopez 2011-09-22 10:22:36 UTC
Review of attachment 196273 [details] [review]:

OK, crazy idea. Couldn't we validate th ename before killing the dialog? Showing a dialog after a dialog seems like a sort of bad UI. Perhaps this means a bit more refactoring in the other patch though.
Comment 14 Claudio Saavedra 2011-11-21 18:04:56 UTC
Where are we standing with this? I kinda lost track of it..
Comment 15 André Klapper 2012-02-02 20:20:40 UTC
Xan: What's the status of this? Asking as the patch still has accepted-commit_after_freeze status...
Comment 16 Xan Lopez 2012-02-07 10:40:14 UTC
I think Claudio did not commit the patch after freeze, and for the other one my comments still applies I guess. The entire dialog is going to be redesigned anyway, so perhaps it's worth talking with Lapo at this point. See https://github.com/gnome-design-team/gnome-mockups/blob/master/web/save-as-webapp.png
Comment 17 Claudio Saavedra 2012-02-08 12:41:14 UTC
Created attachment 207095 [details] [review]
Convert app names to the proper encoding before using them as filenames

Also add proper conversion error handling where needed.
Comment 18 Claudio Saavedra 2012-02-08 12:43:18 UTC
Attachment 207095 [details] pushed as db10ae9 - Convert app names to the proper encoding before using them as filenames
Comment 19 Xan Lopez 2012-03-14 12:53:49 UTC
I think everything we wanted to push here has been pushed, closing.