Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report which sub-path failed when adding a Recursive watch and a subfolder has a permission (or other) error #353

Closed
passcod opened this issue Aug 22, 2021 · 4 comments · Fixed by #354
Labels
A-bug Z-needs info Needs more information

Comments

@passcod
Copy link
Member

passcod commented Aug 22, 2021

System details

  • OS/Platform name and version: Linux (inotify backend, probably happens on windows too)
  • Rust version (if building from source): rustc --version: 1.54.0
  • Notify version (or commit hash if building from git): 4.x and 5-pre.12

What you did (as detailed as you can)

This directory structure:

  • . (working directory)
    • folder1 (owned by user)
    • folder2 (owned by user)
      • folder3 (owner by root)
let mut w = RecommendedWatcher::new(|ev| println!("{:?}", ev));
w.watch(Path::new("folder1"), RecursiveMode::Recursive)?;
w.watch(Path::new("folder2"), RecursiveMode::Recursive)?;

What you expected

For the second watch() to error when recursing for folder3 and the Error's paths field to be ["folder2/folder3"].

What happened

The second watch() errors, but the error has an empty paths field:

Error {
    kind: Io(Os { code: 13, kind: PermissionDenied, message: "Permission denied" }),
    paths: []
}

Also, very love what you've done with Notify, looking forward to the stable 5.0 release! ❤️

@0xpr03
Copy link
Member

0xpr03 commented Aug 22, 2021

Heyho, yeah I suppose we'll need to fix this in here for inotify, but from my understanding we can't fix this correctly on windows, as recursive flags are handled by the windows API, so we don't have any context what we failed to watch. Will also have to look into the BSD and darwin implementation.

@0xpr03 0xpr03 added A-bug Z-needs info Needs more information labels Aug 22, 2021
@passcod
Copy link
Member Author

passcod commented Aug 22, 2021

I've done it for inotify, will PR. Looking into kqueue now.

@0xpr03
Copy link
Member

0xpr03 commented Aug 22, 2021

Ah that is fast :)

@passcod
Copy link
Member Author

passcod commented Aug 22, 2021

  • inotify: done, in PR
  • Kqueue: done, in same PR
  • Windows: as you said, handled by Windows, so no visibility. I've still added some path info in places.
  • Darwin/FSEvents handles its recursion itself, so no visibility either. What path info we know about was already all there!
  • Polling: was already all good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Z-needs info Needs more information
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants