facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.75k stars 992 forks source link

`"watchman" would like to access your contacts` when watching home dir on macOS #658

Open Eightyplus opened 6 years ago

Eightyplus commented 6 years ago
screenshot 2018-11-04 at 18 42 54 screenshot 2018-11-04 at 18 42 50 screenshot 2018-11-04 at 18 42 44
wez commented 6 years ago

There's no code in watchman that would do anything remotely like this; since it is an open source project you can verify this for yourself.

There are other projects that call themselves watchman. Perhaps you're running one of those? Perhaps you have a malware problem on that system?

Eightyplus commented 6 years ago

No, I don't think so. No point in trusting this. Maybe it is not a watchman issue, but definitely something Facebook created. Create-react-app then?!?

Warning: opendir(/Users/X/Library/Caches/CloudKit/com.apple.Safari) -> Operation not permitted. Warning: opendir(/Users/X/Library/PersonalizationPortrait) -> Operation not permitted.

wez commented 6 years ago

Maybe your watchman instance was instructed to watch /Users or /Users/$USER in its entirety and those prompts are just side effects of macOS throwing up a dialog? Could you run watchman watch-list and share the output? Do you have a .git directory in your home directory? That can cause watchman to attempt to aggregate a watch on your home directory rather than at a more specific deeper path.

arnaudambro commented 6 years ago

I had a watchman warning: opendir(/Users/$USER/Library/Caches/CloudKit/com.apple.Safari) : Operation not permitted warning when I was launching my react-native app through expo start, I did a watchman watch-list, found out that my /Users/$USER was in the list, I did a watchman watch-del /Users/$USER and now everything is alright.

wez commented 5 years ago

We should consider adding an option to preventing watching the home directory of a user and defaulting it to false as a way to prevent this alarming dialog and also because a home directory is often very large and undesirable to watch. Watchman often considers aggregating at the home directory level because it is common practice for folks to place their dotfiles under version control, so their entire home directory is a git repo and is seen as a good project aggregation point by watchman.

Eightyplus commented 5 years ago

I still don't know why watchman is traversing my home folder. And I do not have a .git to trigger this behavior.

screenshot 2018-12-06 at 08 26 37

I agree, this should be disabled by default!

nickdotht commented 4 years ago

Yeah, I thought it was strange. I kinda feel exposed now, I accepted them by mistake. Disabling it.

aiavci commented 4 years ago

Watchman requested access to my documents on startup. Is this also not expected?

saashwath commented 4 years ago

where to run watchman watch-list and watchman watch-del /Users/$USER

wez commented 4 years ago

I re-summarized the background and what you can do about it over in this SO answer:

https://stackoverflow.com/a/59367502/149111

@saashwath I just realized that you are probably the same person as that asking the question on SO! You would run those commands from your terminal application.

scienceLabwork commented 4 years ago

Same Problem With me in my mac!!

arys commented 4 years ago

I had the same problem because I had a .watсhmanconfig file in my Users/NAME directory, so I just deleted it and it worked.

archywillhe commented 1 year ago

running jest causes this hmmm

katiabestcat commented 1 year ago

just chiming in to say that I had the same issue on my Mac when I tried to run watchman-make on a particular directory: pop-ups with "watchman" wants to access your Photos/Contacts/etc. on my Mac, which I declined. Then when I tried to run watchman again the same particular directory, I got a message "WARNING: opendir(/Users/$myuser/Library/Application Support/CloudDocs/session/db) -> Operation not permitted. Marking this portion of the tree deleted"

when I ran "watchman watch-list", I got not only the directory that I had set the watch on, but also 'Users/$myuser', which I hadn't set any watch on. That home directory doesn't have any dot files either, so that's strange behaviour by watchman...

gcjbr commented 3 days ago

That looks like Cleanmymac in action