Fix crash on "tracker3 export --2to3" (#1951194)

This commit is contained in:
Carlos Garnacho 2021-04-22 17:39:40 +02:00
parent 1116e1b813
commit 2ee166a553
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 62b46b35d4f151c851d7eb37792aa8890117a1e7 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 22 Apr 2021 17:10:49 +0200
Subject: [PATCH] libtracker-data: Do not load vtabs if vtab data is missing
We have one case of direct use of tracker_db_manager_new() in
"tracker3 export" CLI command to (ab)use it to open databases from
2.x. This doesn't pass a TrackerDataManager nor requires creating
the usual 3.x virtual tables.
Avoid this virtual table creation in that case, and subsequent
crashes when trying to access the NULL data manager from those.
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1951194
---
src/libtracker-data/tracker-db-manager.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index e3044819c..5485ce623 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -776,7 +776,8 @@ tracker_db_manager_create_db_interface (TrackerDBManager *db_manager,
g_weak_ref_get (&db_manager->iface_data),
g_object_unref);
- tracker_db_interface_init_vtabs (connection, db_manager->vtab_data);
+ if (db_manager->vtab_data)
+ tracker_db_interface_init_vtabs (connection, db_manager->vtab_data);
iface_set_params (connection,
readonly,
--
2.31.1

View File

@ -4,12 +4,14 @@
Name: tracker
Version: 3.1.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Desktop-neutral metadata database and search tool
License: GPLv2+
URL: https://gnome.pages.gitlab.gnome.org/tracker/
Source0: https://download.gnome.org/sources/tracker/3.1/tracker-%{tarball_version}.tar.xz
# https://bugzilla.redhat.com/show_bug.cgi?id=1951194
Patch0: 0001-libtracker-data-Do-not-load-vtabs-if-vtab-data-is-mi.patch
BuildRequires: asciidoc
BuildRequires: gettext
@ -169,6 +171,9 @@ The %{name}-devel package contains the documentation for %{name}.
%changelog
* Thu Apr 22 2021 Carlos Garnacho <cgarnach@redhat.com> - 3.1.1-2
- Fix crash on "tracker3 export --2to3"
* Sat Apr 03 2021 Kalev Lember <klember@redhat.com> - 3.1.1-1
- Update to 3.1.1