开发者

Building with QtCreator and giving capability to Pcap

开发者 https://www.devze.com 2023-03-09 03:21 出处:网络
I am building a sniffer with Qt as GUI, pcap as capture library and QtCreator as GUI under Ubuntu 10.04.

I am building a sniffer with Qt as GUI, pcap as capture library and QtCreator as GUI under Ubuntu 10.04.

Problem is: Before I can capture packets, since my app is not meant to be run as root, I need to

sudo setcap cap_net_raw,cap_net_admin=eip my_program

and at every build, this capability is overwr开发者_Go百科itten. Any idea how i can automate this process using QtCreator? I tried to add the command to the build steps after the Make step, but it doesn't seem to work that way, probably because of the "sudo" required...

Thank you!

0

精彩评论

暂无评论...
验证码 换一张
取 消