DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
#include <User.hpp>
Public Member Functions | |
User () throw () | |
constructor for current user | |
User (uid_t user_id) throw () | |
constructor from uid | |
User (const std::string &name) | |
constructor from name | |
User (const User &other) throw () | |
copy constructor | |
operator uid_t () const throw () | |
cast to user id | |
operator std::string () const | |
cast to string | |
operator const char * () const | |
cast to c-string | |
uid_t | identity () const throw () |
user-id | |
const std::string & | name () const |
username | |
const std::string & | name_safe () const throw () |
username - no exception | |
const std::string & | home () const |
home directory name | |
const std::string & | real_name () const |
real name | |
void | setuid () const |
tries to set the uid of current process | |
Static Public Attributes | |
static const User | ROOT |
constant for root user | |
Protected Member Functions | |
void | resolve () const |
resolve information from user-id | |
void | resolve_safe () const throw () |
resolve without throwing exceptions | |
Protected Attributes | |
uid_t | m_user_id |
the actual user id | |
std::string | m_user_name |
cached user name | |
std::string | m_user_home |
cached user home directory | |
std::string | m_user_real_name |
cached real user name | |
OksSystem::User::User | ( | ) | ||||
throw | ( | ) |
OksSystem::User::User | ( | uid_t | user_id | ) | ||
throw | ( | ) |
OksSystem::User::User | ( | const std::string & | name | ) |
constructor from name
Definition at line 30 of file User.cpp.
OksSystem::User::User | ( | const User & | other | ) | ||
throw | ( | ) |
copy constructor
const std::string & OksSystem::User::home | ( | ) | const |
uid_t OksSystem::User::identity | ( | ) | const | |||
throw | ( | ) |
const std::string & OksSystem::User::name | ( | ) | const |
username
Gets the (short) name of the user
const std::string & OksSystem::User::name_safe | ( | ) | const | |||
throw | ( | ) |
username - no exception
Gets the (short) name of the user - no error is thrown in case of problem
Definition at line 204 of file User.cpp.
OksSystem::User::operator const char * | ( | ) | const |
cast to c-string
OksSystem::User::operator std::string | ( | ) | const |
OksSystem::User::operator uid_t | ( | ) | const | |||
throw | ( | ) |
const std::string & OksSystem::User::real_name | ( | ) | const |
real name
Gets the 'real name' of the user
|
protected |
resolve information from user-id
This method is responsible for filling in the mutable fields of the class when needed, this is done by calling the getpwuid
function, all fields of the object are then filled in.
OksSystem::OksSystemCallIssue | if the user information cannot be found |
Definition at line 106 of file User.cpp.
|
protected |
resolve without throwing exceptions
This method is the same as resolve()
but does not throw exceptions. Instead the method silently fails
Definition at line 152 of file User.cpp.
void OksSystem::User::setuid | ( | ) | const |
tries to set the uid of current process
Sets the user-identity of the current process to this user. This method will only succeed if the current user has sufficient privileges to changed uids (typically because the current user is root).
Definition at line 232 of file User.cpp.
|
mutableprotected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
static |