suricata
util-privs.h File Reference

Go to the source code of this file.

Macros

#define SC_CAP_NONE   0x01
 
#define SC_CAP_SYS_ADMIN   0x02
 
#define SC_CAP_SYS_RAW_IO   0x04
 
#define SC_CAP_IPC_LOCK   0x08
 
#define SC_CAP_NET_ADMIN   0x10
 
#define SC_CAP_NET_RAW   0x20
 
#define SC_CAP_NET_BIND_SERVICE   0x40
 
#define SC_CAP_NET_BROADCAST   0x80
 
#define SCDropCaps(...)
 
#define SCDropMainThreadCaps(...)
 
#define SCPledge(...)
 

Functions

int SCGetUserID (const char *, const char *, uint32_t *, uint32_t *)
 Function to get the user and group ID from the specified user name. More...
 
int SCGetGroupID (const char *, uint32_t *)
 Function to get the group ID from the specified group name. More...
 

Detailed Description

Macro Definition Documentation

#define SC_CAP_IPC_LOCK   0x08

Definition at line 30 of file util-privs.h.

#define SC_CAP_NET_ADMIN   0x10

Definition at line 31 of file util-privs.h.

Referenced by TmModuleReceiveIPFWRegister(), and TmModuleVerdictIPFWRegister().

#define SC_CAP_NET_BIND_SERVICE   0x40

Definition at line 33 of file util-privs.h.

Referenced by TmModuleReceiveIPFWRegister(), and TmModuleVerdictIPFWRegister().

#define SC_CAP_NET_BROADCAST   0x80

Definition at line 34 of file util-privs.h.

Referenced by TmModuleReceiveIPFWRegister().

#define SC_CAP_NONE   0x01

Definition at line 27 of file util-privs.h.

#define SC_CAP_SYS_ADMIN   0x02

Definition at line 28 of file util-privs.h.

#define SC_CAP_SYS_RAW_IO   0x04

Definition at line 29 of file util-privs.h.

#define SCDropCaps (   ...)

Definition at line 37 of file util-privs.h.

Referenced by StatsSetUI64(), and TmThreadsSlotVarRun().

#define SCDropMainThreadCaps (   ...)

Definition at line 38 of file util-privs.h.

Referenced by main().

#define SCPledge (   ...)

Definition at line 100 of file util-privs.h.

Referenced by main(), and SCGetGroupID().

Function Documentation

int SCGetGroupID ( const char *  group_name,
uint32_t *  gid 
)

Function to get the group ID from the specified group name.

Parameters
group_namepointer to the given group name
gidpointer to the group id in which result will be stored
Return values
uponsuccess it return 0

Definition at line 213 of file util-privs.c.

References group, SC_ERR_GID_FAILED, SC_ERR_PLEDGE_FAILED, SCLogError, and SCPledge.

Referenced by RegisterAllModules().

Here is the caller graph for this function:

int SCGetUserID ( const char *  user_name,
const char *  group_name,
uint32_t *  uid,
uint32_t *  gid 
)

Function to get the user and group ID from the specified user name.

Parameters
user_namepointer to the given user name
uidpointer to the user id in which result will be stored
gidpointer to the group id in which result will be stored
Return values
uponsuccess it return 0

Definition at line 150 of file util-privs.c.

References group, SC_ERR_GID_FAILED, SC_ERR_UID_FAILED, and SCLogError.

Referenced by RegisterAllModules().

Here is the caller graph for this function: