Tor
0.4.7.0-alpha-dev
|
Change the user ID after Tor has started (Unix only) More...
#include "orconfig.h"
#include "lib/process/setuid.h"
#include "lib/container/smartlist.h"
#include "lib/fs/userdb.h"
#include "lib/log/log.h"
#include "lib/log/util_bug.h"
#include "lib/malloc/malloc.h"
#include <errno.h>
#include <string.h>
Go to the source code of this file.
Macros | |
#define | CREDENTIAL_LOG_LEVEL LOG_INFO |
Functions | |
static int | log_credential_status (void) |
int | have_capability_support (void) |
int | switch_id (const char *user, const unsigned flags) |
Change the user ID after Tor has started (Unix only)
Definition in file setuid.c.
int have_capability_support | ( | void | ) |
|
static |
Log details of current user and group credentials. Return 0 on success. Logs and return -1 on failure.
Log level to use when describing non-error UID/GID status.
Definition at line 51 of file setuid.c.
Referenced by switch_id().
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.