-
Notifications
You must be signed in to change notification settings - Fork 341
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
0.92 mtr: Failure to start mtr-packet: Invalid argument on macOS 10.12 #204
Comments
Is FYI, mtr is working as expected for me on MacOS 10.12.5, though I still have Xcode 8.2 installed. |
This appears to have been a user configuration issue. The user was calling the |
Matt, would it be an idea to add
to the exec_packet_child function? (and orig_argv0 = argv[0] to main(). ) |
Thanks @matt-kimball. Yes, it does work if I add /usr/local/sbin to the PATH. However, this still seems like a bug since it "should" be possible to use mtr by invoking the full path to the executable without having to add all of /usr/local/sbin to your PATH. |
Indeed -- it would be a good idea to do something similar to what @rewolff suggests to help find |
Is mtr-packet installed with the correct permissions or capabilities?
Tony
… On Jul 14, 2017, at 13:58, Dominic ***@***.***> wrote:
can't confirm...
`sd~$ env | grep PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
sd~$ which mtr
/usr/local/sbin/mtr
sd~$ which mtr-packet
/usr/local/sbin/mtr-packet
sd~$ mtr google.com
Failure to open IPv4 sockets: Operation not permitted
Failure to open IPv6 sockets: Operation not permitted
mtr: Failure to start mtr-packet: Invalid argument`
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Can't run mtr for the same reason from two different machines. |
how to add them to "PATH" |
Use this alias as a workaround:
|
I was able to fix this issue with following path export PATH=/opt/local/bin:/usr/local/Cellar/mtr/0.92/sbin/:$PATH |
I added the fix to the code almost a year ago, but it could very well be that I have not yet tagged another "release". Sorry about that. |
Thanks @7rakesh !! |
Simply adding this to your ~/.bash_profile on OSX does the trick:
Then to use it:
|
thanks |
Alternative to alias method: Create new file: /usr/local/bin/mtr
Fix up permissions:
Run:
|
The whole idea of the mtr / mtr-packet split is that mtr has grown to a big gui application with lots of IO modules. Programs like that should not run with root permissions. So mtr-packet is a small simple extract that just does the things that need root-permissions. That should be the only thing that runs with root permissions. Your suggestion subverts this security measure by again running the big mtr application with root privileges..... |
@rewolff tl;drThe way Brew installs mtr could do with some "polish". Detailshttps://github.com/Homebrew/homebrew-core/blob/master/Formula/mtr.rb#L36 What brew currently does
What brew should do (or something like it)
Unfortunately the problem with point 2 above is that
Edit: I just broke my internets googling for "brew setuid /usr/local/bin". |
why it works only with sudo? |
MTR needs low-level access to the packets flying around on the wire. The normal API: "Connect me to this website please" does not work to do the things that mtr needs to do. With such low-level access, you could also compromise the security of the local network (Some computers are configured to allow: "Hey there computerY, this is computerX, joe wants to login, you can trust me, I checked it is really joe") Low level access would allow you to fake/forge that conversation. So for cases like this, the OS allows a program to be trusted to A) not allow such fakery and B) provide their own security measures. So a program like "ping" and "mtr" is installed "setuid root". It will obtain superuser privileges when started. It can then access all files, change essential system parameters and access the network in funny ways. These programs are then written so that they don't do any of the first few things, and only some funny things with the network. The "own security rules" are for example, repeating frequency not above 1x per second. The superuser can request such network-bogging requests, but normal users cannot. If your mtr only works with sudo, then it is not fully installed with elevated privileges. Modern systems provide a slightly more restricted version of "setuid-root", so that the system operator does not need to trust mtr not to divulge other users' file contents. It has happened in the past that a program that required "setuid root" for networking stuff then had a bug that allowed a malicious user to abuse the "all files" permission. So nowadays these extra permissions are only assigned "as needed". If mtr were to have a bug that gave a hacker access to all mtr's privileges, then he'd be restricted to only the networking privileges. As less-and-less computers are configured to trust "computerX" on its word "Joe? Really? Prove it! " this is not as critical as it used to be. Still the potential for messing with things is there. Forging packets with "Hey, google here, your connection could not be serviced. Get lost!" is something that you'd be able to annoy other users with.... |
gracefully thanks you!) |
note that
|
It was a permission issue. Do the following: cd /usr/local/bin this worked for me. |
running it like sudo mtr www.google.com worked for me |
I suggested adding the above to your |
This was reported to Homebrew in Homebrew/homebrew-core#14669 and does not appear to affect 0.87, which the previous version we had before recently updating the formula.
Tested on macOS 10.12.5 and built with Xcode 8.3.2.
This does not appear to be an issue on OS X 10.11.6.UPDATE: I had /usr/local/sbin in the PATH on the 10.11.6 box.The text was updated successfully, but these errors were encountered: