瀏覽代碼

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
Jeff Gaston 6 年之前
父節點
當前提交
821271b3b8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      finder/finder.go

+ 1 - 1
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