]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Allow usage of localhost resource by different users (fix EDF issue #10699)
authorRenaud Barate <renaud.barate@edf.fr>
Wed, 27 May 2015 07:26:04 +0000 (09:26 +0200)
committerRenaud Barate <renaud.barate@edf.fr>
Wed, 27 May 2015 07:26:04 +0000 (09:26 +0200)
localhost resource working directory now contains user name to avoid access problems.
localhost resource working directory uses TMPDIR env var to get the base directory.

src/ResourcesManager/ResourcesManager.cxx

index c90c6019d095517e19b2c59259f1c66c526e8167..0ddc3a8f1d7674c7df9cfd376f1fb94008107c18 100644 (file)
@@ -603,7 +603,12 @@ void ResourcesManager_cpp::AddDefaultResourceInCatalog()
   {
     resource.AppliPath = string(getenv("HOME")) + "/" + getenv("APPLI");
   }
-  resource.working_directory = "/tmp/salome_localres_workdir";
+  string tmpdir = "/tmp";
+  if (getenv("TMPDIR") != NULL)
+    tmpdir = getenv("TMPDIR");
+  resource.working_directory = tmpdir + "/salome_localres_workdir";
+  if (getenv("USER") != NULL)
+    resource.working_directory += string("_") + getenv("USER");
   resource.can_launch_batch_jobs = true;
   resource.can_run_containers = true;
   _resourcesList[resource.Name] = resource;