Page 1 of 1

VLC network capture permission

Posted: 22 Dec 2016 12:02
by Mat
Hey,

I'm currently working on a research project about wireless streaming. I need to capture the network traffic during a stream. I wrote a small library thats able to capture the network data I need. If I build a small demo with my library, it works perfectly. Even a normal user (I'm using a current fedora release) is allowed to capture on the network interface without root privileges. This is possible by applying setcap (e.g. "setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip cap_net_bind_service=+ep' ./demo") on the executable.

Now I wrote a sample VLC-Demux Plugin, which includes my library. VLC is not able to open the network interface. It fails with (like) "Operation not permitted. You are not allowed to capture on this interface".
- Setcap on the VLC executables does not change anything ( I also tried it on the generated .so files).
- I tried to run VLC as root (built with "--enable-run-as-root"), same problem. Operation not permitted.

So finally it seems like the privileges are set back somehow by VLC. I was not able to find any code section where this happens. Has anybody an idea what could be the problem? Or where to find the part of the VLC code, where this kind of "reset" happens?

Thanks for your help,
and a merry christmas to all!
Best,
Matthias

Re: VLC network capture permission

Posted: 22 Dec 2016 17:58
by RĂ©mi Denis-Courmont
I'm pretty sure that VLC is not changing capabilities. It does not even know what libcap is.

If you're sure this is caused within the VLC process, run it in a debugger and see where the call comes from.

Re: VLC network capture permission

Posted: 23 Dec 2016 08:59
by Mat
Hm, we have tried initializing our library directly at the beginning of the VLC main function now. Same problem. If we try to read the caps, they are already "empty" at this point... What happens with the capabilities...? Strange behavior...