VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
G::Identity Class Reference

A combination of user-id and group-id, with a very low-level interface to the get/set/e/uid/gid functions. More...

#include <gidentity.h>

Public Member Functions

 Identity (const std::string &login_name)
 Constructor for the named identity. More...
 
bool isRoot () const
 Returns true if the userid is zero.
 
std::string str () const
 Returns a string representation.
 
void setRealUser (bool do_throw=true)
 Sets the real userid.
 
void setEffectiveUser (bool do_throw=true)
 Sets the effective userid.
 
void setEffectiveUser (SignalSafe)
 Sets the effective userid. More...
 
void setRealGroup (bool do_throw=true)
 Sets the real group id.
 
void setEffectiveGroup (bool do_throw=true)
 Sets the effective group id.
 
void setEffectiveGroup (SignalSafe)
 Sets the effective group id. More...
 
bool operator== (const Identity &) const
 Comparison operator.
 
bool operator!= (const Identity &) const
 Comparison operator.
 

Static Public Member Functions

static Identity effective ()
 Returns the current effective identity.
 
static Identity real ()
 Returns the calling process's real identity.
 
static Identity root ()
 Returns the superuser identity.
 
static Identity invalid ()
 Returns an invalid identity.
 
static Identity invalid (SignalSafe)
 Returns an invalid identity, with a signal-safe guarantee. More...
 

Detailed Description

A combination of user-id and group-id, with a very low-level interface to the get/set/e/uid/gid functions.

Uses getpwnam() to do username lookups.

See Also
G::Process, G::Root

Definition at line 42 of file gidentity.h.

Constructor & Destructor Documentation

G::Identity::Identity ( const std::string &  login_name)
explicit

Constructor for the named identity.

Throws if NoSuchUser.

Definition at line 46 of file gidentity_unix.cpp.

Member Function Documentation

G::Identity G::Identity::invalid ( SignalSafe  safe)
static

Returns an invalid identity, with a signal-safe guarantee.

Definition at line 112 of file gidentity_unix.cpp.

void G::Identity::setEffectiveGroup ( SignalSafe  )

Sets the effective group id.

A signal-safe, reentrant overload.

Definition at line 167 of file gidentity_unix.cpp.

void G::Identity::setEffectiveUser ( SignalSafe  )

Sets the effective userid.

A signal-safe, reentrant overload.

Definition at line 147 of file gidentity_unix.cpp.


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