Accepting request 437307 from GNOME:Next

New upstream release

OBS-URL: https://build.opensuse.org/request/show/437307
OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/desktop-file-utils?expand=0&rev=58
This commit is contained in:
Dirk Mueller 2016-10-28 16:16:39 +00:00 committed by Git OBS Bridge
parent f9db17ab55
commit aae2464df6
9 changed files with 31 additions and 279 deletions

View File

@ -1,25 +0,0 @@
From 848c82b2332d0556c22c10a9c64d1f39850271fe Mon Sep 17 00:00:00 2001
From: Michael Webster <miketwebster@gmail.com>
Date: Fri, 7 Mar 2014 20:16:52 -0500
Subject: Add Cinnamon to list of registered environments.
https://github.com/linuxmint/Cinnamon
https://bugs.freedesktop.org/show_bug.cgi?id=73497
diff --git a/src/validate.c b/src/validate.c
index 77a5fda..6859c1b 100644
--- a/src/validate.c
+++ b/src/validate.c
@@ -363,7 +363,7 @@ static DesktopKeyDefinition registered_action_keys[] = {
};
static const char *show_in_registered[] = {
- "GNOME", "KDE", "LXDE", "MATE", "Razor", "ROX", "TDE", "Unity", "XFCE", "Old"
+ "Cinnamon", "GNOME", "KDE", "LXDE", "MATE", "Razor", "ROX", "TDE", "Unity", "XFCE", "Old"
};
static struct {
--
cgit v0.10.2

View File

@ -1,23 +0,0 @@
From be0c630a19aa1788ef731def911770ce497d6ba3 Mon Sep 17 00:00:00 2001
From: David Faure <faure@kde.org>
Date: Tue, 1 Apr 2014 22:29:08 +0200
Subject: Add EDE to the list of desktop environments
https://bugs.freedesktop.org/show_bug.cgi?id=56353
diff --git a/src/validate.c b/src/validate.c
index 6859c1b..b4b752e 100644
--- a/src/validate.c
+++ b/src/validate.c
@@ -363,7 +363,7 @@ static DesktopKeyDefinition registered_action_keys[] = {
};
static const char *show_in_registered[] = {
- "Cinnamon", "GNOME", "KDE", "LXDE", "MATE", "Razor", "ROX", "TDE", "Unity", "XFCE", "Old"
+ "GNOME", "KDE", "LXDE", "MATE", "Razor", "ROX", "TDE", "Unity", "XFCE", "Cinnamon", "EDE", "Old"
};
static struct {
--
cgit v0.10.2

View File

@ -1,174 +0,0 @@
From 9e279cc3fac9a7e92bf426867fa83c0c7aec5711 Mon Sep 17 00:00:00 2001
From: Jerome Leclanche <jerome@leclan.ch>
Date: Tue, 1 Apr 2014 15:33:16 +0200
Subject: desktop-file-validate: Trailing semicolons have been downgraded to
optional
https://bugs.freedesktop.org/show_bug.cgi?id=76902
Approved by David Faure and Ryan Lortie
diff --git a/src/validate.c b/src/validate.c
index 68fd6f0..77a5fda 100644
--- a/src/validate.c
+++ b/src/validate.c
@@ -765,9 +765,6 @@ validate_numeric_key (kf_validator *kf,
/* + Values of type string may contain all ASCII characters except for control
* characters.
* Checked.
- * + The multiple values should be separated by a semicolon. Those keys which
- * have several values should have a semicolon as the trailing character.
- * Checked.
* + FIXME: how should an empty list be handled?
*/
static gboolean
@@ -799,24 +796,6 @@ validate_string_regexp_list_key (kf_validator *kf,
return FALSE;
}
- if (i > 0 && value[i - 1] != ';') {
- print_fatal (kf, "value \"%s\" for %s list key \"%s\" in group \"%s\" "
- "does not have a semicolon (';') as trailing "
- "character\n",
- value, type, key, kf->current_group);
-
- return FALSE;
- }
-
- if (i > 1 && value[i - 1] == ';' && value[i - 2] == '\\' &&
- (i < 3 || value[i - 3] != '\\')) {
- print_fatal (kf, "value \"%s\" for %s list key \"%s\" in group \"%s\" "
- "has an escaped semicolon (';') as trailing character\n",
- value, type, key, kf->current_group);
-
- return FALSE;
- }
-
return TRUE;
}
@@ -845,10 +824,6 @@ validate_regexp_list_key (kf_validator *kf,
* + If a postfixed key occurs, the same key must be also present without the
* postfix.
* Checked.
- * + The multiple values should be separated by a semicolon. Those keys which
- * have several values should have a semicolon as the trailing character.
- * FIXME: partly checked. We use checks that work for sure for ascii
- * characters, but that could possibly fail in some weird UTF-8 strings.
* + FIXME: how should an empty list be handled?
*/
static gboolean
@@ -858,7 +833,6 @@ validate_localestring_list_key (kf_validator *kf,
const char *value)
{
char *locale_key;
- int len;
if (locale)
locale_key = g_strdup_printf ("%s[%s]", key, locale);
@@ -876,27 +850,6 @@ validate_localestring_list_key (kf_validator *kf,
return FALSE;
}
- len = strlen (value);
-
- if (len > 0 && value[len - 1] != ';') {
- print_fatal (kf, "value \"%s\" for locale string list key \"%s\" in group "
- "\"%s\" does not have a semicolon (';') as trailing "
- "character\n",
- value, locale_key, kf->current_group);
-
- return FALSE;
- }
-
- if (len > 1 && value[len - 1] == ';' && value[len - 2] == '\\' &&
- (len < 3 || value[len - 3] != '\\')) {
- print_fatal (kf, "value \"%s\" for locale string list key \"%s\" in group "
- "\"%s\" has an escaped semicolon (';') as trailing "
- "character\n",
- value, locale_key, kf->current_group);
-
- return FALSE;
- }
-
if (!g_hash_table_lookup (kf->current_keys, key)) {
print_fatal (kf, "key \"%s\" in group \"%s\" is a localized key, but "
"there is no non-localized key \"%s\"\n",
@@ -3109,45 +3062,11 @@ desktop_file_validate (const char *filename,
return (!kf.fatal_error);
}
-static void
-fixup_list (GKeyFile *keyfile,
- const gchar *filename,
- const gchar *key)
-{
- char *value;
- int len;
-
- value = g_key_file_get_value (keyfile, GROUP_DESKTOP_ENTRY, key, NULL);
- if (!value)
- return;
-
- len = strlen (value);
-
- if (len > 0 && (value[len - 1] != ';' ||
- (len > 1 && value[len - 2] == '\\' &&
- (len < 3 || value[len - 3] != '\\')))) {
- char *str;
-
- g_printerr ("%s: warning: key \"%s\" is a list and does not have a "
- "semicolon as trailing character, fixing\n",
- filename, key);
-
- str = g_strconcat (value, ";", NULL);
- g_key_file_set_value (keyfile, GROUP_DESKTOP_ENTRY,
- key, str);
- g_free (str);
- }
-}
-
/* return FALSE if we were unable to fix the file */
gboolean
desktop_file_fixup (GKeyFile *keyfile,
const char *filename)
{
- gchar **keys;
- gsize keys_nb;
- unsigned int i;
-
if (g_key_file_has_group (keyfile, GROUP_KDE_DESKTOP_ENTRY)) {
g_printerr ("%s: warning: renaming deprecated \"%s\" group to \"%s\"\n",
filename, GROUP_KDE_DESKTOP_ENTRY, GROUP_DESKTOP_ENTRY);
@@ -3155,29 +3074,5 @@ desktop_file_fixup (GKeyFile *keyfile,
GROUP_KDE_DESKTOP_ENTRY, GROUP_DESKTOP_ENTRY);
}
- keys = g_key_file_get_keys (keyfile, GROUP_DESKTOP_ENTRY, &keys_nb, NULL);
-
- /* Fix lists to have a ';' at the end if they don't */
- for (i = 0; i < G_N_ELEMENTS (registered_desktop_keys); i++) {
- if (registered_desktop_keys[i].type == DESKTOP_STRING_LIST_TYPE ||
- registered_desktop_keys[i].type == DESKTOP_REGEXP_LIST_TYPE)
- fixup_list (keyfile, filename, registered_desktop_keys[i].name);
-
- if (registered_desktop_keys[i].type == DESKTOP_LOCALESTRING_LIST_TYPE) {
- gsize keylen;
- guint j;
-
- keylen = strlen (registered_desktop_keys[i].name);
- for (j = 0; j < keys_nb; j++) {
- if (g_str_has_prefix (keys[j], registered_desktop_keys[i].name) &&
- (keys[j][keylen] == '[' || keys[j][keylen] == '\0')) {
- fixup_list (keyfile, filename, keys[j]);
- }
- }
- }
- }
-
- g_strfreev (keys);
-
return TRUE;
}
--
cgit v0.10.2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:843532672692f98e9b2d6ae6cc8658da562dfde1606c7f33d9d227a344de56c5
size 131028

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c094031bdec46c9f621708f919084e1cb5294e2c5b1e4c883b3e70cb8903385
size 132000

View File

@ -1,34 +0,0 @@
From cddcd6612b66cb3963920b5f2734850a217d7020 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Mon, 29 Feb 2016 01:50:14 +0100
Subject: [PATCH] validate: Fix buffer over-read on incomplete escape sequence.
https://bugs.freedesktop.org/show_bug.cgi?id=94303
---
src/validate.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/validate.c b/src/validate.c
index b4b752e..7403c18 100644
--- a/src/validate.c
+++ b/src/validate.c
@@ -1225,6 +1225,16 @@ handle_exec_key (kf_validator *kf,
break;
case '\\':
PRINT_INVALID_IF_FLAG;
+
+ /* Escape character immediately followed by \0? */
+ if (*(c + 1) == '\0') {
+ print_fatal (kf, "value \"%s\" for key \"%s\" in group \"%s\" "
+ "ends in an incomplete escape sequence\n",
+ value, locale_key, kf->current_group);
+ retval = FALSE;
+ break;
+ }
+
c++;
if (*c == '\\' && in_quote)
escaped = !escaped;
--
1.8.4.5

View File

@ -1,15 +1,15 @@
Index: src/validate.c
===================================================================
--- src/validate.c.orig
+++ src/validate.c
@@ -315,6 +315,10 @@ static DesktopKeyDefinition registered_d
{ DESKTOP_BOOLEAN_TYPE, "DBusActivatable", FALSE, FALSE, FALSE, NULL },
--- src/validate.c.orig 2016-06-18 19:00:22.000000000 +0200
+++ src/validate.c 2016-10-15 13:05:26.067464415 +0200
@@ -319,6 +319,10 @@ static DesktopKeyDefinition registered_d
{ DESKTOP_BOOLEAN_TYPE, "DBusActivatable", FALSE, FALSE, FALSE, handle_dbus_activatable_key },
+ /* SuSE specific */
+ { DESKTOP_BOOLEAN_TYPE, "X-SuSE-translate", FALSE, FALSE, FALSE, NULL },
+
+
/* Keys reserved for KDE */
/* since 0.9.4 */

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Sat Oct 15 06:57:19 UTC 2016 - zaitor@opensuse.org
- Update to version 0.23:
+ Accept version 1.1 desktop files.
+ Add Cinnamon, EDE and LXQt to the list of registered desktop
environments (fdo#73497, fdo#56353, fdo#79561).
+ Allow multipart/related MIME type; it's used for MHTML
(fdo#93376).
+ Ensure DBusActivatable filenames conform to reverse-DNS
notation (fdo#66904).
+ Downgrade trailing semicolons to optional (fdo#76902).
+ Fix buffer over-read (fdo#94303).
- Drop upstreamed fixed patches:
+ desktop-file-utils-fdo94303-fix-buffer-over-read.patch.
+ U_add-Cinnamon-desktop-environment_50271fe.patch.
+ U_add-EDE-desktop-environment_97d6ba3.patch.
+ U_trailing-semicolons-are-optional_aec5711.patch.
- Rebase desktop-file-utils-suse-keys.patch.
-------------------------------------------------------------------
Wed Oct 12 19:28:12 UTC 2016 - dimstar@opensuse.org

View File

@ -17,7 +17,7 @@
Name: desktop-file-utils
Version: 0.22
Version: 0.23
Release: 0
Summary: Utilities for Manipulating Desktop Files
License: GPL-2.0+
@ -28,14 +28,6 @@ Source1: suse-update-mime-defaults
Source2: macros.desktop-file-utils
# PATCH-FEATURE-OPENSUSE desktop-file-utils-suse-keys.patch vuntz@opensuse.org -- Handle SUSE-specific keys in validator. This is not strictly necessary, since they are prefixed with X-, but we can verify that the value has the right type.
Patch0: desktop-file-utils-suse-keys.patch
# PATCH-FIX-UPSTREAM U_trailing-semicolons-are-optional_aec5711.patch fdo#76902 stefan.bruens@rwth-aachen.de -- trailing semicolons are no longer required
Patch1: U_trailing-semicolons-are-optional_aec5711.patch
# PATCH-FEATURE-UPSTREAM U_add-Cinnamon-desktop-environment_50271fe.patch fdo#73497 stefan.bruens@rwth-aachen.de -- Register the Cinnamon desktop environment
Patch2: U_add-Cinnamon-desktop-environment_50271fe.patch
# PATCH-FEATURE-UPSTREAM U_add-EDE-desktop-environment_97d6ba3.patch fdo#56353 stefan.bruens@rwth-aachen.de -- EDE as registered OnlyShowIn environment
Patch3: U_add-EDE-desktop-environment_97d6ba3.patch
# PATCH-FIX-UPSTREAM desktop-file-utils-fdo94303-fix-buffer-over-read.patch fdo#94303 hpj@suse.com -- heap-based buffer overflow in validate.c while processing crafted file
Patch4: desktop-file-utils-fdo94303-fix-buffer-over-read.patch
BuildRequires: glib2-devel
BuildRequires: pkg-config
BuildRequires: xz
@ -53,10 +45,6 @@ http://freedesktop.org/wiki/Specifications/desktop-entry-spec
%prep
%setup -q
%patch0
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
%configure \