-
-
Notifications
You must be signed in to change notification settings - Fork 966
Permission denied when try to watch for dir with one of files which have --wx------ permissions #270
Copy link
Copy link
Closed
Description
Hello,
I am sorry, I don't know this is a bug or something.
Which operating system (GOOS) and version are you using?
ProductName: Mac OS X
ProductVersion: 10.14
BuildVersion: 18A391
Steps to reproduce
cd /tmp && mkdir fsnotify_permission_deniedcd fsnotify_permission_deniedtouch test1.log test2.logchmod 0300 test2.loggo run main.go
// main.go
package main
import (
"log"
"github.com/fsnotify/fsnotify"
)
func ExampleNewWatcher() {
watcher, err := fsnotify.NewWatcher()
if err != nil {
log.Fatal(err)
}
defer watcher.Close()
err = watcher.Add("/tmp/fsnotify_permission_denied")
if err != nil {
log.Fatal("fatal: ", err)
}
}
func main() {
ExampleNewWatcher()
}As result
$ go run main.go
2018/10/02 16:21:08 fatal: permission denied
exit status 1Why is it try open file with 0700 permissions?
Line 218 in c282820
| watchfd, err = unix.Open(name, openMode, 0700) |
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels