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 770260 - privacy: Unquote distro name in Problem Reporting
privacy: Unquote distro name in Problem Reporting
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Privacy
unspecified
Other All
: Normal normal
: ---
Assigned To: Rui Matos
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-23 03:36 UTC by Jeremy Bicha
Modified: 2016-08-30 11:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
privacy: Unquote distro name in Problem Reporting (705 bytes, patch)
2016-08-23 03:36 UTC, Jeremy Bicha
none Details | Review
Screenshot (17.33 KB, image/png)
2016-08-23 03:37 UTC, Jeremy Bicha
  Details
privacy: Unquote distro name in Problem Reporting (718 bytes, patch)
2016-08-23 03:51 UTC, Jeremy Bicha
none Details | Review
privacy: Unquote distro name & privacy policy url in Problem Reporting (953 bytes, patch)
2016-08-29 05:38 UTC, Jeremy Bicha
needs-work Details | Review
privacy: Fix quoting of distro name and privacy URL (1.31 KB, patch)
2016-08-29 11:54 UTC, Bastien Nocera
committed Details | Review

Description Jeremy Bicha 2016-08-23 03:36:50 UTC
According to the /etc/os-release specification, the NAME value must be enclosed in quotation marks if it contains more than one word (such as Red Hat Enterprise Linux or Debian GNU/Linux). If it contains only one word, apparently quotations are optional.

Although Fedora uses NAME=Fedora, Ubuntu uses NAME="Ubuntu" (although if you use Fedora, note that /etc/os-release encases "Fedora" in quotation marks for other fields.) As currently implemented in gnome-control-center 3.20.1, a distro that uses quotes will get this message in the Problem Reporting dialog in the Privacy panel (assuming Problem Reporting is enabled).

==
Sending reports of technical problems helps us improve "Ubuntu". Reports are sent anonymously and are scrubbed of personal data.
==

The quotation marks (single or double) should be removed first.

Screenshot and patch attached.

I'd like to commit this to the 3.18 and 3.20 branches too.
Comment 1 Jeremy Bicha 2016-08-23 03:36:54 UTC
Created attachment 333955 [details] [review]
privacy: Unquote distro name in Problem Reporting
Comment 2 Jeremy Bicha 2016-08-23 03:37:52 UTC
Created attachment 333956 [details]
Screenshot
Comment 3 Jeremy Bicha 2016-08-23 03:51:54 UTC
Created attachment 333957 [details] [review]
privacy: Unquote distro name in Problem Reporting

Correct the previous patch by moving g_shell_unquote above the fallback to
GNOME in case g_shell_unquote fails (and sets name to NULL).
Comment 5 Jeremy Bicha 2016-08-29 05:38:41 UTC
Created attachment 334328 [details] [review]
privacy: Unquote distro name & privacy policy url in Problem Reporting

I found a similar problem with the privacy policy url being broken if it's
in quotes (like Ubuntu's is) so here's an updated patch for it.
Comment 6 Bastien Nocera 2016-08-29 09:43:40 UTC
Review of attachment 334328 [details] [review]:

::: panels/privacy/cc-privacy-panel.c
@@ +105,3 @@
     }
 
+  name = g_shell_unquote (name, NULL);

1) This very likely breaks when name is NULL
2) it leaks the original "name" variable

@@ +140,3 @@
     }
 
+  name = g_shell_unquote (name, NULL);

Ditto here.
Comment 7 Bastien Nocera 2016-08-29 11:54:11 UTC
Created attachment 334356 [details] [review]
privacy: Fix quoting of distro name and privacy URL

Unquote the distribution name and the privacy policy url in
the Problem Reporting dialogue, as those can be shell-quoted (the format
used by /etc/os-release is "shell-compatible").
Comment 8 Bastien Nocera 2016-08-29 12:25:10 UTC
Attachment 334356 [details] pushed as 3986413 - privacy: Fix quoting of distro name and privacy URL
Comment 9 Bastien Nocera 2016-08-30 11:02:47 UTC
Pushed to gnome-3-20 branch as well.