[前][次][番号順一覧][スレッド一覧]

ruby-changes:21700

From: akr <ko1@a...>
Date: Mon, 14 Nov 2011 22:07:01 +0900 (JST)
Subject: [ruby-changes:21700] akr:r33749 (trunk): * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_file): set close-on-exec

akr	2011-11-14 22:06:51 +0900 (Mon, 14 Nov 2011)

  New Revision: 33749

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33749

  Log:
    * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_file): set close-on-exec
      flag.
    
    * ext/openssl/ossl_x509cert.c (rb_fd_fix_cloexec): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/ext/openssl/ossl_pkey.c
    trunk/ext/openssl/ossl_x509cert.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33748)
+++ ChangeLog	(revision 33749)
@@ -1,3 +1,10 @@
+Mon Nov 14 22:06:02 2011  Tanaka Akira  <akr@f...>
+
+	* ext/openssl/ossl_pkey.c (ossl_pkey_new_from_file): set close-on-exec
+	  flag.
+
+	* ext/openssl/ossl_x509cert.c (rb_fd_fix_cloexec): ditto.
+
 Mon Nov 14 14:54:17 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* bignum.c (rb_big2ull): fix 32bit platform breakage. we must
Index: ext/openssl/ossl_pkey.c
===================================================================
--- ext/openssl/ossl_pkey.c	(revision 33748)
+++ ext/openssl/ossl_pkey.c	(revision 33749)
@@ -111,6 +111,7 @@
     if (!(fp = fopen(RSTRING_PTR(filename), "r"))) {
 	ossl_raise(ePKeyError, "%s", strerror(errno));
     }
+    rb_fd_fix_cloexec(fileno(fp));
 
     pkey = PEM_read_PrivateKey(fp, NULL, ossl_pem_passwd_cb, NULL);
     fclose(fp);
Index: ext/openssl/ossl_x509cert.c
===================================================================
--- ext/openssl/ossl_x509cert.c	(revision 33748)
+++ ext/openssl/ossl_x509cert.c	(revision 33749)
@@ -66,6 +66,7 @@
     if (!(fp = fopen(RSTRING_PTR(filename), "r"))) {
 	ossl_raise(eX509CertError, "%s", strerror(errno));
     }
+    rb_fd_fix_cloexec(fileno(fp));
     x509 = PEM_read_X509(fp, NULL, NULL, NULL);
     /*
      * prepare for DER...

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]