48
50
class Application {
51
* Print message containing version information
53
void printAboutMessage();
56
* Checks wheter process has root privileges
57
* and calling user is webserver user
59
void checkProcessPermissions(Configuration& config)
60
throw (SecurityException, LookupException);
63
* Includes check for path, symbollink and permissions
65
void checkScriptFile(const std::string& scriptFilename,
66
const Configuration& config,
67
const Environment& environment) const
68
throw (SystemException, SoftException);
71
* Changes process permission (user and group).
72
* Uses preprocessor macros to distinguish between modes
74
void changeProcessPermissions(const std::string& scriptFilename,
75
const Configuration& config,
76
const Environment& environment) const
77
throw (SystemException, SoftException, SecurityException);
80
* Prepares the environment before invoking the script
82
Environment prepareEnvironment(const Environment& sourceEnv,
83
const Configuration& config,
85
throw (KeyNotFoundException);
88
* Returns interpreter for script being executed
90
std::string getInterpreter(const Environment& env,
91
const Configuration& config)
92
throw (SecurityException);
95
* Returns mode interpreter is using
97
TargetMode getTargetMode(const std::string& interpreter)
98
throw (SecurityException);
103
void executeScript(const std::string& scriptFilename,
104
const std::string& interpreter,
106
const Environment& env,
107
const Configuration& config) const
108
throw (SoftException);
53
* Print message containing version information
55
void printAboutMessage();
58
* Checks wheter process has root privileges
59
* and calling user is webserver user
61
void checkProcessPermissions(Configuration& config)
62
throw (SecurityException, LookupException);
65
* Checks scriptfile (first stage).
66
* Includes check for VHost docroot, symbollink and permissions.
68
void checkScriptFileStage1(const std::string& scriptFilename,
69
const Configuration& config,
70
const Environment& environment) const
71
throw (SystemException, SoftException);
75
* Includes check for paths which might be user specific
77
void checkScriptFileStage2(const std::string& scriptFilename,
78
const Configuration& config,
79
const Environment& environment,
80
const UserInfo& targetUser,
81
const GroupInfo& targetGroup) const
82
throw (SystemException, SoftException);
85
* Determines target user and group that is to be used for script execution.
86
* Uses preprocessor macros to distinguish between modes
88
void checkProcessPermissions(const std::string& scriptFilename,
89
const Configuration& config,
90
const Environment& environment,
92
GroupInfo& targetGroup) const
93
throw (SystemException, SoftException, SecurityException);
96
* Changes process permission (user and group).
97
* Uses preprocessor macros to distinguish between modes
99
void changeProcessPermissions(const Configuration& config,
100
const UserInfo& targetUser,
101
const GroupInfo& targetGroup) const
102
throw (SystemException, SoftException, SecurityException);
105
* Prepares the environment before invoking the script
107
Environment prepareEnvironment(const Environment& sourceEnv,
108
const Configuration& config,
110
throw (KeyNotFoundException);
113
* Returns interpreter for script being executed
115
std::string getInterpreter(const Environment& env,
116
const Configuration& config)
117
throw (SecurityException);
120
* Returns mode interpreter is using
122
TargetMode getTargetMode(const std::string& interpreter)
123
throw (SecurityException);
128
void executeScript(const std::string& scriptFilename,
129
const std::string& interpreter,
131
const Environment& env,
132
const Configuration& config) const
133
throw (SoftException);
136
* Checks ownership and permissions for parent directories
138
void checkParentDirectories(const File& file,
139
const UserInfo& owner,
140
const Configuration& config) const
141
throw (SoftException);
118
* Function called by the main() function
120
int run(CommandLine& cmdline, Environment& env);
151
* Function called by the main() function
153
int run(CommandLine& cmdline, Environment& env);