|
Tor
0.4.7.0-alpha-dev
|
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
| #define SWITCH_ID_WARN_IF_NO_CAPS (1<<1) |
Flag for switch_id; see switch_id() for documentation
| int have_capability_support | ( | void | ) |
| 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.