OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::SetUserGroup Class Reference

#include <usergroup.hpp>

Inheritance diagram for openvpn::SetUserGroup:
[legend]

Public Member Functions

 OPENVPN_EXCEPTION (user_group_err)
 
 SetUserGroup (const std::string &user, const std::string &group, const bool strict)
 
 SetUserGroup (const char *user, const char *group, const bool strict)
 
virtual ~SetUserGroup ()=default
 
const std::string & user () const
 
const std::string & group () const
 
virtual void pre_thread () const
 
virtual void post_thread () const
 
virtual void activate () const
 
void chown (const std::string &fn) const
 
void chown (const int fd, const std::string &title) const
 
void invalidate ()
 
uid_t uid () const
 
gid_t gid () const
 
bool uid_defined () const
 
bool gid_defined () const
 
bool defined () const
 

Protected Member Functions

void do_setgid_setgroups () const
 
void do_setuid () const
 
void retain_core_dumps () const
 

Protected Attributes

std::string user_name
 
std::string group_name
 
struct passwd * pw
 
struct groupgr
 

Detailed Description

Definition at line 37 of file usergroup.hpp.

Constructor & Destructor Documentation

◆ SetUserGroup() [1/2]

openvpn::SetUserGroup::SetUserGroup ( const std::string &  user,
const std::string &  group,
const bool  strict 
)
inline

Definition at line 42 of file usergroup.hpp.

◆ SetUserGroup() [2/2]

openvpn::SetUserGroup::SetUserGroup ( const char *  user,
const char *  group,
const bool  strict 
)
inline

Definition at line 49 of file usergroup.hpp.

◆ ~SetUserGroup()

virtual openvpn::SetUserGroup::~SetUserGroup ( )
virtualdefault

Member Function Documentation

◆ activate()

virtual void openvpn::SetUserGroup::activate ( ) const
inlinevirtual

Reimplemented in openvpn::SetUserGroupRetainCap.

Definition at line 89 of file usergroup.hpp.

Here is the caller graph for this function:

◆ chown() [1/2]

void openvpn::SetUserGroup::chown ( const int  fd,
const std::string &  title 
) const
inline

Definition at line 109 of file usergroup.hpp.

◆ chown() [2/2]

void openvpn::SetUserGroup::chown ( const std::string &  fn) const
inline

Definition at line 96 of file usergroup.hpp.

Here is the caller graph for this function:

◆ defined()

bool openvpn::SetUserGroup::defined ( ) const
inline

Definition at line 154 of file usergroup.hpp.

◆ do_setgid_setgroups()

void openvpn::SetUserGroup::do_setgid_setgroups ( ) const
inlineprotected

Definition at line 160 of file usergroup.hpp.

Here is the caller graph for this function:

◆ do_setuid()

void openvpn::SetUserGroup::do_setuid ( ) const
inlineprotected

Definition at line 180 of file usergroup.hpp.

Here is the caller graph for this function:

◆ gid()

gid_t openvpn::SetUserGroup::gid ( ) const
inline

Definition at line 136 of file usergroup.hpp.

Here is the caller graph for this function:

◆ gid_defined()

bool openvpn::SetUserGroup::gid_defined ( ) const
inline

Definition at line 149 of file usergroup.hpp.

Here is the caller graph for this function:

◆ group()

const std::string & openvpn::SetUserGroup::group ( ) const
inline

Definition at line 76 of file usergroup.hpp.

Here is the caller graph for this function:

◆ invalidate()

void openvpn::SetUserGroup::invalidate ( )
inline

Definition at line 122 of file usergroup.hpp.

◆ OPENVPN_EXCEPTION()

openvpn::SetUserGroup::OPENVPN_EXCEPTION ( user_group_err  )

◆ post_thread()

virtual void openvpn::SetUserGroup::post_thread ( ) const
inlinevirtual

Reimplemented in openvpn::SetUserGroupRetainCap.

Definition at line 85 of file usergroup.hpp.

◆ pre_thread()

virtual void openvpn::SetUserGroup::pre_thread ( ) const
inlinevirtual

Reimplemented in openvpn::SetUserGroupRetainCap.

Definition at line 81 of file usergroup.hpp.

◆ retain_core_dumps()

void openvpn::SetUserGroup::retain_core_dumps ( ) const
inlineprotected

Definition at line 193 of file usergroup.hpp.

Here is the caller graph for this function:

◆ uid()

uid_t openvpn::SetUserGroup::uid ( ) const
inline

Definition at line 128 of file usergroup.hpp.

Here is the caller graph for this function:

◆ uid_defined()

bool openvpn::SetUserGroup::uid_defined ( ) const
inline

Definition at line 144 of file usergroup.hpp.

Here is the caller graph for this function:

◆ user()

const std::string & openvpn::SetUserGroup::user ( ) const
inline

Definition at line 71 of file usergroup.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ gr

struct group* openvpn::SetUserGroup::gr
protected

Definition at line 212 of file usergroup.hpp.

◆ group_name

std::string openvpn::SetUserGroup::group_name
protected

Definition at line 209 of file usergroup.hpp.

◆ pw

struct passwd* openvpn::SetUserGroup::pw
protected

Definition at line 211 of file usergroup.hpp.

◆ user_name

std::string openvpn::SetUserGroup::user_name
protected

Definition at line 208 of file usergroup.hpp.


The documentation for this class was generated from the following file: