Explorar o código

Merge branch 'candidate-7.2.0' into candidate-7.2.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=6) %!d(string=hai) anos
pai
achega
d326a5c952
Modificáronse 3 ficheiros con 11 adicións e 2 borrados
  1. 1 0
      dali/ft/dalift.cmake
  2. 1 0
      fs/dafsclient/rmtfile.cpp
  3. 9 2
      system/globalid/lnuid.cpp

+ 1 - 0
dali/ft/dalift.cmake

@@ -36,6 +36,7 @@ set (    SRCS
     )
 
 include_directories ( 
+         ./../../common/remote 
          ./../../fs/dafsclient
          ./../../system/mp 
          ./../base 

+ 1 - 0
fs/dafsclient/rmtfile.cpp

@@ -15,6 +15,7 @@
     limitations under the License.
 ############################################################################## */
 
+#include <string>
 #include <unordered_map>
 
 #include "platform.h"

+ 9 - 2
system/globalid/lnuid.cpp

@@ -40,6 +40,8 @@
 #include <sstream>
 #include <ctime>
 #include "lnuid.h"
+#include "jlog.hpp"
+
 using namespace std;
 
 namespace ln_uid {
@@ -87,8 +89,13 @@ namespace ln_uid {
 #if defined(__linux__) || defined(__APPLE__)
         FILE *fp;
         fp = fopen("/dev/urandom", "r");
-        fread(&randomdata, 1, random_byte_count, fp);
-        fclose(fp);
+        if (!fp || fread(&randomdata, 1, random_byte_count, fp) != random_byte_count)
+        {
+            // Should never happen, but if it does log it and ignore
+            OERRLOG("Could not read data from /dev/urandom");
+        }
+        if (fp)
+            fclose(fp);
 #elif _WIN32
         HCRYPTPROV hProvider;