DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
okssystem
include
okssystem
User.hpp
Go to the documentation of this file.
1
// DUNE DAQ modification notice:
2
// This file has been modified from the original ATLAS system source for the DUNE DAQ project.
3
// Fork baseline commit: system-00-00-20 (2020-09-25).
4
// Renamed since fork: yes (from system/User.h to include/okssystem/User.hpp).
5
6
/*
7
* User.h
8
* OksSystem
9
*
10
* Created by Matthias Wiesmann on 03.02.05.
11
* Copyright 2005 CERN. All rights reserved.
12
*
13
*/
14
15
#ifndef OKSSYSTEM_USER
16
#define OKSSYSTEM_USER
17
18
#include <unistd.h>
19
#include <sys/types.h>
20
#include <string>
21
22
namespace
OksSystem
{
23
29
30
class
User
{
31
32
protected
:
33
uid_t
m_user_id
;
34
mutable
std::string
m_user_name
;
35
mutable
std::string
m_user_home
;
36
mutable
std::string
m_user_real_name
;
37
void
resolve
()
const
;
38
void
resolve_safe
()
const
throw() ;
39
public:
40
static const
User
ROOT
;
41
User
() throw() ;
42
User
(uid_t user_id) throw() ;
43
User
(const
std
::
string
&
name
);
44
User
(const
User
&other) throw() ;
45
operator uid_t() const throw() ;
46
operator
std
::
string
() const ;
47
operator const
char
*() const ;
48
uid_t
identity
() const throw() ;
49
const
std
::
string
&
name
() const ;
50
const
std
::
string
&
name_safe
() const throw() ;
51
const
std
::
string
&
home
() const ;
52
const
std
::
string
&
real_name
() const ;
53
void
setuid
() const ;
54
};
// User
55
56
}
// OksSystem
57
58
std
::ostream& operator<<(
std
::ostream& stream, const
OksSystem
::
User
& user) throw() ;
59
60
61
bool
operator ==(const
OksSystem
::
User
&a, const
OksSystem
::
User
&b) throw();
62
bool
operator !=(const
OksSystem
::
User
&a, const
OksSystem
::
User
&b) throw();
63
64
65
#endif
66
OksSystem::User::resolve
void resolve() const
resolve information from user-id
Definition
User.cpp:111
OksSystem::User::resolve_safe
void resolve_safe() const
resolve without throwing exceptions
Definition
User.cpp:157
OksSystem::User::ROOT
static const User ROOT
constant for root user
Definition
User.hpp:40
OksSystem::User::name
const std::string & name() const
username
Definition
User.cpp:200
OksSystem::User::identity
uid_t identity() const
user-id
Definition
User.cpp:101
OksSystem::User::home
const std::string & home() const
home directory name
Definition
User.cpp:218
OksSystem::User::m_user_real_name
std::string m_user_real_name
cached real user name
Definition
User.hpp:36
OksSystem::User::real_name
const std::string & real_name() const
real name
Definition
User.cpp:227
OksSystem::User::m_user_id
uid_t m_user_id
the actual user id
Definition
User.hpp:33
OksSystem::User::name_safe
const std::string & name_safe() const
username - no exception
Definition
User.cpp:209
OksSystem::User::setuid
void setuid() const
tries to set the uid of current process
Definition
User.cpp:237
OksSystem::User::m_user_home
std::string m_user_home
cached user home directory
Definition
User.hpp:35
OksSystem::User::m_user_name
std::string m_user_name
cached user name
Definition
User.hpp:34
OksSystem::User::User
User()
constructor for current user
Definition
User.cpp:27
OksSystem
Definition
Descriptor.hpp:22
std
Definition
SchemaUtils.hpp:118
Generated on
for DUNE-DAQ by
1.17.0