Paranoia: set close-on-exec flag for seed file.
authormdw <mdw>
Thu, 18 Jun 1998 15:08:49 +0000 (15:08 +0000)
committermdw <mdw>
Thu, 18 Jun 1998 15:08:49 +0000 (15:08 +0000)
src/crypt.c

index 1c400aa..549e94b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: crypt.c,v 1.4 1998/01/12 16:45:55 mdw Exp $
+ * $Id: crypt.c,v 1.5 1998/06/18 15:08:49 mdw Exp $
  *
  * Cryptographic transfer of `become' requests
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------*
  *
  * $Log: crypt.c,v $
+ * Revision 1.5  1998/06/18 15:08:49  mdw
+ * Paranoia: set close-on-exec flag for seed file.
+ *
  * Revision 1.4  1998/01/12 16:45:55  mdw
  * Fix copyright date.
  *
@@ -116,6 +119,10 @@ static void crypt__sessionKey(const char *seedfile, unsigned char *k,
       die("can't create random number file: %s", strerror(errno));
     rand_clear();
   }
+  if (fcntl(fileno(fp), F_SETFD, 1) < 0) {
+    die("can't set close-on-exec for random number file: %s",
+       strerror(errno));
+  }
 
   /* --- Lock the seed file against concurrency problems --- */