I'm developing a small C++ tool that makes use of libtins. To run its network sniffer with enough permissions, it is required whether to use sudo or setcap cap_net_bind_service=+ep <binaryFile>
.
As my program is being called from the web server, when the user interacts with the frontend, I cannot use sudo, so I opted for the setcap solution. The problem is, setcap disables LD_LIBRARY_PATH, so the program will complain about not finding a library. How should I set the library path?
I've also seen mentions to authbind, but I don't quite understand how can I grant the program access to all ports.