setuid on OSX #7

Closed
2bits opened this Issue Apr 28, 2012 · 10 comments

3 participants

@2bits

Hello, Homebrew is a software installer for OSX, and I'm upgrading the formula for fping to use your version. By design, Homebrew does not install anything with sudo, simply by changing the ownership of /usr/local to the user who installs everything. Is there a patch so that fping can be run without changing the owner to root and without chown u+s? I would have tried to craft one for you, but I'm unfamiliar with this. Thanks.

@schweikert
Owner

It should be possible to avoid the setuid requirement by using ICMP DGRAM sockets on Mac OSX:

http://developer.apple.com/library/mac/#DOCUMENTATION/Darwin/Reference/ManPages/man4/icmp.4.html

I am not developing myself on a Mac, so help from a Mac developer would be nice.

@2bits

Closing this to lower the issue count. Someday everyone will have a mac, and this can be reopened :-)

@2bits 2bits closed this Jun 12, 2012
@schweikert schweikert reopened this Jul 15, 2012
@schweikert schweikert closed this Jul 15, 2012
@schweikert
Owner

I appreciate it, but I think that this issue is best left open. It doesn't disturb me and so it isn't hidden.

@2bits

Ok go for it. I don't have permissions.

@schweikert schweikert reopened this Feb 28, 2013
@schweikert schweikert closed this Feb 28, 2013
@schweikert schweikert added a commit that referenced this issue Oct 14, 2013
@schweikert Refactor socket handling, allow running as non-root on Mac OS X by us…
…ing non-privileged ICMP (#7)
0ab66f8
@justindowning

@schweikert I installed fping with homebrew which uses the following options:

Downloading http://fping.org/dist/fping-3.6.tar.gz
./configure --prefix=/usr/local/Cellar/fping/3.6
make install

However, I can't seem to run it as an unprivileged user despite 0ab66f8 fixing that issue.

~ $ fping google.com
fping: can't create raw socket (must run as root?) : Operation not permitted

Any ideas?

@schweikert
Owner

That's because 0ab66f8 is not part of release 3.6 (but will be in 3.7)

@justindowning

Excellent! Thanks for the clarification (and quick reply!). 😄

@schweikert
Owner

Note that fping 3.7 with non-root support for Mac OS X is now released.

@justindowning justindowning added a commit to justindowning/homebrew that referenced this issue Nov 6, 2013
@justindowning justindowning update fping to 3.7
* remove caveat for setuid, fixed in 3.7 schweikert/fping#7
* Refs #3437
0b1c487
@justindowning justindowning referenced this issue in Homebrew/legacy-homebrew Nov 6, 2013
Closed

update fping to 3.7 #24038

@justindowning

@schweikert Thanks again!!

@schweikert
Owner

@justindowning: please use fping 3.8 instead. there is a bug with loop mode in fping 3.7

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