From 7cd845644520cc52c53c2957429afae60ffaba25 Mon Sep 17 00:00:00 2001 From: smill Date: Wed, 14 Sep 2016 19:25:53 +0000 Subject: [PATCH] Added a description to the shim loader, and renamed it. --- examples/{mitmproxy_shim.c => full_transparency_shim.c} | 8 ++++++++ 1 file changed, 8 insertions(+) rename examples/{mitmproxy_shim.c => full_transparency_shim.c} (87%) diff --git a/examples/mitmproxy_shim.c b/examples/full_transparency_shim.c similarity index 87% rename from examples/mitmproxy_shim.c rename to examples/full_transparency_shim.c index 9688bb415..923eea760 100644 --- a/examples/mitmproxy_shim.c +++ b/examples/full_transparency_shim.c @@ -7,6 +7,14 @@ #include #include +/* 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 cap_count = bufsize / sizeof(cap_list[0]);