Hello community,

here is the log from the commit of package menu-cache for openSUSE:Factory 
checked in at 2015-12-21 12:04:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/menu-cache (Old)
 and      /work/SRC/openSUSE:Factory/.menu-cache.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "menu-cache"

Changes:
--------
--- /work/SRC/openSUSE:Factory/menu-cache/menu-cache.changes    2015-11-22 
10:59:56.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.menu-cache.new/menu-cache.changes       
2015-12-21 12:04:13.000000000 +0100
@@ -1,0 +2,22 @@
+Mon Dec  7 16:42:24 UTC 2015 - [email protected]
+
+- New upstream release 1.0.1
+  * Fixed crash on generating menu with both tags <DefaultAppDirs/> 
+    and <KDELegacyDirs/> present.
+  * Fixed crash when menu-cache-gen ran manually without
+    CACHE_GEN_VERSION.
+  * Fixed crash in menu-cache-gen on <Filename> in menu layout with 
+    <OnlyUnallocated/> tag present.
+  * Fixed incorrect processing of <Merge type=”files”> in 
+    menu-cache-gen.
+  * Added safeguards against environment variables containing 
+    newlines.
+  * Fixed case when cache was not updated while it should, it was 
+    claimed to be fixed in 1.0.0 but apparently fix was incomplete.
+  * Fixed ignored <Filename> tags inside of <Layout>.
+  * Fixed memory corruption in scanning <LegacyDir> addressed 
+    directory.
+  * Removed menu-cache-1.0.0-Fix-crash-on-generating-menu.patch
+  * Removed menu-cache-1.0.0-Fix-crash-CACHE_GEN_VERSION.patch
+
+-------------------------------------------------------------------

Old:
----
  menu-cache-1.0.0-Fix-crash-CACHE_GEN_VERSION.patch
  menu-cache-1.0.0-Fix-crash-on-generating-menu.patch
  menu-cache-1.0.0.tar.xz

New:
----
  menu-cache-1.0.1.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ menu-cache.spec ++++++
--- /var/tmp/diff_new_pack.V6kQwy/_old  2015-12-21 12:04:14.000000000 +0100
+++ /var/tmp/diff_new_pack.V6kQwy/_new  2015-12-21 12:04:14.000000000 +0100
@@ -17,17 +17,13 @@
 
 
 Name:           menu-cache
-Version:        1.0.0
+Version:        1.0.1
 Release:        0
 Summary:        A tool speed up menus
 License:        GPL-2.0+ and LGPL-2.1+
 Group:          System/GUI/LXDE
 Url:            http://www.lxde.org
 Source0:        %{name}-%{version}.tar.xz
-# [PATCH] Fix crash on generating menu with both tags <DefaultAppDirs/> and 
<KDELegacyDirs/> present
-Patch0:         menu-cache-1.0.0-Fix-crash-on-generating-menu.patch
-# [PATCH] Fix crash when menu-cache-gen ran manually without CACHE_GEN_VERSION
-Patch1:         menu-cache-1.0.0-Fix-crash-CACHE_GEN_VERSION.patch
 BuildRequires:  fdupes
 BuildRequires:  gtk-doc
 BuildRequires:  gtk2-devel
@@ -61,8 +57,6 @@
 
 %prep
 %setup -q
-%patch0 -p1
-%patch1 -p1
 
 %build
 export CFLAGS="%{optflags}"
@@ -93,6 +87,6 @@
 %files -n libmenu-cache3
 %defattr(-,root,root)
 %{_libdir}/libmenu-cache.so.3
-%{_libdir}/libmenu-cache.so.3.1.0
+%{_libdir}/libmenu-cache.so.3.1.1
 
 %changelog

