From 66345e855eabb49fc948d3c782bb53ab4335e099 Mon Sep 17 00:00:00 2001 From: Dimitry Kolyshev Date: Thu, 22 Jun 2023 16:09:55 +0300 Subject: [PATCH] Pull request: filtering: fix filter delete Merge in DNS/adguard-home from 5700-fix-filter-delete to master Squashed commit of the following: commit 51e5c82bf6c12b48b1c07622639216ecba21e115 Merge: b4f8abdf2 37e046acc Author: Dimitry Kolyshev Date: Thu Jun 22 17:05:23 2023 +0400 Merge remote-tracking branch 'origin/master' into 5700-fix-filter-delete commit b4f8abdf2e9a8c94594cb0e3b00b37e0ed49578a Merge: eac30a13f f40ef76c7 Author: Dimitry Kolyshev Date: Thu Jun 22 16:55:58 2023 +0400 Merge remote-tracking branch 'origin/master' into 5700-fix-filter-delete commit eac30a13fb30404b2e058d1889be566d359d5000 Author: Dimitry Kolyshev Date: Thu Jun 22 14:03:07 2023 +0400 filtering: imp code commit 4e270789b83bdcff09d94ace46dd0b02d2c6893c Author: Dimitry Kolyshev Date: Thu Jun 22 14:02:04 2023 +0400 all: docs commit b818468ae29f647bcc0f4e408d10c8469829da95 Author: Dimitry Kolyshev Date: Thu Jun 22 13:18:12 2023 +0400 filtering: fix filter delete --- CHANGELOG.md | 2 ++ internal/filtering/http.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 305fc5e2..f5b7eb54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ In this release, the schema version has changed from 20 to 21. ### Fixed +- The blocklists can now be deleted properly ([#5700]). - Queries with the question-section target `.`, for example `NS .`, are now counted in the statistics and correctly shown in the query log ([#5910]). - Safe Search not working with `AAAA` queries for domains that don't have `AAAA` @@ -89,6 +90,7 @@ In this release, the schema version has changed from 20 to 21. [#951]: https://github.com/AdguardTeam/AdGuardHome/issues/951 [#1577]: https://github.com/AdguardTeam/AdGuardHome/issues/1577 +[#5700]: https://github.com/AdguardTeam/AdGuardHome/issues/5700 [#5910]: https://github.com/AdguardTeam/AdGuardHome/issues/5910 [#5913]: https://github.com/AdguardTeam/AdGuardHome/issues/5913 diff --git a/internal/filtering/http.go b/internal/filtering/http.go index 41964965..4aef0409 100644 --- a/internal/filtering/http.go +++ b/internal/filtering/http.go @@ -169,7 +169,7 @@ func (d *DNSFilter) handleFilteringRemoveURL(w http.ResponseWriter, r *http.Requ deleted = (*filters)[delIdx] p := deleted.Path(d.DataDir) err = os.Rename(p, p+".old") - if err != nil { + if err != nil && !errors.Is(err, os.ErrNotExist) { log.Error("deleting filter %d: renaming file %q: %s", deleted.ID, p, err) return