|
Tor 0.4.9.8
|
Go to the source code of this file.
Macros | |
| #define | SWITCH_ID_KEEP_BINDLOW (1<<0) |
| #define | SWITCH_ID_WARN_IF_NO_CAPS (1<<1) |
Functions | |
| int | have_capability_support (void) |
| int | switch_id (const char *user, unsigned flags) |
| #define SWITCH_ID_KEEP_BINDLOW (1<<0) |
Flag for switch_id; see switch_id() for documentation
Definition at line 17 of file setuid.h.
Referenced by options_switch_id(), and switch_id().
| #define SWITCH_ID_WARN_IF_NO_CAPS (1<<1) |
Flag for switch_id; see switch_id() for documentation
Definition at line 19 of file setuid.h.
Referenced by options_switch_id(), and switch_id().
| int have_capability_support | ( | void | ) |
Return true iff we were compiled with capability support, and capabilities seem to work.
Definition at line 149 of file setuid.c.
Referenced by check_and_prune_server_ports().
| int switch_id | ( | const char * | user, |
| const unsigned | flags ) |
Call setuid and setgid to run as user and switch to their primary group. Return 0 on success. On failure, log and return -1.
If SWITCH_ID_KEEP_BINDLOW is set in 'flags', try to use the capability system to retain the abilitity to bind low ports.
If SWITCH_ID_WARN_IF_NO_CAPS is set in flags, also warn if we have don't have capability support.
Definition at line 230 of file setuid.c.
Referenced by options_switch_id().