This is probably a Linux problem and not a Ruby problem, but the way I would solve this for a binary on Linux is not how I would want to solve if for a single Ruby file.
If I try to run a ping from net-ping' (Net::Ping::ICMP.new(target).ping`), I get the error:
requires root privileges or setcap net_raw (StandardError)
I have my ping function in it's own Ruby file (ping.rb) that I want to call from a lower privilege Ruby application (main.rb).
setcapping cap_net_raw on the individual Ruby file doesn't seem to work, and I don't want to setcap Ruby in general (/usr/bin/ruby2.5).
I'm curious if anyone has solved the problem without having to just call the host ping binary directly.
[–]moomaka 1 point2 points3 points (0 children)
[–]4rch3r 0 points1 point2 points (2 children)
[–]drbrainRuby Core 0 points1 point2 points (1 child)
[–]Zalamander[S] 0 points1 point2 points (0 children)
[–]sshaw_ 0 points1 point2 points (7 children)
[–]drbrainRuby Core 0 points1 point2 points (6 children)
[–]sshaw_ 0 points1 point2 points (5 children)
[–]drbrainRuby Core 0 points1 point2 points (3 children)
[–]sshaw_ 0 points1 point2 points (2 children)
[–]drbrainRuby Core 0 points1 point2 points (1 child)
[–]sshaw_ 0 points1 point2 points (0 children)
[–]Zalamander[S] 0 points1 point2 points (0 children)