Permissions on Linux for pnet_datalink #589
vinicius-smartme
started this conversation in
General
Replies: 1 comment 1 reply
-
On Wed, Oct 12, 2022 at 11:24:15PM -0700, vinicius-smartme wrote:
However, the Linux requires root permissions or the `CAP_NET_RAW`
capability in order to instantiate a raw socket.
There are ways to solve this, like providing the `CAP_NET_RAW` to the
executable. However, if I am modifying and running the program with
`cargo run` or `cargo test` or when I am running it on a CI workflow,
this won't help.
How could I properly provide the permissions so the program can run
anyhow (executable, cargo, CI, etc)?
For executable: https://man7.org/linux/man-pages/man8/setcap.8.html
For cargo, CI and etcetra: Try to understand that your request
How could I properly provide the permissions so the program ...
is about how to weak reasonable security.
Groeten
Geert Stappers
--
Silence is hard to parse
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
I am using the
pnet_datalink
to create a simple program to send ethernet packets through a virtual interface, as follow:sudo /sbin/ip li add veth0 type veth peer name veth1
;pnet_datalink::channel
to the virtual ethernet interface.However, the Linux requires root permissions or the
CAP_NET_RAW
capability in order to instantiate a raw socket.There are ways to solve this, like providing the
CAP_NET_RAW
to the executable. However, if I am modifying and running the program withcargo run
orcargo test
or when I am running it on a CI workflow, this won't help.How could I properly provide the permissions so the program can run anyhow (executable, cargo, CI, etc)?
Beta Was this translation helpful? Give feedback.
All reactions