Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

cf login doesn't work properly when password specified with mutliple special characters.

オープン
#3,399 コメント 1 件 リアクション 4 件 担当者 0 名 GitHub で見る

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go
領域
cli

調査の方向性

cf login コマンドのエントリポイントから始め、例のパスワードを使って報告されたコマンドを再現し、対話型ログインと比較する。-p 引数がハイフンで始まる場合や特殊文字を含む場合にどのように解析されるかを確認する。非対話型ログインが、示されている flag エラーなしで文書化されたパスワードのケースを受け付ければ完了とする。

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

説明

Please fill out the issue checklist below and provide ALL the requested information.

  • [ x] I reviewed open and closed github issues that may be related to my problem.
  • [ x] I tried updating to the latest version of the CF CLI to see if it fixed my problem.
  • I attempted to run the command with CF_TRACE=1 to help debug the issue.
  • I am reporting a bug that others will be able to reproduce.

Describe the bug and the command you saw an issue with
Command CF login
I have an application that calls cf cli internally.
I run cf login -u username -p password
When the password has special characters , cf login fails.
For eg.,
for demo purpose let's say imaginary password "-ig@ZlHDVZl_"

cf login -o myOrg -s mySpace -u devUser1 -p "-ig@ZlHDVZl_"

What happened
It throws following error

Incorrect Usage: expected argument for flag `-p', but got option `-ig@ZlHDVZl_'

NAME:
   login - Log user in

This error seems to differ for different passwords. Escaping the characters didn't work as well.
But the same password works via interactive cf login.

Expected behavior
cf login should work via -u and -p options when password has special characters

Exact Steps To Reproduce
Steps to reproduce the behavior; include the exact CLI commands and verbose output:

  1. Run cf login -u username -p password with plenty of special characters in password especially "?" and "$_"
  2. See error
  3. Run interactive cf login and enter username and password on prompt, don't see error.

Provide more context

  • platform and shell details ( e.g. Mac OS 14.2 Built in terminal)
  • version of the CLI you are running : 8.9.0+c23186c.2024-12-02
  • version of the CC API Release you are on 3.186.0

What could be the reason for this behaviour? Do you have any recommendations on special characters in passwords when used directly in shell command?

主要言語
Go
スター
1.9k
フォーク
990
平均マージ
1日 7時間
マージ済み PR(30日)
8

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

cloudfoundry/cli のほかの issue

cloudfoundry/cli の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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