CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cvmfs_suid_helper.cc File Reference
#include <sys/xattr.h>
#include <dirent.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include "cvmfs_suid_util.h"
#include "sanitizer.h"
#include "util/platform.h"
Include dependency graph for cvmfs_suid_helper.cc:

Go to the source code of this file.

Classes

class  ScopedWorkingDirectory
 
struct  ScopedWorkingDirectory::DirectoryEntry
 

Enumerations

enum  RemountType { kRemountRdonly, kRemountRw }
 

Functions

static void GetCredentials (uid_t *calling_uid, uid_t *effective_uid)
 
static void ExecAsRoot (const char *binary, const char *arg1, const char *arg2, const char *arg3, const char *arg4)
 
static void ForkAndExecAsRoot (const char *binary, const char *arg1, const char *arg2, const char *arg3, const char *arg4)
 
static void Remount (const string &path, const RemountType how)
 
static void Mount (const string &path)
 
static void Umount (const string &path)
 
static void LazyUmount (const string &path)
 
static void KillCvmfs (const string &fqrn)
 
static bool ClearDirectory (const string &path)
 
static int CleanupDirectory (const string &path)
 
static int DoSynchronousScratchCleanup (const string &fqrn)
 
static int DoAsynchronousScratchCleanup (const string &fqrn)
 
static void Usage (const string &exe, FILE *output)
 
int main (int argc, char *argv[])
 

Variables

const char * kSpoolArea = "/var/spool/cvmfs"
 

Enumeration Type Documentation

Enumerator
kRemountRdonly 
kRemountRw 

Definition at line 31 of file cvmfs_suid_helper.cc.

Function Documentation

static int CleanupDirectory ( const string &  path)
static

Definition at line 238 of file cvmfs_suid_helper.cc.

Referenced by DoAsynchronousScratchCleanup(), and DoSynchronousScratchCleanup().

Here is the call graph for this function:

Here is the caller graph for this function:

static bool ClearDirectory ( const string &  path)
static

Definition at line 221 of file cvmfs_suid_helper.cc.

Referenced by CleanupDirectory().

Here is the call graph for this function:

Here is the caller graph for this function:

static int DoAsynchronousScratchCleanup ( const string &  fqrn)
static

Definition at line 251 of file cvmfs_suid_helper.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int DoSynchronousScratchCleanup ( const string &  fqrn)
static

Definition at line 246 of file cvmfs_suid_helper.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void ExecAsRoot ( const char *  binary,
const char *  arg1,
const char *  arg2,
const char *  arg3,
const char *  arg4 
)
static

Definition at line 41 of file cvmfs_suid_helper.cc.

Referenced by ForkAndExecAsRoot(), KillCvmfs(), LazyUmount(), Mount(), Remount(), and Umount().

Here is the caller graph for this function:

static void ForkAndExecAsRoot ( const char *  binary,
const char *  arg1,
const char *  arg2,
const char *  arg3,
const char *  arg4 
)
static

Definition at line 64 of file cvmfs_suid_helper.cc.

Referenced by Mount().

Here is the call graph for this function:

Here is the caller graph for this function:

static void GetCredentials ( uid_t *  calling_uid,
uid_t *  effective_uid 
)
static

Definition at line 36 of file cvmfs_suid_helper.cc.

Referenced by main().

Here is the caller graph for this function:

static void KillCvmfs ( const string &  fqrn)
static

Definition at line 139 of file cvmfs_suid_helper.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void LazyUmount ( const string &  path)
static

Definition at line 135 of file cvmfs_suid_helper.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 295 of file cvmfs_suid_helper.cc.

Here is the call graph for this function:

static void Mount ( const string &  path)
static

Definition at line 105 of file cvmfs_suid_helper.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void Remount ( const string &  path,
const RemountType  how 
)
static

Definition at line 85 of file cvmfs_suid_helper.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void Umount ( const string &  path)
static

Definition at line 131 of file cvmfs_suid_helper.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void Usage ( const string &  exe,
FILE *  output 
)
static

Definition at line 285 of file cvmfs_suid_helper.cc.

Variable Documentation

const char* kSpoolArea = "/var/spool/cvmfs"