From b848d4f9c8859ad2d37c9523759366d9b24f0464 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 14 Nov 2011 13:06:51 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ ext/openssl/ossl_pkey.c | 1 + ext/openssl/ossl_x509cert.c | 1 + 3 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index b9d1f32911..e529101120 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Nov 14 22:06:02 2011 Tanaka Akira + + * 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 * bignum.c (rb_big2ull): fix 32bit platform breakage. we must diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c index cb0c320a0c..15a2eed8d2 100644 --- a/ext/openssl/ossl_pkey.c +++ b/ext/openssl/ossl_pkey.c @@ -111,6 +111,7 @@ ossl_pkey_new_from_file(VALUE filename) 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); diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c index b71025e145..3093d60f1f 100644 --- a/ext/openssl/ossl_x509cert.c +++ b/ext/openssl/ossl_x509cert.c @@ -66,6 +66,7 @@ ossl_x509_new_from_file(VALUE filename) 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...