NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
privilege-helper.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_CORE_PRIVILEGE_HELPER_HPP
27
#define NFD_CORE_PRIVILEGE_HELPER_HPP
28
29
#include "common.hpp"
30
31
#include <unistd.h>
32
33
namespace
nfd
{
34
35
class
PrivilegeHelper
36
{
37
public
:
38
43
class
Error
44
{
45
public
:
46
explicit
47
Error
(
const
std::string&
what
)
48
: m_whatMessage(what)
49
{
50
}
51
52
const
char
*
53
what
()
const
54
{
55
return
m_whatMessage.c_str();
56
}
57
58
private
:
59
const
std::string m_whatMessage;
60
};
61
62
static
void
63
initialize
(
const
std::string& userName,
const
std::string& groupName);
64
65
static
void
66
drop
();
67
68
static
void
69
runElevated
(
function
<
void
()> f);
70
71
PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
72
73
static
void
74
raise
();
75
76
PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
77
#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
78
static
uid_t s_normalUid;
79
static
gid_t s_normalGid;
80
81
static
uid_t s_privilegedUid;
82
static
gid_t s_privilegedGid;
83
#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
84
};
85
86
}
// namespace nfd
87
88
#endif // NFD_CORE_PRIVILEGE_HELPER_HPP
nfd::PrivilegeHelper::runElevated
static void runElevated(function< void()> f)
Definition:
privilege-helper.cpp:196
nfd::PrivilegeHelper::Error
represents a serious seteuid/gid failure
Definition:
privilege-helper.hpp:43
nfd::PrivilegeHelper::drop
static void drop()
Definition:
privilege-helper.cpp:141
nfd::PrivilegeHelper::Error::Error
Error(const std::string &what)
Definition:
privilege-helper.hpp:47
nfd::PrivilegeHelper::initialize
static void initialize(const std::string &userName, const std::string &groupName)
Definition:
privilege-helper.cpp:45
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
nfd::PrivilegeHelper
Definition:
privilege-helper.hpp:35
PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:39
nfd::PrivilegeHelper::Error::what
const char * what() const
Definition:
privilege-helper.hpp:53
ndnSIM
NFD
core
privilege-helper.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11