From 821271b3b8a4f708f475dd3ae07d229f238ef549 Mon Sep 17 00:00:00 2001 From: Jeff Gaston Date: Wed, 23 Aug 2017 17:53:38 -0700 Subject: [PATCH] Fix the Finder's ability to ignore permission errors It turns out the os was returning a different permissions error than os.ErrPermission. Fortunately we can just use os.IsPermission(). Bug: 62455338 Test: mkdir not-permitted && chmod 000 not-permitted && m nothing Change-Id: Ieb1653b9687ffdaae83184dcdcd4166ddb6a4613 --- finder/finder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finder/finder.go b/finder/finder.go index ffda1558d..2dd8e0b0e 100644 --- a/finder/finder.go +++ b/finder/finder.go @@ -1181,7 +1181,7 @@ func (f *Finder) canIgnoreFsErr(err error) bool { // Don't recognize this error return false } - if pathErr.Err == os.ErrPermission { + if os.IsPermission(pathErr) { // Permission errors are ignored: // https://issuetracker.google.com/37553659 // https://github.com/google/kati/pull/116