From 00760b736e4fa6355ce44eb79e8f990724ba4a8b Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 26 May 2011 12:09:22 +0100 Subject: [PATCH] ENH: dynamicCode.C: check for permission even when restarting --- .../dynamicLibrary/dynamicCode/dynamicCode.C | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C b/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C index 78b696fa5a..327fd56eee 100644 --- a/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C +++ b/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C @@ -71,6 +71,27 @@ void Foam::dynamicCode::checkSecurity << "using dlopen)" << exit(FatalIOError); } + + if (!allowSystemOperations) + { + FatalIOErrorIn + ( + title, + dict + ) << "Loading a shared library using case-supplied code is not" + << " enabled by default" << nl + << "because of security issues. If you trust the code you can" + << " enable this" << nl + << "facility be adding to the InfoSwitches setting in the system" + << " controlDict:" << nl << nl + << " allowSystemOperations 1" << nl << nl + << "The system controlDict is either" << nl << nl + << " ~/.OpenFOAM/$WM_PROJECT_VERSION/controlDict" << nl << nl + << "or" << nl << nl + << " $WM_PROJECT_DIR/etc/controlDict" << nl + << endl + << exit(FatalIOError); + } } @@ -400,26 +421,6 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const Info<< "Creating new library in " << this->libRelPath() << endl; } - if (!allowSystemOperations) - { - FatalErrorIn - ( - "dynamicCode::copyOrCreateFiles() const" - ) << "Loading a shared library using case-supplied code is not" - << " enabled by default" << nl - << "because of security issues. If you trust the code you can" - << " enable this" << nl - << "facility be adding to the InfoSwitches setting in the system" - << " controlDict:" << nl << nl - << " allowSystemOperations 1" << nl << nl - << "The system controlDict is either" << nl << nl - << " ~/.OpenFOAM/$WM_PROJECT_VERSION/controlDict" << nl << nl - << "or" << nl << nl - << " $WM_PROJECT_DIR/etc/controlDict" << nl - << endl - << exit(FatalError); - } - const label nFiles = compileFiles_.size() + copyFiles_.size(); DynamicList resolvedFiles(nFiles);