iodine/src
Oleksandr Natalenko ebf4e7ee9e check capabilities, not effective user ID
Under Linux, a process may not be run under root, yet it may have a permission
to do what a superuser may do given specific capabilities are granted.

This commit makes iodine not depend on EUID being 0 in order to run
properly. Instead, in presence of libcap-ng, the following capabilities
are being checked:

* `CAP_NET_BIND_SERVICES` for server to bind to a port, lower than
  `/proc/sys/net/ipv4/ip_unprivileged_port_start`
* `CAP_NET_ADMIN` to operate on a TUN device
* `CAP_SETUID` and `CAP_SETGID` in case server is configured to change
  the user it runs on behalf of

This change is handy if iodine is being run under a non-root user, provided
`AmbientCapabilities=` and `CapabilityBoundingSet=` of systemd are employed
in the first place.

Fixes: https://github.com/yarrick/iodine/issues/80
Signed-off-by: Oleksandr Natalenko <oleksandr@redhat.com>
2022-11-02 19:14:09 +01:00
..
Android.16.mk Try building working binaries for non-ancient Android 2017-10-22 11:54:59 +02:00
Android.mk Second attempt at PIE binary for new android 2015-08-05 20:04:03 +02:00
android_dns.h Warn, warn warn. 2017-03-11 21:30:01 -08:00
base32.c Formatting: no space before parenthesis in function call. 2020-07-24 18:51:05 +02:00
base64.c Formatting: No spaces after '(' or before ')' 2020-07-24 19:02:41 +02:00
base128.c Formatting: no space before parenthesis in function call. 2020-07-24 18:51:05 +02:00
client.c Formatting: Fix mixed use of tabs and spaces 2020-08-01 17:29:49 +02:00
client.h consequently use tabs, and no spaces 2017-04-10 21:26:13 +02:00
common.c check capabilities, not effective user ID 2022-11-02 19:14:09 +01:00
common.h check capabilities, not effective user ID 2022-11-02 19:14:09 +01:00
dns.c Formatting: spaces around operators 2020-07-24 19:15:02 +02:00
dns.h consequently use tabs, and no spaces 2017-04-10 21:26:13 +02:00
encoding.c encoding: simplify {places,eats}_dots 2017-03-11 21:30:50 -08:00
encoding.h consequently use tabs, and no spaces 2017-04-10 21:26:13 +02:00
fw_query.c Change license wording to follow ISC license exactly 2014-08-07 21:18:33 +02:00
fw_query.h Warn, warn warn. 2017-03-11 21:30:01 -08:00
iodine.c check capabilities, not effective user ID 2022-11-02 19:14:09 +01:00
iodined.c check capabilities, not effective user ID 2022-11-02 19:14:09 +01:00
login.c util: add missing #includes 2017-03-11 14:23:02 -08:00
login.h Change license wording to follow ISC license exactly 2014-08-07 21:18:33 +02:00
Makefile Clean up makefile 2020-05-24 14:12:40 +02:00
md5.c Formatting: Use tabs for indents 2021-01-31 13:46:12 +01:00
md5.h Remove trailing whitespace 2014-06-01 08:46:54 +02:00
osflags check capabilities, not effective user ID 2022-11-02 19:14:09 +01:00
read.c Formatting: Space between 'if' and parenthesis 2020-07-24 18:56:30 +02:00
read.h global: constify things 2017-03-11 21:30:49 -08:00
tun.c tun: Add openvpn componentid prefix 2022-07-18 23:31:13 +02:00
tun.h Change license wording to follow ISC license exactly 2014-08-07 21:18:33 +02:00
user.c user: Expand newip char array 2022-07-18 23:35:54 +02:00
user.h Merge branch 'protect-options' of https://github.com/Masaq-/iodine into protect_opts 2017-10-22 11:59:38 +02:00
util.c util: Remove duplicate assignments of rv to NULL 2021-08-25 22:05:19 +02:00
util.h Warn, warn warn. 2017-03-11 21:30:01 -08:00
version.h Change license wording to follow ISC license exactly 2014-08-07 21:18:33 +02:00
windows.h More compact no-op of Windows syslog 2021-01-31 14:01:13 +01:00