CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
namespace.h File Reference
#include <unistd.h>
#include <string>
Include dependency graph for namespace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  NamespaceFailures {
  kFailNsOk = 0, kFailNsUnsuppored, kFailNsUnshare, kFailNsMapUidOpen,
  kFailNsMapUidWrite, kFailNsSetgroupsOpen, kFailNsSetgroupsWrite, kFailNsMapGidOpen,
  kFailNsMapGidWrite
}
 

Functions

int CheckNamespaceFeatures ()
 
NamespaceFailures CreateUserNamespace (uid_t map_uid_to, gid_t map_gid_to)
 
bool CreateMountNamespace ()
 
bool CreatePidNamespace (int *fd_parent)
 
bool BindMount (const std::string &from, const std::string &to)
 
bool ProcMount (const std::string &to)
 

Variables

const int kNsFeatureMount = 0x01
 
const int kNsFeaturePid = 0x02
 
const int kNsFeatureUserAvailable = 0x04
 
const int kNsFeatureUserEnabled = 0x08
 

Enumeration Type Documentation

Enumerator
kFailNsOk 
kFailNsUnsuppored 
kFailNsUnshare 
kFailNsMapUidOpen 
kFailNsMapUidWrite 
kFailNsSetgroupsOpen 
kFailNsSetgroupsWrite 
kFailNsMapGidOpen 
kFailNsMapGidWrite 

Definition at line 20 of file namespace.h.

Function Documentation

bool BindMount ( const std::string &  from,
const std::string &  to 
)

Definition at line 98 of file namespace.cc.

Referenced by publish::CmdEnter::CreateUnderlay(), and publish::CmdEnter::MountCvmfs().

Here is the caller graph for this function:

int CheckNamespaceFeatures ( )

Definition at line 40 of file namespace.cc.

Here is the call graph for this function:

bool CreateMountNamespace ( )

Definition at line 118 of file namespace.cc.

Referenced by anonymous_namespace{cmd_enter.cc}::EnterRootContainer().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CreatePidNamespace ( int *  fd_parent)

The fd_parent file descriptor, if passed, is the read end of a pipe whose write end is connected to the parent process. This gives the namespace's init process a means to know its pid in the context of the parent namespace.

Definition at line 151 of file namespace.cc.

Referenced by anonymous_namespace{cmd_enter.cc}::EnterRootContainer().

Here is the call graph for this function:

Here is the caller graph for this function:

NamespaceFailures CreateUserNamespace ( uid_t  map_uid_to,
gid_t  map_gid_to 
)

Definition at line 58 of file namespace.cc.

Referenced by anonymous_namespace{cmd_enter.cc}::EnterRootContainer(), and publish::CmdEnter::Main().

Here is the call graph for this function:

Here is the caller graph for this function:

bool ProcMount ( const std::string &  to)

Definition at line 108 of file namespace.cc.

Referenced by publish::CmdEnter::Main().

Here is the caller graph for this function:

Variable Documentation

const int kNsFeatureMount = 0x01

This file is part of the CernVM File System.

Wrappers around the unshare() call. Implementation on Linux only, on macOS implementation is empty and returns with error codes.

Definition at line 15 of file namespace.h.

Referenced by CheckNamespaceFeatures().

const int kNsFeaturePid = 0x02

Definition at line 16 of file namespace.h.

Referenced by CheckNamespaceFeatures().

const int kNsFeatureUserAvailable = 0x04

Definition at line 17 of file namespace.h.

Referenced by CheckNamespaceFeatures().

const int kNsFeatureUserEnabled = 0x08

Definition at line 18 of file namespace.h.

Referenced by CheckNamespaceFeatures().