- /**
- * Print message containing version information
- */
- void printAboutMessage();
-
- /**
- * Checks wheter process has root privileges
- * and calling user is webserver user
- */
- void checkProcessPermissions(Configuration& config)
- throw (SecurityException, LookupException);
- /**
- * Checks scriptfile.
- * Includes check for path, symbollink and permissions
- */
- void checkScriptFile(const std::string& scriptFilename,
- const Configuration& config,
- const Environment& environment) const
- throw (SystemException, SoftException);
-
- /**
- * Changes process permission (user and group).
- * Uses preprocessor macros to distinguish between modes
- */
- void changeProcessPermissions(const std::string& scriptFilename,
- const Configuration& config,
- const Environment& environment) const
- throw (SystemException, SoftException, SecurityException);
-
- /**
- * Prepares the environment before invoking the script
- */
- Environment prepareEnvironment(const Environment& sourceEnv,
- const Configuration& config,
- TargetMode mode)
- throw (KeyNotFoundException);
-
- /**
- * Returns interpreter for script being executed
- */
- std::string getInterpreter(const Environment& env,
- const Configuration& config)
- throw (SecurityException);
-
- /**
- * Returns mode interpreter is using
- */
- TargetMode getTargetMode(const std::string& interpreter)
- throw (SecurityException);
-
- /**
- * Runs script
- */
- void executeScript(const std::string& scriptFilename,
- const std::string& interpreter,
- TargetMode mode,
- const Environment& env,
- const Configuration& config) const
- throw (SoftException);
+ /**
+ * Print message containing version information
+ */
+ void printAboutMessage();
+
+ /**
+ * Checks wheter process has root privileges
+ * and calling user is webserver user
+ */
+ void checkProcessPermissions(Configuration& config)
+ throw (SecurityException, LookupException);
+
+ /**
+ * Checks scriptfile (first stage).
+ * Includes check for VHost docroot, symbollink and permissions.
+ */
+ void checkScriptFileStage1(const std::string& scriptFilename,
+ const Configuration& config,
+ const Environment& environment) const
+ throw (SystemException, SoftException);
+
+ /**
+ * Checks scriptfile.
+ * Includes check for paths which might be user specific
+ */
+ void checkScriptFileStage2(const std::string& scriptFilename,
+ const Configuration& config,
+ const Environment& environment,
+ const UserInfo& targetUser,
+ const GroupInfo& targetGroup) const
+ throw (SystemException, SoftException);
+
+ /**
+ * Determines target user and group that is to be used for script execution.
+ * Uses preprocessor macros to distinguish between modes
+ */
+ void checkProcessPermissions(const std::string& scriptFilename,
+ const Configuration& config,
+ const Environment& environment,
+ UserInfo& targetUser,
+ GroupInfo& targetGroup) const
+ throw (SystemException, SoftException, SecurityException);
+
+ /**
+ * Changes process permission (user and group).
+ * Uses preprocessor macros to distinguish between modes
+ */
+ void changeProcessPermissions(const Configuration& config,
+ const UserInfo& targetUser,
+ const GroupInfo& targetGroup) const
+ throw (SystemException, SoftException, SecurityException);
+
+ /**
+ * Prepares the environment before invoking the script
+ */
+ Environment prepareEnvironment(const Environment& sourceEnv,
+ const Configuration& config,
+ TargetMode mode)
+ throw (KeyNotFoundException);
+
+ /**
+ * Returns interpreter for script being executed
+ */
+ std::string getInterpreter(const Environment& env,
+ const Configuration& config)
+ throw (SecurityException);
+
+ /**
+ * Returns mode interpreter is using
+ */
+ TargetMode getTargetMode(const std::string& interpreter)
+ throw (SecurityException);
+
+ /**
+ * Runs script
+ */
+ void executeScript(const std::string& scriptFilename,
+ const std::string& interpreter,
+ TargetMode mode,
+ const Environment& env,
+ const Configuration& config) const
+ throw (SoftException);
+
+ /**
+ * Checks ownership and permissions for parent directories
+ */
+ void checkParentDirectories(const File& file,
+ const UserInfo& owner,
+ const Configuration& config) const
+ throw (SoftException);