GenCode - Ensure separate temp dirs on multi-user system
authorTim Otten <totten@civicrm.org>
Thu, 20 Feb 2014 23:46:14 +0000 (15:46 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 20 Feb 2014 23:46:14 +0000 (15:46 -0800)
CRM/Core/CodeGen/Util/File.php

index cb5f4f2c2dc8ce22734c4511ee93b215db22fab6..81ee570ef5bd7ac6de8390950a0bd0925104520e 100644 (file)
@@ -23,6 +23,9 @@ class CRM_Core_CodeGen_Util_File {
     }
 
     $newTempDir = $tempDir . '/' . $prefix . rand(1, 10000);
+    if (function_exists('posix_geteuid')) {
+      $newTempDir .= '_' . posix_geteuid();
+    }
 
     if (file_exists($newTempDir)) {
       self::removeDir($newTempDir);