Startup check if IOrules/fgValidatePath are working properly
This commit is contained in:
parent
220f359d34
commit
222f2f71ef
1 changed files with 24 additions and 0 deletions
|
@ -112,6 +112,7 @@
|
|||
#include "logger.hxx"
|
||||
#include "main.hxx"
|
||||
#include "positioninit.hxx"
|
||||
#include "util.hxx"
|
||||
|
||||
using std::string;
|
||||
using std::endl;
|
||||
|
@ -772,6 +773,29 @@ void fgPostInitSubsystems()
|
|||
nasal->init();
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Nasal init took:" << st.elapsedMSec());
|
||||
|
||||
// Ensure IOrules and path validation are working properly by trying to
|
||||
// access a folder/file which should never be accessible.
|
||||
const char* no_access_path =
|
||||
#ifdef _WIN32
|
||||
"Z:"
|
||||
#endif
|
||||
"/do-not-access";
|
||||
|
||||
if( fgValidatePath(no_access_path, true) )
|
||||
SG_LOG
|
||||
(
|
||||
SG_GENERAL,
|
||||
SG_ALERT,
|
||||
"Check your IOrules! (write to '" << no_access_path << "' is allowed)"
|
||||
);
|
||||
if( fgValidatePath(no_access_path, false) )
|
||||
SG_LOG
|
||||
(
|
||||
SG_GENERAL,
|
||||
SG_ALERT,
|
||||
"Check your IOrules! (read from '" << no_access_path << "' is allowed)"
|
||||
);
|
||||
|
||||
// initialize methods that depend on other subsystems.
|
||||
st.stamp();
|
||||
globals->get_subsystem_mgr()->postinit();
|
||||
|
|
Loading…
Reference in a new issue