++++++ menu-cache-1.0.0.tar.xz -> menu-cache-1.0.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/menu-cache-1.0.0/NEWS new/menu-cache-1.0.1/NEWS
--- old/menu-cache-1.0.0/NEWS   2014-10-23 15:12:12.000000000 +0200
+++ new/menu-cache-1.0.1/NEWS   2015-12-07 12:26:47.000000000 +0100
@@ -1,3 +1,25 @@
+Changes in 1.0.1 since 1.0.0:
+
+* Fixed crash on generating menu with both tags <DefaultAppDirs/> and
+    <KDELegacyDirs/> present.
+
+* Fixed crash when menu-cache-gen ran manually without CACHE_GEN_VERSION.
+
+* Fixed crash in menu-cache-gen on <Filename/> in menu layout with
+    <OnlyUnallocated/> tag present.
+
+* Fixed incorrect processing of <Merge type="files"> in menu-cache-gen.
+
+* Added safeguards against environment variables containing newlines.
+
+* Fixed case when cache was not updated while it should, it was claimed
+    to be fixed in 1.0.0 but apparently fix was incomplete.
+
+* Fixed ignored <Filename> tags inside of <Layout> tag.
+
+* Fixed memory corruption in scanning <LegacyDir> addressed directory.
+
+
 Changes in 1.0.0 since 0.7.0:
 
 * Added new cache file format generation support with changes:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/menu-cache-1.0.0/configure 
new/menu-cache-1.0.1/configure
--- old/menu-cache-1.0.0/configure      2014-10-23 15:13:33.000000000 +0200
+++ new/menu-cache-1.0.1/configure      2015-12-07 12:28:23.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for menu-cache 1.0.0.
+# Generated by GNU Autoconf 2.69 for menu-cache 1.0.1.
 #
 # Report bugs to <http://lxde.org/>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='menu-cache'
 PACKAGE_TARNAME='menu-cache'
-PACKAGE_VERSION='1.0.0'
-PACKAGE_STRING='menu-cache 1.0.0'
+PACKAGE_VERSION='1.0.1'
+PACKAGE_STRING='menu-cache 1.0.1'
 PACKAGE_BUGREPORT='http://lxde.org/'
 PACKAGE_URL=''
 
