diff --git a/internal/filtering/http.go b/internal/filtering/http.go index e459cb2f..08832b40 100644 --- a/internal/filtering/http.go +++ b/internal/filtering/http.go @@ -13,6 +13,7 @@ import ( "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" + "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" @@ -25,7 +26,7 @@ func (d *DNSFilter) validateFilterURL(urlStr string) (err error) { if filepath.IsAbs(urlStr) { urlStr = filepath.Clean(urlStr) - _, err = os.Stat(urlStr) + _, err = aghos.Stat(urlStr) if err != nil { // Don't wrap the error since it's informative enough as is. return err diff --git a/internal/home/auth.go b/internal/home/auth.go index 5b6cf9b8..040c70fd 100644 --- a/internal/home/auth.go +++ b/internal/home/auth.go @@ -90,7 +90,11 @@ func InitAuth( trustedProxies: trustedProxies, } var err error - a.db, err = bbolt.Open(dbFilename, aghos.DefaultPermFile, nil) + + opts := *bbolt.DefaultOptions + opts.OpenFile = aghos.OpenFile + + a.db, err = bbolt.Open(dbFilename, aghos.DefaultPermFile, &opts) if err != nil { log.Error("auth: open DB: %s: %s", dbFilename, err) if err.Error() == "invalid argument" {