CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
namespace.h File Reference
#include <unistd.h>
#include <string>
#include "util/export.h"
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

CVMFS_EXPORT int CheckNamespaceFeatures ()
 
CVMFS_EXPORT NamespaceFailures CreateUserNamespace (uid_t map_uid_to, gid_t map_gid_to)
 
CVMFS_EXPORT bool CreateMountNamespace ()
 
CVMFS_EXPORT bool CreatePidNamespace (int *fd_parent)
 
CVMFS_EXPORT bool BindMount (const std::string &from, const std::string &to)
 
CVMFS_EXPORT 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 22 of file namespace.h.

Function Documentation

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

Definition at line 100 of file namespace.cc.

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

Here is the caller graph for this function:

CVMFS_EXPORT int CheckNamespaceFeatures ( )

Definition at line 42 of file namespace.cc.

Here is the call graph for this function:

CVMFS_EXPORT bool CreateMountNamespace ( )

Definition at line 120 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:

CVMFS_EXPORT 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 155 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:

CVMFS_EXPORT NamespaceFailures CreateUserNamespace ( uid_t  map_uid_to,
gid_t  map_gid_to 
)

Definition at line 60 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:

CVMFS_EXPORT bool ProcMount ( const std::string &  to)

Definition at line 110 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 17 of file namespace.h.

Referenced by CheckNamespaceFeatures().

const int kNsFeaturePid = 0x02

Definition at line 18 of file namespace.h.

Referenced by CheckNamespaceFeatures().

const int kNsFeatureUserAvailable = 0x04

Definition at line 19 of file namespace.h.

Referenced by CheckNamespaceFeatures().

const int kNsFeatureUserEnabled = 0x08

Definition at line 20 of file namespace.h.

Referenced by CheckNamespaceFeatures().