summaryrefslogtreecommitdiff
path: root/embed
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2014-08-21 17:52:28 -0500
committerMichael Catanzaro <mcatanzaro@igalia.com>2014-09-07 12:30:55 -0500
commit8d9d6becd0ce16a720514598286d6f7d5f16d0b6 (patch)
tree759718b2f800c84101abf28ba30f21e3a9254870 /embed
parentebfc998537ab4201ee07ea7714d03e523c418cf4 (diff)
downloadepiphany-8d9d6becd0ce16a720514598286d6f7d5f16d0b6.tar.gz
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
Diffstat (limited to 'embed')
-rw-r--r--embed/uri-tester.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/embed/uri-tester.c b/embed/uri-tester.c
index eebd7b681..7c3944c61 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 *