Merge ~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-fix-file-remote-type-search-crash into ~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/master

Proposed by Marco Trevisan (Treviño) on 2018-09-28
Status: Superseded
Proposed branch: ~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-fix-file-remote-type-search-crash
Merge into: ~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/master
Prerequisite: ~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-xubuntu-cancel-search
Diff against target: 236 lines (+151/-1) (has conflicts)
7 files modified
debian/changelog (+4/-1)
debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch (+4/-0)
debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch (+4/-0)
debian/patches/0018-search-engine-add-locate-based-search-engine.patch (+4/-0)
debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch (+4/-0)
debian/patches/search-engine-Query-file-system-to-determine-remoteness.patch (+127/-0)
debian/patches/series (+4/-0)
Conflict in debian/changelog
Conflict in debian/control
Conflict in debian/control.in
Conflict in debian/gbp.conf
Conflict in debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch
Conflict in debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch
Conflict in debian/patches/0018-search-engine-add-locate-based-search-engine.patch
Conflict in debian/patches/03_translations_list_update.patch
Conflict in debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch
Conflict in debian/patches/series
Conflict in debian/patches/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch
Conflict in debian/patches/zg_activity_logging.patch
Reviewer Review Type Date Requested Status
Ubuntu Desktop 2018-09-28 Pending
Review via email: mp+355858@code.launchpad.net

This proposal has been superseded by a proposal from 2018-09-28.

To post a comment you must log in.

Unmerged commits

1f38196... by Marco Trevisan (Treviño) on 2018-09-28

d/p/search-engine-Query-file-system-to-determine-remoteness.patch

Cherry-pick remote filesystem check on file during search.

Fixes LP: #1795028

45370f0... by Marco Trevisan (Treviño) on 2018-08-28

d/p/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch

shell-search-provider: implement XUbuntuCancel to request search cancellation

Stop search and Metadata fetching on XUbuntuCancel dbus method call.
Only allow this if the caller is the same who triggered the actual event.

Fixes LP: #1756826

da3b388... by Sebastien Bacher on 2018-08-02

Upload to bionic

6630212... by Sebastien Bacher on 2018-08-02

Merge branch 'ubuntu/bionic-3-26-4' of
git+ssh://git.launchpad.net/~3v1n0/ubuntu/+source/nautilus
into ubuntu/bionic

013b39d... by Marco Trevisan (Treviño) on 2018-07-26

d/p/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch:

Refresh as per upstream commited version

a798faa... by Marco Trevisan (Treviño) on 2018-07-26

d/p/query-add-recursive-flags-and-use-it-in-search-engines.patch:

Apply the upstream version of it (with 3.26 changes), and refresh dependent
patches.

016eb1c... by Marco Trevisan (Treviño) on 2018-07-26

d/p/file-view-Always-unset-pending_selection-after-freeing-it.patch:

don't crash when try to select a file multiple times in a single run

Fixes LP: #1713581

16f3aaf... by Marco Trevisan (Treviño) on 2018-07-20

debian/patches: refresh indexes using gbp

6c56c37... by Marco Trevisan (Treviño) on 2018-07-20

debian/patches: remove merged and update debian/changelog accordingly

d/p/nautilusgtkplacesview-show-error-if-volume-is-not-mo.patch:

patch re-added after gbp deleted on importing new upstream release

b3a05da... by Marco Trevisan (Treviño) on 2018-07-20