@@ -1358,7 +1358,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures menu-cache 1.0.0 to adapt to many kinds of systems.
+\`configure' configures menu-cache 1.0.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1428,7 +1428,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of menu-cache 1.0.0:";;
+     short | recursive ) echo "Configuration of menu-cache 1.0.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1557,7 +1557,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-menu-cache configure 1.0.0
+menu-cache configure 1.0.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1835,7 +1835,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by menu-cache $as_me 1.0.0, which was
+It was created by menu-cache $as_me 1.0.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2701,7 +2701,7 @@
 
 # Define the identity of the package.
  PACKAGE='menu-cache'
- VERSION='1.0.0'
+ VERSION='1.0.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -13522,7 +13522,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by menu-cache $as_me 1.0.0, which was
+This file was extended by menu-cache $as_me 1.0.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -13588,7 +13588,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-menu-cache config.status 1.0.0
+menu-cache config.status 1.0.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/menu-cache-1.0.0/configure.ac 
new/menu-cache-1.0.1/configure.ac
--- old/menu-cache-1.0.0/configure.ac   2014-10-23 15:12:12.000000000 +0200
+++ new/menu-cache-1.0.1/configure.ac   2015-12-07 12:26:47.000000000 +0100
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT([menu-cache], [1.0.0],
+AC_INIT([menu-cache], [1.0.1],
         [http://lxde.org/])
 
 AC_CONFIG_MACRO_DIR([m4])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/menu-cache-1.0.0/libmenu-cache/Makefile.am 
new/menu-cache-1.0.1/libmenu-cache/Makefile.am
--- old/menu-cache-1.0.0/libmenu-cache/Makefile.am      2014-10-23 
15:12:12.000000000 +0200
+++ new/menu-cache-1.0.1/libmenu-cache/Makefile.am      2015-12-07 
12:26:47.000000000 +0100
@@ -22,7 +22,7 @@
 libmenu_cache_la_LDFLAGS =                     \
        -no-undefined                           \
        -export-symbols-regex menu_cache        \
-       -version-info 4:0:1 \
+       -version-info 4:1:1 \
        $(NULL)
 
 lib_menu_cache_includedir = $(includedir)/menu-cache
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/menu-cache-1.0.0/libmenu-cache/Makefile.in 
new/menu-cache-1.0.1/libmenu-cache/Makefile.in
--- old/menu-cache-1.0.0/libmenu-cache/Makefile.in      2014-10-23 
15:13:33.000000000 +0200
+++ new/menu-cache-1.0.1/libmenu-cache/Makefile.in      2015-12-07 
12:28:22.000000000 +0100
@@ -357,7 +357,7 @@
 libmenu_cache_la_LDFLAGS = \
        -no-undefined                           \
        -export-symbols-regex menu_cache        \
-       -version-info 4:0:1 \
+       -version-info 4:1:1 \
        $(NULL)
 
 lib_menu_cache_includedir = $(includedir)/menu-cache
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/menu-cache-1.0.0/libmenu-cache/menu-cache.c 
new/menu-cache-1.0.1/libmenu-cache/menu-cache.c
--- old/menu-cache-1.0.0/libmenu-cache/menu-cache.c     2014-09-28 
18:00:07.000000000 +0200
+++ new/menu-cache-1.0.1/libmenu-cache/menu-cache.c     2015-12-07 
12:05:06.000000000 +0100
@@ -3,7 +3,7 @@
  *
  *      Copyright 2008 PCMan <[email protected]>
  *      Copyright 2009 Jürgen Hötzel <[email protected]>
- *      Copyright 2012-2014 Andriy Grytsenko (LStranger) <[email protected]>
+ *      Copyright 2012-2015 Andriy Grytsenko (LStranger) <[email protected]>
  *
  *      This library is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU Lesser General Public
@@ -1517,7 +1517,7 @@
     if(dpy && *dpy)
     {
         char* p = strchr(dpy, ':');
-        for(++p; *p && *p != '.';)
+        for(++p; *p && *p != '.' && *p != '\n';)
             ++p;
         if(*p)
             *p = '\0';
@@ -1743,16 +1743,31 @@
 #define __num2str(s) __def2str(s)
 #define __def2str(s) #s
 
+static inline char *_validate_env(const char *env)
+{
+    char *res, *c;
+
+    if (env)
+        res = g_strdup(env);
+    else
+        res = g_strdup("");
+    for (c = res; *c; c++)
+        if (*c == '\n' || *c == '\t')
+            *c = ' ';
+    return res;
+}
+
 static MenuCache* menu_cache_create(const char* menu_name)
 {
     MenuCache* cache;
     const gchar * const * langs = g_get_language_names();
-    const char* xdg_cfg = g_getenv("XDG_CONFIG_DIRS");
-    const char* xdg_prefix = g_getenv("XDG_MENU_PREFIX");
-    const char* xdg_data = g_getenv("XDG_DATA_DIRS");
-    const char* xdg_cfg_home = g_getenv("XDG_CONFIG_HOME");
-    const char* xdg_data_home = g_getenv("XDG_DATA_HOME");
-    const char* xdg_cache_home = g_getenv("XDG_CACHE_HOME");
+    const char* xdg_cfg_env = g_getenv("XDG_CONFIG_DIRS");
+    const char* xdg_prefix_env = g_getenv("XDG_MENU_PREFIX");
+    const char* xdg_data_env = g_getenv("XDG_DATA_DIRS");
+    const char* xdg_cfg_home_env = g_getenv("XDG_CONFIG_HOME");
+    const char* xdg_data_home_env = g_getenv("XDG_DATA_HOME");
+    const char* xdg_cache_home_env = g_getenv("XDG_CACHE_HOME");
+    char *xdg_cfg, *xdg_prefix, *xdg_data, *xdg_cfg_home, *xdg_data_home, 
*xdg_cache_home;
     char* buf;
     const char* md5;
     char* file_name;
@@ -1760,21 +1775,18 @@
     GChecksum *sum;
     char *langs_list;
 
-    if( !xdg_cfg )
-        xdg_cfg = "";
-    if( ! xdg_prefix )
-        xdg_prefix = "";
-    if( ! xdg_data )
-        xdg_data = "";
-    if( ! xdg_cfg_home )
-        xdg_cfg_home = "";
-    if( ! xdg_data_home )
-        xdg_data_home = "";
-    if( ! xdg_cache_home )
-        xdg_cache_home = "";
+    xdg_cfg = _validate_env(xdg_cfg_env);
+    xdg_prefix = _validate_env(xdg_prefix_env);
+    xdg_data = _validate_env(xdg_data_env);
+    xdg_cfg_home = _validate_env(xdg_cfg_home_env);
+    xdg_data_home = _validate_env(xdg_data_home_env);
+    xdg_cache_home = _validate_env(xdg_cache_home_env);
 
     /* reconstruct languages list in form as it should be in $LANGUAGES */
     langs_list = g_strjoinv(":", (char **)langs);
+    for (buf = langs_list; *buf; buf++) /* reusing buf var as char pointer */
+        if (*buf == '\n' || *buf == '\t')
+            *buf = ' ';
 
     buf = g_strdup_printf( "REG:%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t" CACHE_VERSION
                            "\t00000000000000000000000000000000\n",
@@ -1801,6 +1813,12 @@
     cache->menu_name = g_strdup(menu_name);
     g_free( file_name );
     g_free(langs_list);
+    g_free(xdg_cfg);
+    g_free(xdg_prefix);
+    g_free(xdg_data);
+    g_free(xdg_cfg_home);
+    g_free(xdg_data_home);
+    g_free(xdg_cache_home);
 
     g_checksum_free(sum); /* md5 is also freed here */
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/menu-cache-1.0.0/menu-cache-daemon/menu-cached.c 
new/menu-cache-1.0.1/menu-cache-daemon/menu-cached.c
--- old/menu-cache-1.0.0/menu-cache-daemon/menu-cached.c        2014-10-23 
15:12:12.000000000 +0200
+++ new/menu-cache-1.0.1/menu-cache-daemon/menu-cached.c        2015-12-07 
12:05:06.000000000 +0100
@@ -3,7 +3,7 @@
  *
  *      Copyright 2008 - 2010 PCMan <[email protected]>
  *      Copyright 2009 Jürgen Hötzel <[email protected]>
- *      Copyright 2012-2014 Andriy Grytsenko (LStranger) <[email protected]>
+ *      Copyright 2012-2015 Andriy Grytsenko (LStranger) <[email protected]>
  *
  *      This file is a part of libmenu-cache package and created program
  *      should be not used without the library.
@@ -441,7 +441,7 @@
     if(dpy && *dpy)
     {
         char* p = strchr(dpy, ':');
-        for(++p; *p && *p != '.';)
+        for(++p; *p && *p != '.' && *p != '\n';)
             ++p;
         if(*p)
             *p = '\0';
@@ -600,6 +600,7 @@
             else
             {
                 /* file loaded, schedule update anyway */
+                cache->need_reload = TRUE;
                 cache->delayed_reload_handler = 
g_timeout_add_seconds_full(G_PRIORITY_LOW, 3,
                                                     
(GSourceFunc)delayed_reload, cache, NULL);
             }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/menu-cache-1.0.0/menu-cache-gen/menu-compose.c 
new/menu-cache-1.0.1/menu-cache-gen/menu-compose.c
--- old/menu-cache-1.0.0/menu-cache-gen/menu-compose.c  2014-09-28 
18:00:07.000000000 +0200
+++ new/menu-cache-1.0.1/menu-cache-gen/menu-compose.c  2015-12-07 
12:05:06.000000000 +0100
@@ -1,7 +1,7 @@
 /*
  *      menu-compose.c : scans appropriate .desktop files and composes cache 
file.
  *
- *      Copyright 2014 Andriy Grytsenko (LStranger) <[email protected]>
+ *      Copyright 2014-2015 Andriy Grytsenko (LStranger) <[email protected]>
  *
  *      This file is a part of libmenu-cache package and created program
  *      should be not used without the library.
@@ -217,6 +217,21 @@
 
 static GSList *loaded_dirs = NULL;
 
+static GList *_make_def_layout(void)
+{
+    MenuMerge *mm;
+    GList *layout;
+
+    mm = g_slice_new(MenuMerge);
+    mm->type = MENU_CACHE_TYPE_NONE;
+    mm->merge_type = MERGE_FILES;
+    layout = g_list_prepend(NULL, mm);
+    mm = g_slice_new(MenuMerge);
+    mm->type = MENU_CACHE_TYPE_NONE;
+    mm->merge_type = MERGE_MENUS;
+    return g_list_prepend(layout, mm);
+}
+
 static void _fill_apps_from_dir(MenuMenu *menu, GList *lptr, GString *prefix,
                                 gboolean is_legacy)
 {
@@ -250,10 +265,8 @@
             if (is_legacy)
             {
                 MenuMenu *submenu = g_slice_new0(MenuMenu);
-                MenuMerge def_files = { .type = MENU_CACHE_TYPE_NONE, 
.merge_type = MERGE_FILES };
-                MenuMerge def_menus = { .type = MENU_CACHE_TYPE_NONE, 
.merge_type = MERGE_MENUS };
                 submenu->layout = menu->layout; /* copy all */
-                submenu->layout.items = g_list_prepend(g_list_prepend(NULL, 
&def_files), &def_menus);
+                submenu->layout.items = _make_def_layout(); /* default layout 
*/
                 submenu->layout.inline_limit_is_set = TRUE; /* marker */
                 submenu->name = g_strdup(name);
                 submenu->dir = g_intern_string(filename);
@@ -708,21 +721,29 @@
         case MENU_CACHE_TYPE_APP: /* MemuFilename */
             VDBG("composing Filename %s", ((MenuFilename *)app)->id);
             app = g_hash_table_lookup(all_apps, ((MenuFilename *)app)->id);
-            if (app == NULL || !app->matched || app->excluded)
+            if (app == NULL)
                 /* not available, ignoring it */
                 break;
             l = g_list_find(result, app); /* this might be slow but we have
                                              to do this because app might be
                                              already added into result */
             if (l != NULL)
+            {
                 /* move it out to this place */
                 result = g_list_remove_link(result, l);
+                VVDBG("+++ composing app %s (move)", app->id);
+            }
             else
             {
                 l = g_list_find(available, app);
+                VVDBG("+++ composing app %s%s", app->id, (l == NULL) ? " 
(add)" : "");
                 if (l != NULL)
                     available = g_list_remove_link(available, l);
+                else
+                    l = g_list_prepend(NULL, app);
             }
+            if (l != NULL)
+                app->menus = g_list_prepend(app->menus, menu);
             result = g_list_concat(l, result);
             break;
         case MENU_CACHE_TYPE_SEP: /* MenuSep */
@@ -732,6 +753,7 @@
         case MENU_CACHE_TYPE_NONE: /* MenuMerge */
             VDBG("composing Merge type %d", ((MenuMerge *)app)->merge_type);
             next = NULL;
+            tag = 0;
             switch (((MenuMerge *)app)->merge_type) {
             case MERGE_FILES:
                 tag = 1; /* use it as mark to not add dirs */
@@ -754,7 +776,7 @@
                 available = NULL;
                 /* continue with menus */
             case MERGE_MENUS:
-                for (l = menu->children; l; )
+                if (tag != 1) for (l = menu->children; l; )
                 {
                     if (((MenuMenu *)l->data)->layout.type == 
MENU_CACHE_TYPE_DIR)
                     {
@@ -1023,7 +1045,7 @@
     gboolean ok = FALSE;
 
     tmp = (char *)g_getenv("CACHE_GEN_VERSION");
-    if (sscanf(tmp, "%d.%u", &i, &req_version) == 2)
+    if (tmp && sscanf(tmp, "%d.%u", &i, &req_version) == 2)
     {
         if (i != VER_MAJOR) /* unsupported format requested */
             return FALSE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/menu-cache-1.0.0/menu-cache-gen/menu-merge.c 
new/menu-cache-1.0.1/menu-cache-gen/menu-merge.c
--- old/menu-cache-1.0.0/menu-cache-gen/menu-merge.c    2014-09-06 
18:27:45.000000000 +0200
+++ new/menu-cache-1.0.1/menu-cache-gen/menu-merge.c    2015-12-07 
12:02:16.000000000 +0100
@@ -1355,7 +1355,7 @@
         g_free(merged);
         /* destroy all KDELegacyDirs */
         for (l = children; l; l = l->next)
-            if (fm_xml_file_item_get_tag(l->data) == menuTag_KDELegacyDirs)
+            if (l->data && fm_xml_file_item_get_tag(l->data) == 
menuTag_KDELegacyDirs)
             {
                 fm_xml_file_item_destroy(l->data);
                 l->data = NULL;


Reply via email to