Merge ~3v1n0/ubuntu/+source/nautilus:ubuntu/master into ~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/master

Proposed by Marco Trevisan (Treviño) on 2018-09-28
Status: Merged
Merged at revision: bee75fd00d3b
Proposed branch: ~3v1n0/ubuntu/+source/nautilus:ubuntu/master
Merge into: ~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/master
Diff against target: 212 lines (+139/-4)
7 files modified
debian/changelog (+7/-0)
debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch (+1/-1)
debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch (+1/-1)
debian/patches/0018-search-engine-add-locate-based-search-engine.patch (+1/-1)
debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch (+1/-1)
debian/patches/search-engine-Query-file-system-to-determine-remoteness.patch (+127/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Jeremy Bicha 2018-09-28 Approve on 2018-09-29
Review via email: mp+355857@code.launchpad.net
To post a comment you must log in.
Jeremy Bicha (jbicha) wrote :

Thanks!

review: Approve

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

Subscribers

People subscribed via source and target branches