[epiphany] Don't accidentally delete adblock filters
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Don't accidentally delete adblock filters
- Date: Sun, 7 Sep 2014 17:27:40 +0000 (UTC)
commit fecf8df7fc4ed689dad366de9057a3121c1ac363
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Thu Aug 21 17:52:28 2014 -0500
Don't accidentally delete adblock filters
The uri-tester is created from the web extension. When created, it opens
~/.config/epiphany/adblock/filters.list for reading in
uri_tester_load_filters(), then calls uri_tester_set_filters() with the
read filters. uri_tester_set_filters() unconditionally calls
uri_tester_save_filters(), so we immediately write back what we read to
filters.list. But this is racy: if you are starting multiple web
processes at the same time, such as when opening epiphany with multiple
saved tabs, then one process may open the file for reading after another
has opened it for writing (which clears the file) but before the filters
have been written back to the file, so now one UriTester instance has an
empty list of filters, and it will immediately write back that empty list.
The original list is completely doomed because the only time we ever
write to filters.list is immediately after the filters are read, since
we do not support modifying filters. That's right, these writes are
NEVER necessary, so let's just remove them completely so we can be
completely sure the problem is gone.
Now we have an ununsued uri_tester_save_filters() function, but I don't
want to get rid of it quite yet as I do want to support at least a
couple different types of filters in the future (for tracking
protection). Also, there are already other unused functions here as
well, so one more is no difference for now, but refactor is imminent.
https://bugzilla.gnome.org/show_bug.cgi?id=697329
embed/uri-tester.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
---
diff --git a/embed/uri-tester.c b/embed/uri-tester.c
index eebd7b6..7c3944c 100644
--- a/embed/uri-tester.c
+++ b/embed/uri-tester.c
@@ -934,9 +934,7 @@ uri_tester_set_filters (UriTester *tester, GSList *filters)
g_slist_free (priv->filters);
}
- /* Update private variable and save to disk. */
priv->filters = filters;
- uri_tester_save_filters (tester);
}
GSList *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]