]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/auth/Crypto.cc
update sources to 12.2.10
[ceph.git] / ceph / src / auth / Crypto.cc
index 0186b7b2255d670a218a8883751472164be403b9..150052bfef1710840ff2cee09d704c8333013836 100644 (file)
@@ -12,6 +12,9 @@
  */
 
 #include <sstream>
+#include <limits>
+#include <fcntl.h>
+
 #include "Crypto.h"
 #ifdef USE_CRYPTOPP
 # include <cryptopp/modes.h>
@@ -37,7 +40,7 @@
 
 int get_random_bytes(char *buf, int len)
 {
-  int fd = TEMP_FAILURE_RETRY(::open("/dev/urandom", O_RDONLY));
+  int fd = TEMP_FAILURE_RETRY(::open("/dev/urandom", O_RDONLY|O_CLOEXEC));
   if (fd < 0)
     return -errno;
   int ret = safe_read_exact(fd, buf, len);