summaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkey.c
diff options
context:
space:
mode:
authorakr <akr@ruby-lang.org>2011-11-14 13:06:51 +0000
committerakr <akr@ruby-lang.org>2011-11-14 13:06:51 +0000
commit191d2bb1ec279f00fddbd3efea542b480cb08201 (patch)
tree1689c714c00747f84a1397de8c0ce33631684d55 /ext/openssl/ossl_pkey.c
parent362edf5cd8ff6cca917243252532577d751e5768 (diff)
downloadruby-openssl-history-191d2bb1ec279f00fddbd3efea542b480cb08201.tar.gz
* 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
Diffstat (limited to 'ext/openssl/ossl_pkey.c')
-rw-r--r--ext/openssl/ossl_pkey.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c
index cb0c320..15a2eed 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);