mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 02:10:59 +00:00
Added a description to the shim loader, and renamed it.
This commit is contained in:
parent
83a28021ad
commit
7cd8456445
@ -7,6 +7,14 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
/* This setuid wrapper can be used to run mitmproxy in full transparency mode, as a normal user.
|
||||||
|
* It will set the required capabilities (CAP_NET_RAW), drop privileges, and will then run argv[1]
|
||||||
|
* with the same capabilities.
|
||||||
|
*
|
||||||
|
* It can be compiled as follows:
|
||||||
|
* gcc examples/mitmproxy_shim.c -o mitmproxy_shim -lcap
|
||||||
|
*/
|
||||||
|
|
||||||
int set_caps(cap_t cap_struct, cap_value_t *cap_list, size_t bufsize) {
|
int set_caps(cap_t cap_struct, cap_value_t *cap_list, size_t bufsize) {
|
||||||
int cap_count = bufsize / sizeof(cap_list[0]);
|
int cap_count = bufsize / sizeof(cap_list[0]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user