From: rnv Date: Wed, 22 Sep 2010 11:00:25 +0000 (+0000) Subject: Fix for the bug 21939: WinTC5.1.4: Crash of Yacs at preparing the scheme X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=648968250570c3e52e3c23f5aaabf9477ddef45f;p=modules%2Fkernel.git Fix for the bug 21939: WinTC5.1.4: Crash of Yacs at preparing the scheme --- diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 497e0c1ed..729a19e9b 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -406,7 +406,9 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param #ifdef WNT std::string logFilename=getenv("TEMP"); logFilename += "\\"; + std::string user = getenv( "USERNAME" ); #else + std::string user = getenv( "USER" ); std::string logFilename="/tmp"; char* val = getenv("SALOME_TMP_DIR"); if(val) @@ -419,7 +421,7 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param } logFilename += "/"; #endif - logFilename += _NS->ContainerName(params)+"_"+ resource_selected +"_"+getenv( "USER" ) ; + logFilename += _NS->ContainerName(params)+"_"+ resource_selected +"_"+user; std::ostringstream tmp; tmp << "_" << getpid(); logFilename += tmp.str(); @@ -469,7 +471,7 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param // Setting log file name logFilename=":"+logFilename; logFilename="@"+Kernel_Utils::GetHostname()+logFilename; - logFilename=getenv( "USER" )+logFilename; + logFilename=user+logFilename; ret->logfilename(logFilename.c_str()); RmTmpFile(_TmpFileName); // command file can be removed here } diff --git a/src/Utils/Utils_Identity.py b/src/Utils/Utils_Identity.py index f7a9af420..e55406a31 100644 --- a/src/Utils/Utils_Identity.py +++ b/src/Utils/Utils_Identity.py @@ -59,7 +59,7 @@ class Identity: self._adip = socket.gethostbyname(self._machine) # IP adress if sys.platform == "win32": self._uid = os.getpid() - self._pwname = os.environ["USER"] + self._pwname = os.environ["USERNAME"] else: self._uid = os.getuid() list = pwd.getpwuid(self._uid)