summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Move more gperf lookup code into the generated gperf filewip/kalev/gperf31Kalev Lember2017-01-302-7/+15
|
* Ignore compiler warnings from a generated gperf include fileKalev Lember2017-01-301-0/+5
| | | | | We can't really fix the warnings as it's a generated file; instead just ignore the warnings so they don't show up as noise.
* Fix the build with gperf 3.1Kalev Lember2017-01-291-2/+0
| | | | | | | Remove a declaration for a generated function that slightly changed its signature between gperf 3.0 and 3.1. Fixes: https://github.com/hughsie/appstream-glib/issues/148
* Add a destructor for AsRefStringKalev Lember2017-01-281-0/+6
| | | | | | | | | | AsRefString uses a singleton hash table for deduplicating strings. This is all "possibly lost" memory according to valgrind as the hash table never gets destroyed. This commit adds a custom destructor so that we can clean up the singleton hash table as well and avoid unnecessary noise in valgrind output.
* store: Fix use after free with hash table keysKalev Lember2017-01-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AsStore keeps a priv->hash_id hash table with app ID's as keys and a GPtrArray with the actual apps matching the app ID as values. To optimize memory use, the keys are all AsRefStrings. As all AsRefStrings are reference counted, they may get freed when the last app with the matching ID gets removed. To handle that case, make sure the remove the GPtrArray holding the apps as well when removing last app matching an ID. This fixes the following use after free when starting gnome-software: ==6065== Invalid read of size 1 ==6065== at 0x8E26650: __strcmp_sse2_unaligned (in /usr/lib64/libc-2.24.so) ==6065== by 0x8585678: g_str_equal (ghash.c:1846) ==6065== by 0x8584BDF: g_hash_table_lookup_node (ghash.c:396) ==6065== by 0x8584BDF: g_hash_table_lookup (ghash.c:1147) ==6065== by 0x4E789F2: as_store_add_app (as-store.c:1229) ==6065== by 0x4E797CA: as_store_from_root (as-store.c:1537) ==6065== by 0x4E7A71F: as_store_from_file_internal (as-store.c:1880) ==6065== by 0x4E7B7A9: as_store_load_app_info_file (as-store.c:2556) ==6065== by 0x4E7B9B8: as_store_load_app_info (as-store.c:2611) ==6065== by 0x4E7C352: as_store_search_app_info (as-store.c:2847) ==6065== by 0x4E7C598: as_store_search_per_system (as-store.c:2883) ==6065== by 0x4E7CF7F: as_store_load (as-store.c:3068) ==6065== by 0x1E512B7B: gs_plugin_setup (gs-plugin-appstream.c:255) ==6065== by 0x46A2C5: gs_plugin_loader_setup (gs-plugin-loader.c:3912) ==6065== by 0x46ECCE: gs_application_initialize_plugins (gs-application.c:228) ==6065== by 0x46ED99: gs_application_dbus_register (gs-application.c:249) ==6065== by 0x8007167: g_application_impl_attempt_primary (gapplicationimpl-dbus.c:406) ==6065== by 0x8007167: g_application_impl_register (gapplicationimpl-dbus.c:555) ==6065== by 0x8003F22: g_application_register (gapplication.c:2033) ==6065== by 0x47064D: gs_application_handle_local_options (gs-application.c:864) ==6065== by 0xEFCFC57: ffi_call_unix64 (unix64.S:76) ==6065== by 0xEFCF6B9: ffi_call (ffi64.c:525) ==6065== Address 0x259c1994 is 4 bytes inside a block of size 31 free'd ==6065== at 0x4C2ED4A: free (vg_replace_malloc.c:530) ==6065== by 0x859B6BD: g_free (gmem.c:189) ==6065== by 0x4E70A37: as_ref_string_unref_from_str (as-ref-string.c:48) ==6065== by 0x8583D22: g_hash_table_remove_node (ghash.c:455) ==6065== by 0x8584647: g_hash_table_remove_internal (ghash.c:1358) ==6065== by 0x4E70E09: as_ref_string_unref (as-ref-string.c:225) ==6065== by 0x4E510B4: as_app_finalize (as-app.c:473) ==6065== by 0x830E116: g_object_unref (gobject.c:3185) ==6065== by 0x8569E2D: g_ptr_array_remove_index (garray.c:1188) ==6065== by 0x856A230: g_ptr_array_remove (garray.c:1321) ==6065== by 0x4E77D49: as_store_remove_app (as-store.c:931) ==6065== by 0x4E789DB: as_store_add_app (as-store.c:1225) ==6065== by 0x4E797CA: as_store_from_root (as-store.c:1537) ==6065== by 0x4E7A71F: as_store_from_file_internal (as-store.c:1880) ==6065== by 0x4E7B7A9: as_store_load_app_info_file (as-store.c:2556) ==6065== by 0x4E7B9B8: as_store_load_app_info (as-store.c:2611) ==6065== by 0x4E7C352: as_store_search_app_info (as-store.c:2847) ==6065== by 0x4E7C598: as_store_search_per_system (as-store.c:2883) ==6065== by 0x4E7CF7F: as_store_load (as-store.c:3068) ==6065== by 0x1E512B7B: gs_plugin_setup (gs-plugin-appstream.c:255) ==6065== Block was alloc'd at ==6065== at 0x4C2DB9D: malloc (vg_replace_malloc.c:299) ==6065== by 0x859B5A8: g_malloc (gmem.c:94) ==6065== by 0x4E70ABF: as_ref_string_new_copy_with_length (as-ref-string.c:99) ==6065== by 0x4E6B908: as_node_reflow_text (as-node.c:516) ==6065== by 0x4E6BEF7: as_node_text_cb (as-node.c:707) ==6065== by 0x859A14D: g_markup_parse_context_parse (gmarkup.c:1514) ==6065== by 0x4E6C29C: as_node_from_xml (as-node.c:825) ==6065== by 0x4E5BAA8: as_app_parse_appdata_file (as-app.c:5665) ==6065== by 0x4E5BE6A: as_app_parse_file (as-app.c:5781) ==6065== by 0x4E7BEDB: as_store_load_installed (as-store.c:2743) ==6065== by 0x4E7C24B: as_store_search_installed (as-store.c:2825) ==6065== by 0x4E7C636: as_store_search_per_system (as-store.c:2890) ==6065== by 0x4E7CF7F: as_store_load (as-store.c:3068) ==6065== by 0x1E512B7B: gs_plugin_setup (gs-plugin-appstream.c:255) ==6065== by 0x46A2C5: gs_plugin_loader_setup (gs-plugin-loader.c:3912) ==6065== by 0x46ECCE: gs_application_initialize_plugins (gs-application.c:228) ==6065== by 0x46ED99: gs_application_dbus_register (gs-application.c:249) ==6065== by 0x8007167: g_application_impl_attempt_primary (gapplicationimpl-dbus.c:406) ==6065== by 0x8007167: g_application_impl_register (gapplicationimpl-dbus.c:555) ==6065== by 0x8003F22: g_application_register (gapplication.c:2033) ==6065== by 0x47064D: gs_application_handle_local_options (gs-application.c:864)
* trivial: Update app ID rename listKalev Lember2017-01-271-0/+22
|
* trivial: profile: Free mutex resources in finalize()Kalev Lember2017-01-271-0/+1
|
* AsStore: hold a ref in hash_unique_id to avoid use-after-free (#149)Simon McVittie2017-01-261-2/+2
| | | | | | | | | | If we rely on the reference here being "borrowed" from priv->array, then it's easy for that assumption to become unjustified. This caused a crash for me in as_store_remove_app_by_id, which removes the app from priv->array before it removes it from priv->hash_unique_id; if no other code is holding a ref to the same app, then as_app_get_unique_id() will be a use-after-free. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* appstream-compose: Support appdata with no desktop filesAlexander Larsson2017-01-181-22/+26
| | | | For instance, this happens for the runtimes
* Read and write the <custom> tagRichard Hughes2017-01-164-3/+9
| | | | | | | | Upstream ximion went with <custom> rather than <metadata> so write that if the context version is new enough. Support reading both as we have to support either way for basically forever. Resolves: https://github.com/hughsie/appstream-glib/issues/147
* Support reading metainfo.xml files when using appstream-composeRichard Hughes2017-01-161-18/+25
|
* Tighten a rule that classifies apps as web-appsKalev Lember2017-01-161-1/+1
| | | | | | ... so that Epiphany itself wouldn't get classified as one. https://bugzilla.gnome.org/show_bug.cgi?id=776860
* Do not ignore type=replace merge componentsRichard Hughes2017-01-121-1/+1
|
* trivial: post release version bumpRichard Hughes2017-01-122-5/+5
|
* Release version 0.6.7appstream_glib_0_6_7Richard Hughes2017-01-126-22/+42
|
* Only fail to validate <icon> in AppData desktop componentsRichard Hughes2017-01-111-2/+3
|
* trivial: Reset GError when skipping a fileKalev Lember2017-01-091-0/+1
|
* Limit recursive deps lookup to the same source packageKalev Lember2017-01-091-2/+8
| | | | | Otherwise we may end up inadvertently marking an app as ModernToolkit when all it does is require zenity.
* Revert "trivial: Prevent recusion when a package lists itself as a dep"Kalev Lember2017-01-091-4/+0
| | | | | | | Commit 49749de0bd597e5e9fe5e4b92875d6730a7b6968 fixed this in a more general way. This reverts commit b04fb193dad0e6e977d9bda2487bd50075f8f61c.
* Revert "trivial: Do not recurse for library or filename deps"Kalev Lember2017-01-091-8/+0
| | | | | | | This led to ModernToolkit kudos being skipped for apps where a subpackage links with a modern toolkit library (gtk+ 3 or Qt 5). This reverts commit e7f14579d1f9ab6f0f016caf81c34bb576c9ea92.
* trivial: Fix a crash when doing validate-root on an app with no iconRichard Hughes2017-01-081-3/+13
|
* trivial: Allow a NULL destdir in as_utils_find_icon_filename_full()Richard Hughes2017-01-081-1/+0
|
* build: Enable C99 support in configure.acPhilip Withnall2017-01-071-0/+4
| | | | | | We use C99 features (as-app.c:1278), so need to explicitly enable them in configure.ac, as some compilers will not enable them automatically, and will instead error when they encounter usage of C99.
* Fix a crash when using as_release_get_location_default()Richard Hughes2017-01-061-0/+2
| | | | The locations array is now lazy-loaded.
* trivial: Add yakuake.desktop to rename listKalev Lember2017-01-051-0/+1
|
* Revert "trivial: Correctly truncate existing logfiles"Richard Hughes2017-01-041-81/+34
| | | | | | | | | | | | This reverts commit cefcad4027ada131d322ec578a8e32f3f5652240. Revert "trivial: Fix a critical warning in the self tests" This reverts commit 3e353879b9e24d3aa9a21d5ef0d295d26febafcd. Revert "Write log files in a better way" This reverts commit 342d570825ed01f11bef0d722baec1fa2801964b.
* trivial: Correctly truncate existing logfilesRichard Hughes2017-01-041-3/+8
|
* trivial: Fix a critical warning in the self testsRichard Hughes2017-01-041-0/+4
|
* trivial: Do not recurse for library or filename depsRichard Hughes2017-01-041-0/+8
|
* Write log files in a better wayRichard Hughes2017-01-041-34/+72
| | | | | Appending to a giant string and then flushing it at the end means we waste memory and also don't get any logs if the builder crashes.
* trivial: Write debug statements into the logsRichard Hughes2017-01-041-2/+1
|
* Allow loading application XPM iconsRichard Hughes2017-01-041-0/+1
| | | | | | | | | Ignoring XPM icons made sense as a way of ignoring unmaintained applications before AppData files were mandatory. Now we have the latter we should load valid application XPM icons if they are large enough for the builder tests. Some package maintainers were just converting the icons at package build time to just avoid the veto.
* trivial: Fix a critical warning when parsing <p><ul><li/></ul></p>Richard Hughes2017-01-041-0/+4
|
* trivial: Do not follow a foo->bar->foo->bar depchainRichard Hughes2017-01-041-1/+3
|
* trivial: Prevent recusion when a package lists itself as a depRichard Hughes2017-01-041-0/+4
|
* Recursively add subpackage deps into the main packageKalev Lember2017-01-041-10/+86
| | | | | | | | This fixes appstream data generation for packages that have long dep chains and icons are at a deeper level than in the immediate child package. e.g. in Fedora, 'marble' package depends on 'marble-widget-qt5' which depends on 'marble-astro' which depends on 'marble-common' where we can finally find the app's icon.
* trivial: Remove a libreoffice hack that's no longer neededKalev Lember2017-01-041-4/+0
|
* Fix dep extraction when multiple versions are availableKalev Lember2017-01-031-0/+2
| | | | | | | | | When looking up extra deps by pkgname, make sure to get the latest version that matches with what the rest of the code expects. This fixes libreoffice disappearing from appstream data when there's one version of libreoffice-data available in the base repo and another one from updates.
* trivial: Treat generic components just like addonsRichard Hughes2017-01-032-0/+4
|
* Add support for "+" operator at the end of SPDX license identifiersKalev Lember2016-12-313-8/+33
| | | | | | SPDX v2.0 and later support an unary "+" operator suffix at the end of license identifiers, e.g. "CC-BY-SA-3.0+". This commit adds support for tokenizing and detokenizing this and adds new tests.
* trivial: Add missing lockingKalev Lember2016-12-301-0/+1
|
* trivial: Fix typos in commentsKalev Lember2016-12-291-4/+4
|
* trivial: Fix a typo in gtk-doc markupKalev Lember2016-12-291-1/+1
|
* Revert "Remove invalid SPDX licenses from content license lookup table"Kalev Lember2016-12-291-0/+8
| | | | | | | Oops. These all turned out to be valid licenses, formed with the new "+" operator from the License Expression Syntax introduced in SPDX v2.0. This reverts commit 54e0c38af7a03406df04ccf90633d84806b82c84.
* Remove invalid SPDX licenses from content license lookup tableKalev Lember2016-12-291-8/+0
|
* Update the SPDX licence list to v2.5Kalev Lember2016-12-291-1/+13
|
* Support glob and regex matches in requires compare tagsRichard Hughes2016-12-223-7/+28
|
* Add AsRequire as a way to store runtime requirementsRichard Hughes2016-12-2111-0/+834
| | | | | | This can be used by fwupd to prevent incompatible firmware being installed on devices, and GNOME Software for limiting artificial fake components to supported plugin versions.
* trivial: Don't ever write an empty component ID valueRichard Hughes2016-12-211-1/+2
|
* trivial: Add AS_APP_QUIRK_REMOVABLE_HARDWARERichard Hughes2016-12-211-0/+2
|