-
Notifications
You must be signed in to change notification settings - Fork 226
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
Add fail on permissions flag #551
base: main
Are you sure you want to change the base?
Conversation
.idea/ | ||
*.iml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add them to your global gitignore instead? Accepting any IDEs makes our gitignore fat and hard to maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second this
pub fn new( | ||
inotify: Inotify, | ||
event_handler: Box<dyn EventHandler>, | ||
fail_on_no_permissions: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer passing a config like this via a wrapper (a struct) instead, otherwise args could be too long and we have to expect breaking changes each time we modify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, please pass the config down if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR - is there a reason not to fail if we're lacking permissions, making this a breaking change instead for the next major version ?
|
||
/// For the [INotifyWatcher](crate::INotifyWatcher) backend. | ||
/// | ||
/// This flag sets whether inotify should fail when the user has no permissions on a subfolder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this isn't actually true - my guess is you tested this on linux where we have to subscribe to each system ?
That's not the case on windows - not even sure if we would get any errors there. It's correct for the pollwatcher.
.idea/ | ||
*.iml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second this
pub fn new( | ||
inotify: Inotify, | ||
event_handler: Box<dyn EventHandler>, | ||
fail_on_no_permissions: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, please pass the config down if possible
See more details here - rust-lang/rust#126195
I ran into a case where, specifically in inotify, if I'm watching a directory and the user does not have permissions on a subdirectory, the watch will fail.
Added a flag in the Config struct to change this behavior (still the default).