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 <string>
19
#include <sys/types.h>
20
#include <unistd.h>
21
22
namespace
OksSystem
{
23
29
30
class
User
31
{
32
33
protected
:
34
uid_t
m_user_id
;
35
mutable
std::string
m_user_name
;
36
mutable
std::string
m_user_home
;
37
mutable
std::string
m_user_real_name
;
38
void
resolve
()
const
;
39
void
resolve_safe
()
const
throw();
40
public:
41
static const
User
ROOT
;
42
User
() throw();
43
User
(uid_t user_id) throw();
44
User
(const
std
::
string
&
name
);
45
User
(const
User
& other) throw();
46
operator uid_t() const throw();
47
operator
std
::
string
() const;
48
operator const
char
*() const;
49
uid_t
identity
() const throw();
50
const
std
::
string
&
name
() const;
51
const
std
::
string
&
name_safe
() const throw();
52
const
std
::
string
&
home
() const;
53
const
std
::
string
&
real_name
() const;
54
void
setuid
() const;
55
};
// User
56
57
}
// OksSystem
58
59
std
::ostream&
60
operator<<(
std
::ostream& stream, const
OksSystem
::
User
& user) throw();
61
62
bool
63
operator==(const
OksSystem
::
User
& a, const
OksSystem
::
User
& b) throw();
64
bool
65
operator!=(const
OksSystem
::
User
& a, const
OksSystem
::
User
& b) throw();
66
67
#endif
OksSystem::User::resolve
void resolve() const
resolve information from user-id
Definition
User.cpp:122
OksSystem::User::resolve_safe
void resolve_safe() const
resolve without throwing exceptions
Definition
User.cpp:170
OksSystem::User::ROOT
static const User ROOT
constant for root user
Definition
User.hpp:41
OksSystem::User::name
const std::string & name() const
username
Definition
User.cpp:215
OksSystem::User::identity
uid_t identity() const
user-id
Definition
User.cpp:110
OksSystem::User::home
const std::string & home() const
home directory name
Definition
User.cpp:241
OksSystem::User::m_user_real_name
std::string m_user_real_name
cached real user name
Definition
User.hpp:37
OksSystem::User::real_name
const std::string & real_name() const
real name
Definition
User.cpp:254
OksSystem::User::m_user_id
uid_t m_user_id
the actual user id
Definition
User.hpp:34
OksSystem::User::name_safe
const std::string & name_safe() const
username - no exception
Definition
User.cpp:228
OksSystem::User::setuid
void setuid() const
tries to set the uid of current process
Definition
User.cpp:268
OksSystem::User::m_user_home
std::string m_user_home
cached user home directory
Definition
User.hpp:36
OksSystem::User::m_user_name
std::string m_user_name
cached user name
Definition
User.hpp:35
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.18.0