Update upstream source from tag 'upstream/3.26.4'

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 0d739a6..a68c9a9 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -18,8 +18,8 @@ nautilus (1:3.26.4-0~ubuntu18.04.2) UNRELEASED; urgency=medium
6 * d/p/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch:
7 shell-search-provider: implement XUbuntuCancel to request pending
8 search cancellation from gnome-shell (LP: #1756826)
9-
10 <<<<<<< debian/changelog
11+
12 -- Marco Trevisan (Treviño) <marco@ubuntu.com> Thu, 30 Aug 2018 18:15:24 -0500
13
14 nautilus (1:3.26.4-0ubuntu2) cosmic; urgency=medium
15@@ -43,6 +43,9 @@ nautilus (1:3.26.4-0ubuntu2) cosmic; urgency=medium
16
17 nautilus (1:3.26.4-0ubuntu1) cosmic; urgency=medium
18 =======
19+ * d/p/search-engine-Query-file-system-to-determine-remoteness.patch:
20+ - Fix remote filesystem check on file during search (LP: #1795028)
21+
22 -- Marco Trevisan (Treviño) <marco@ubuntu.com> Wed, 05 Sep 2018 18:03:14 +0200
23
24 nautilus (1:3.26.4-0~ubuntu18.04.1) bionic; urgency=medium
25diff --git a/debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch b/debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch
26index f80997f..193c6e2 100644
27--- a/debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch
28+++ b/debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch
29@@ -512,7 +512,11 @@ index 0000000..bcd73b9
30 +
31 +#endif /* __NAUTILUS_SEARCH_ENGINE_RECENT_H__ */
32 diff --git a/src/nautilus-search-engine.c b/src/nautilus-search-engine.c
33+<<<<<<< debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch
34 index 3a0c9d4..793b831 100644
35+=======
36+index 28863f7..a4c6007 100644
37+>>>>>>> debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch
38 --- a/src/nautilus-search-engine.c
39 +++ b/src/nautilus-search-engine.c
40 @@ -30,11 +30,13 @@
41diff --git a/debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch b/debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch
42index e6185da..8e3d059 100644
43--- a/debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch
44+++ b/debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch
45@@ -49,7 +49,11 @@ index 19316e8..9bb5460 100644
46
47 /* Now send out the changed and added signals for existing file objects. */
48 diff --git a/src/nautilus-file.c b/src/nautilus-file.c
49+<<<<<<< debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch
50 index 63413a6..9416214 100644
51+=======
52+index 28b5a13..7886d1f 100644
53+>>>>>>> debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch
54 --- a/src/nautilus-file.c
55 +++ b/src/nautilus-file.c
56 @@ -34,6 +34,7 @@
57diff --git a/debian/patches/0018-search-engine-add-locate-based-search-engine.patch b/debian/patches/0018-search-engine-add-locate-based-search-engine.patch
58index 91a7ec0..1135ad8 100644
59--- a/debian/patches/0018-search-engine-add-locate-based-search-engine.patch
60+++ b/debian/patches/0018-search-engine-add-locate-based-search-engine.patch
61@@ -678,7 +678,11 @@ index 0000000..ac5e3fc
62 +
63 +#endif /* __NAUTILUS_SEARCH_ENGINE_LOCATE_H__ */
64 diff --git a/src/nautilus-search-engine.c b/src/nautilus-search-engine.c
65+<<<<<<< debian/patches/0018-search-engine-add-locate-based-search-engine.patch
66 index 793b831..902d483 100644
67+=======
68+index a4c6007..475a432 100644
69+>>>>>>> debian/patches/0018-search-engine-add-locate-based-search-engine.patch
70 --- a/src/nautilus-search-engine.c
71 +++ b/src/nautilus-search-engine.c
72 @@ -29,6 +29,7 @@
73diff --git a/debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch b/debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch
74index fddae3e..76b455b 100644
75--- a/debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch
76+++ b/debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch
77@@ -198,7 +198,11 @@ index b567611..b165d63 100644
78 +
79 #endif /* NAUTILUS_FILE_UTILITIES_H */
80 diff --git a/src/nautilus-file.c b/src/nautilus-file.c
81+<<<<<<< debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch
82 index 3f6a69f..63413a6 100644
83+=======
84+index 22ea199..e30d791 100644
85+>>>>>>> debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch
86 --- a/src/nautilus-file.c
87 +++ b/src/nautilus-file.c
88 @@ -4975,6 +4975,29 @@ nautilus_file_get_filesystem_type (NautilusFile *file)
89diff --git a/debian/patches/search-engine-Query-file-system-to-determine-remoteness.patch b/debian/patches/search-engine-Query-file-system-to-determine-remoteness.patch
90new file mode 100644
91index 0000000..1b7f874
92--- /dev/null
93+++ b/debian/patches/search-engine-Query-file-system-to-determine-remoteness.patch
94@@ -0,0 +1,127 @@
95+From: Ernestas Kulik <ernestask@gnome.org>
96+Date: Fri, 14 Sep 2018 12:52:11 +0200
97+Subject: search-engine: Query file system to determine remoteness
98+
99+Querying the file cache in is_recursive_search() does not guarantee that
100+the file system field will be populated with a value, and somehow
101+results in data races, in turn resulting in random crashes/file list
102+corruption.
103+
104+Hopefully fixes https://gitlab.gnome.org/GNOME/nautilus/issues/640,
105+closes https://gitlab.gnome.org/GNOME/nautilus/issues/632 and resolves
106+https://gitlab.gnome.org/GNOME/nautilus/issues/602
107+
108+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1795028
109+Applied-Upstream: yes, 3.30.1, https://gitlab.gnome.org/GNOME/nautilus/commit/62ba6d83d
110+---
111+ src/nautilus-file-utilities.c | 18 ++++++++++++++++++
112+ src/nautilus-file-utilities.h | 2 ++
113+ src/nautilus-file.c | 14 +-------------
114+ src/nautilus-search-engine.c | 18 +++++++++++++++---
115+ 4 files changed, 36 insertions(+), 16 deletions(-)
116+
117+diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
118+index f8d8476..3e363a4 100644
119+--- a/src/nautilus-file-utilities.c
120++++ b/src/nautilus-file-utilities.c
121+@@ -1565,3 +1565,21 @@ location_settings_search_get_recursive_for_location (GFile *location)
122+
123+ return recursive;
124+ }
125++
126++gboolean
127++nautilus_file_system_is_remote (const char *file_system)
128++{
129++ static const gchar * const remote_types[] =
130++ {
131++ "afp",
132++ "google-drive",
133++ "sftp",
134++ "webdav",
135++ "ftp",
136++ "nfs",
137++ "cifs",
138++ NULL
139++ };
140++
141++ return file_system != NULL && g_strv_contains (remote_types, file_system);
142++}
143+diff --git a/src/nautilus-file-utilities.h b/src/nautilus-file-utilities.h
144+index b165d63..37f7f49 100644
145+--- a/src/nautilus-file-utilities.h
146++++ b/src/nautilus-file-utilities.h
147+@@ -133,4 +133,6 @@ gchar * nautilus_uri_to_native_uri (const gchar *uri);
148+ NautilusQueryRecursive location_settings_search_get_recursive (void);
149+ NautilusQueryRecursive location_settings_search_get_recursive_for_location (GFile *location);
150+
151++gboolean nautilus_file_system_is_remote (const char *file_system);
152++
153+ #endif /* NAUTILUS_FILE_UTILITIES_H */
154+diff --git a/src/nautilus-file.c b/src/nautilus-file.c
155+index e30d791..28b5a13 100644
156+--- a/src/nautilus-file.c
157++++ b/src/nautilus-file.c
158+@@ -8371,18 +8371,6 @@ nautilus_file_is_in_recent (NautilusFile *file)
159+ return nautilus_directory_is_in_recent (file->details->directory);
160+ }
161+
162+-static const gchar * const remote_types[] =
163+-{
164+- "afp",
165+- "google-drive",
166+- "sftp",
167+- "webdav",
168+- "ftp",
169+- "nfs",
170+- "cifs",
171+- NULL
172+-};
173+-
174+ /**
175+ * nautilus_file_is_remote
176+ *
177+@@ -8406,7 +8394,7 @@ nautilus_file_is_remote (NautilusFile *file)
178+
179+ filesystem_type = nautilus_file_get_filesystem_type (file);
180+
181+- return filesystem_type != NULL && g_strv_contains (remote_types, filesystem_type);
182++ return nautilus_file_system_is_remote (filesystem_type);
183+ }
184+
185+ /**
186+diff --git a/src/nautilus-search-engine.c b/src/nautilus-search-engine.c
187+index 3a0c9d4..28863f7 100644
188+--- a/src/nautilus-search-engine.c
189++++ b/src/nautilus-search-engine.c
190+@@ -23,7 +23,7 @@
191+ #include "nautilus-search-engine.h"
192+ #include "nautilus-search-engine-private.h"
193+
194+-#include "nautilus-file.h"
195++#include "nautilus-file-utilities.h"
196+ #include "nautilus-search-engine-model.h"
197+ #include "nautilus-search-provider.h"
198+ #include <glib/gi18n.h>
199+@@ -437,8 +437,20 @@ is_recursive_search (NautilusSearchEngineType engine_type,
200+
201+ case NAUTILUS_QUERY_RECURSIVE_LOCAL_ONLY:
202+ {
203+- g_autoptr (NautilusFile) file = nautilus_file_get (location);
204+- return !nautilus_file_is_remote (file);
205++ g_autoptr (GFileInfo) file_system_info = NULL;
206++
207++ file_system_info = g_file_query_filesystem_info (location,
208++ G_FILE_ATTRIBUTE_FILESYSTEM_TYPE,
209++ NULL, NULL);
210++ if (file_system_info != NULL)
211++ {
212++ const char *file_system;
213++
214++ file_system = g_file_info_get_attribute_string (file_system_info,
215++ G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
216++
217++ return !nautilus_file_system_is_remote (file_system);
218++ }
219+ }
220+ }
221+
222diff --git a/debian/patches/series b/debian/patches/series
223index 61d3d3a..3bc1123 100644
224--- a/debian/patches/series
225+++ b/debian/patches/series
226@@ -17,6 +17,10 @@ ubuntu_backspace_behaviour.patch
227 #Needs updating
228 #16_unity_new_documents.patch
229 query-add-recursive-flags-and-use-it-in-search-engines.patch
230+<<<<<<< debian/patches/series
231+=======
232+search-engine-Query-file-system-to-determine-remoteness.patch
233+>>>>>>> debian/patches/series
234 0015-tracker-search-engine-don-t-start-it-if-not-availabl.patch
235 0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch
236 0017-recent-add-function-to-update-manager-on-file-rename.patch

Subscribers

People subscribed via source and target branches