Consistenty - `IOError` vs `EBADF`?
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- ruby
- 領域
- networking, security
調査の方向性
まず、Socket.pair と OpenSSL::SSL::SSLSocket を使用して、提供された Ruby の再現コードを実行し、close 後の通常の IO と動作を比較します。両方の sync_close 設定を調査し、close-then-read によって一貫したエラー動作がハングせずに発生することを done と定義します。
索引モデルが issue の本文から書いたものです。
説明
SSLSocket error conditions are not consistent with IO.
io.closefollowed byio.readcan result inEBADFrather thanIOError.- Without
sync_close,io.closefollowed byio.readwill hang. Even if the underlying IO is not closed, I don't think theSSLSocketinstance should continue to work after being closed?
Reproduction:
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'localhost'
end
require 'socket'
require 'openssl'
require 'localhost'
def read_after_close(io)
io.close
io.read
end
begin
client, server = Socket.pair(:UNIX, :STREAM)
read_after_close(client)
rescue => error
$stderr.puts error.full_message
end
begin
authority = Localhost::Authority.fetch
client, server = Socket.pair(:UNIX, :STREAM)
ssl_server = OpenSSL::SSL::SSLSocket.new(server, authority.server_context)
ssl_server.sync_close = true
ssl_client = OpenSSL::SSL::SSLSocket.new(client, authority.client_context)
ssl_client.sync_close = true # If this is not set, `io.read` above will hang which is also a bit odd.
Thread.new{ssl_server.accept}
ssl_client.connect
read_after_close(ssl_client)
rescue => error
$stderr.puts error.full_message
end
Is this something we can improve?
- 主要言語
- C
- スター
- 276
- フォーク
- 208
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ruby/openssl のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
ruby/openssl#1163 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
SSLSocket#syswrite no longer raises IOError after IO#close対応中かも @sourya2704 が 4 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
Add OpenSSL::SSL::SSLContext#client_hello_cb= (binding for SSL_CTX_set_client_hello_cb())対応中かも @kou が 46 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 53/100
ruby/openssl#1125 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
Documenting how to use OpenSSL::SSL::SSLContext in PQC use cases対応中かも @junaruga が 32 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
ruby/openssl#1118 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
Expose XOFs like SHAKE128 and SHAKE256対応中かも @rhenium が 142 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
ruby/openssl#1082 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Polprzewodnikowy/N64FlashcartMenu#486 · コメント 3 件 ·
-
docs: EigenLua is labelled private in docs/CI.md and consumer_acceptance.sh, but the repo is publicオープンarea:docs kind:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
InauguralSystems/EigenScript#2602 ·
メンテナーはふだん 1 日以内に返信
-
category:port-update
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 2 日以内に返信