Logo ROOT  
Reference Guide
proofexecv.cxx File Reference
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <syslog.h>
#include <errno.h>
#include <pwd.h>
#include <ios>
#include <fstream>
#include <list>
#include <string>
#include <string.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <grp.h>
#include <dirent.h>
#include "Varargs.h"
#include "rpdconn.h"
#include "rpdpriv.h"
Include dependency graph for proofexecv.cxx:

Macros

#define kMAXPATHLEN   4096
 

Functions

int assertdir (const std::string &path, uid_t u, gid_t g, unsigned int mode)
 Make sure that 'path' exists, it is owned by the entity described by {u,g} and its mode is 'mode'. More...
 
int changeown (const std::string &path, uid_t u, gid_t g)
 Change the ownership of 'path' to the entity described by {u,g}. More...
 
int completercfile (const std::string &rcfile, const std::string &sessdir, const std::string &stag, const std::string &adminpath)
 Finalize the rc file with the missing pieces. More...
 
int exportsock (rpdunix *conn)
 Export the descriptor of 'conn' so that it can used in the execv application. More...
 
void Info (const char *va_(fmt),...)
 Write info message to syslog. More...
 
int loginuser (const std::string &home, const std::string &user, uid_t uid, gid_t gid)
 Login the user in its space. More...
 
int main (int argc, char **argv)
 Program executed via system starting proofserv instances. More...
 
int mvfile (const std::string &from, const std::string &to, uid_t u, gid_t g, unsigned int mode)
 Move file form 'from' to 'to', making sure that it is owned by the entity described by {u,g} and its mode is 'mode' (at the final destination). More...
 
int redirectoutput (const std::string &logfile)
 Redirect stdout to 'logfile' On success return 0. More...
 
int setownerships (int euid, const std::string &us, const std::string &gr, const std::string &creds, const std::string &dsrcs, const std::string &ddir, const std::string &ddiro, const std::string &ord, const std::string &stag)
 Set user ownerships on some critical files or directories. More...
 
int setproofservenv (const std::string &envfile, const std::string &logfile, const std::string &rcfile)
 Initialize the environment following the content of 'envfile'. More...
 
void start_ps (int argc, char **argv)
 Process a request to start a proofserv process. More...
 

Variables

static int gDebug = 0
 
static FILE * gLogger = 0
 
static int gType = 0
 

Macro Definition Documentation

◆ kMAXPATHLEN

#define kMAXPATHLEN   4096

Definition at line 47 of file proofexecv.cxx.

Function Documentation

◆ assertdir()

int assertdir ( const std::string &  path,
uid_t  u,
gid_t  g,
unsigned int  mode 
)

Make sure that 'path' exists, it is owned by the entity described by {u,g} and its mode is 'mode'.

Return 0 in case of success, -1 in case of error

Definition at line 414 of file proofexecv.cxx.

◆ changeown()

int changeown ( const std::string &  path,
uid_t  u,
gid_t  g 
)

Change the ownership of 'path' to the entity described by {u,g}.

If 'path' is a directory, go through the paths inside it recursively. Return 0 in case of success, -1 in case of error

Definition at line 738 of file proofexecv.cxx.

◆ completercfile()

int completercfile ( const std::string &  rcfile,
const std::string &  sessdir,
const std::string &  stag,
const std::string &  adminpath 
)

Finalize the rc file with the missing pieces.

Definition at line 479 of file proofexecv.cxx.

◆ exportsock()

int exportsock ( rpdunix *  conn)

Export the descriptor of 'conn' so that it can used in the execv application.

Make sure it duplicates to a reasonable value first. Return 0 on success, -1 on error

Definition at line 557 of file proofexecv.cxx.

◆ Info()

void Info ( const char *  va_fmt,
  ... 
)

Write info message to syslog.

Definition at line 69 of file proofexecv.cxx.

◆ loginuser()

int loginuser ( const std::string &  home,
const std::string &  user,
uid_t  u,
gid_t  g 
)

Login the user in its space.

Definition at line 365 of file proofexecv.cxx.

◆ main()

int main ( int  argc,
char **  argv 
)

Program executed via system starting proofserv instances.

It also performs other actions requiring a separate process, e.g. XrdProofAdmin file system requests.

Definition at line 89 of file proofexecv.cxx.

◆ mvfile()

int mvfile ( const std::string &  from,
const std::string &  to,
uid_t  u,
gid_t  g,
unsigned int  mode 
)

Move file form 'from' to 'to', making sure that it is owned by the entity described by {u,g} and its mode is 'mode' (at the final destination).

Return 0 in case of success, -1 in case of error

Definition at line 444 of file proofexecv.cxx.

◆ redirectoutput()

int redirectoutput ( const std::string &  logfile)

Redirect stdout to 'logfile' On success return 0.

Return -1 on failure.

Definition at line 602 of file proofexecv.cxx.

◆ setownerships()

int setownerships ( int  euid,
const std::string &  us,
const std::string &  gr,
const std::string &  creds,
const std::string &  dsrcs,
const std::string &  ddir,
const std::string &  ddiro,
const std::string &  ord,
const std::string &  stag 
)

Set user ownerships on some critical files or directories.

Return 0 on success, -1 if enything goes wrong.

Definition at line 647 of file proofexecv.cxx.

◆ setproofservenv()

int setproofservenv ( const std::string &  envfile,
const std::string &  logfile,
const std::string &  rcfile 
)

Initialize the environment following the content of 'envfile'.

Definition at line 506 of file proofexecv.cxx.

◆ start_ps()

void start_ps ( int  argc,
char **  argv 
)

Process a request to start a proofserv process.

Definition at line 124 of file proofexecv.cxx.

Variable Documentation

◆ gDebug

int gDebug = 0
static

Definition at line 44 of file proofexecv.cxx.

◆ gLogger

FILE* gLogger = 0
static

Definition at line 45 of file proofexecv.cxx.

◆ gType

int gType = 0
static

Definition at line 43 of file proofexecv.cxx.