Open staticdev opened 2 years ago
How to reproduce:
package main import ( "log" "github.com/spf13/afero" ) func main() { folderName := "secret" fsys := afero.NewMemMapFs() fsys.Mkdir(folderName, 0700) afero.WriteFile(fsys, "secret/filename", []byte(""), 0700) _, err := fsys.Stat("secret/filename") if err != nil { log.Fatal(err) } fsys.Chmod("secret", 0000) _, err = fsys.Stat("secret/filename") if err != nil { log.Fatal(err) } }
If you do the same with NewOsFs() instead of NewMemMapFs() you get the error on second Stat (which is the intended behavior since the secret folder has no read permissions).
NewOsFs()
NewMemMapFs()
secret
May be related to https://github.com/spf13/afero/issues/327
How to reproduce:
If you do the same with
NewOsFs()
instead ofNewMemMapFs()
you get the error on second Stat (which is the intended behavior since thesecret
folder has no read permissions).May be related to https://github.com/spf13/afero/issues/327