Skip to content

Fix confusing error message on macOS when running without sudo#492

Open
chiranjeevi-max wants to merge 2 commits into
imsnif:mainfrom
chiranjeevi-max:main
Open

Fix confusing error message on macOS when running without sudo#492
chiranjeevi-max wants to merge 2 commits into
imsnif:mainfrom
chiranjeevi-max:main

Conversation

@chiranjeevi-max
Copy link
Copy Markdown
Contributor

Fixes #486

On macOS, when running bandwhich without elevated privileges, users see confusing error messages like:

lo0: No such file or directory (os error 2)
en0: No such file or directory (os error 2)

This happens because macOS returns ENOENT instead of EPERM when accessing BPF devices without permission.

with this PR, the program treats ErrorKind::NotFound as a permission error on macOS/FreeBSD, so users now see the helpful message:

Insufficient permissions to listen on network interface(s). Try running with sudo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Onboard first-time macOS users

1 participant