Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
現象
sign コマンドで失敗した場合にも
*.sig
ファイルが作成されてしまう(終了ステータスコードは正しく失敗扱いとなっている)
参考:
*.sig
ファイルが作成されてしまう #34 「sign コマンドで失敗しても *.sig ファイルが作成されてしまう」調査と対策方法
現状のソースでは、署名ファイルを標準出力に出力し、リダイレクトでファイルに保存している。
リダイレクトしているため必ずファイルが生成されている可能性があると思われるため、別の方法を検証する。
具体的には
-out 署名ファイル
で実行して署名失敗した場合に、署名ファイルが出力されるか確認する。調査の結果、出力先を
-out 署名ファイル
で指定して署名に失敗した場合でも、リダイレクトの場合と同様に署名ファイルが出力されることがわかった。そのため署名ファイルの出力方法は現状通り(リダイレクト)で、署名失敗時にファイルを削除する方法で対策をする。
手順
sign
コマンドを修正