Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug? check の標準エラー出力のリダイレクト先がおかしい気がします #10

Closed
yoshi389111 opened this issue May 25, 2021 · 1 comment · Fixed by #11
Labels
bug Something isn't working

Comments

@yoshi389111
Copy link
Collaborator

check コマンドに以下のような記述があります。

RESULT=`enc ${USERNAME} ${PATHFILE} 2>$1`
RESULT=`dec ${SECRETKEY} ${PATHFILE}.enc ${PATHFILE}.dec 2>$1`

このコマンドの場合、第一引数 $1 はgithubのユーザー名なので、ユーザー名のファイルに標準エラー出力が出力されてしまいます。

おそらく 2>&1 (標準出力と合わせる)あるいは 2>&- (標準エラー出力を閉じる)のどちらかが正しいのではないかと思います。
(個人的には、削除して画面に出力してもよい気がしますが)

@KEINOS
Copy link
Member

KEINOS commented May 25, 2021

あー!!これはバグですね。2>&1 です。

これは、出力ファイルをログ代わりにする意図がありました。

コンソール上だとエラーを見逃したユーザの対応が面倒なのと、ファイルの中身を教えてもらえば少なくとも内容がわかる、という感じを想定していました。

「なんか知らないファイルができている」という問い合わせをもらったことがあるのですが、 enc ファイルのことだと思っていました。もしかすると、このユーザ名のファイルのことだったのかもしれません。

やはりテストが必要だなー。ご報告ありがとうございます!

KEINOS pushed a commit that referenced this issue May 25, 2021
KEINOS pushed a commit that referenced this issue May 29, 2021
* doc:  add doc OPENSSH_PRIVATE_KEY.md
* doc: パスフレーズの注意書きを追加
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants