user create --password-stdin keeps a byte order mark as part of the password

オープン 初心者向け
#3,621 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
cli

調査の方向性

ConsoleCommandInput.ReadLineAsync から始めます。これは Console.In を読み取り、レポートではマークが残る場所として挙げられています。また、src/FluentCMS.Host 配下の user create と user reset-password --password-stdin の経路にあるその呼び出し元も確認します。BOM を先頭に付けた行をコマンドにパイプして再現し、次にリダイレクトされた入力から読み取った最初の行の先頭にある U+FEFF を除去し、残りを UTF-8 としてデコードします。完了とは、BOM 付きのパイプでサインインでき、既存のホストコマンドのテストが引き続き通ることであり、BOM のケースをカバーするテストを追加します。

索引モデルが issue の本文から書いたものです。

説明

area:identity type:bug

What happens

On Windows, a password piped from PowerShell to fluentcms user create --password-stdin (or user reset-password --password-stdin) is stored with a byte order mark in front of it, so the user cannot sign in with the password that was piped:

"YourPassword123!" | dotnet run --no-build --project src/FluentCMS.Host -- fluentcms user create --email [email protected] --role "Super Admin" --password-stdin

The command reports success, and the sign-in page then answers "Sign-in failed" for that address and password. The same command fed from a pipe without a byte order mark (cmd, bash) signs in.

Why

PowerShell can write a UTF-8 byte order mark before what it pipes to a native command. ConsoleCommandInput.ReadLineAsync reads Console.In, which does not drop it, so the first line of standard input is the mark followed by the password.

Expected

A byte order mark at the start of redirected standard input is not part of the first line, and what follows it is read as UTF-8.

主要言語
C#
スター
567
フォーク
107
平均マージ
2時間 35分
マージ済み PR(30日)
425

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fluentcms/FluentCMS のほかの issue

fluentcms/FluentCMS の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。