-
Notifications
You must be signed in to change notification settings - Fork 698
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing of password-command option (#6268)
The password-command option does not parse its value correctly. Quotes are ignored, making many kinds of commands impossible to express (e.g. `sh -c "foo | bar"`). Also, `cabal user-config` treats the argument list as a *list of option values*, rather than a *value that is a list*. As a consequence, `cabal user-config update` corrupts the value in the config file. Fix these issues by parsing the command as a space separated list of tokens, and changing the getter to `unwords` the value and return a *singleton* list. Also update the argument placeholder from `PASSWORD` to `COMMAND`. Fixes: #6268 (cherry picked from commit 95f48ad) # Conflicts: # cabal-install/src/Distribution/Client/Setup.hs # cabal-install/src/Distribution/Deprecated/ParseUtils.hs
- Loading branch information
1 parent
5d86771
commit e08b465
Showing
6 changed files
with
163 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
synopsis: Fix parsing of password-command option | ||
packages: cabal-install | ||
prs: #9002 | ||
issuesa: #6268 | ||
|
||
description: { | ||
|
||
The password-command option did not parse its value correctly. | ||
Quotes were ignored, making many kinds of commands impossible to | ||
express (e.g. `sh -c "foo | bar"`). Also, `cabal user-config` | ||
treated the argument list as a *list of option values*, rather than a | ||
*value that is a list*. As a consequence, `cabal user-config | ||
update` corrupted the value in the config file. | ||
|
||
Fixed these issues by parsing the command as a space separated list | ||
of tokens (which may be enclosed in double quotes), and treating the | ||
parsed list-of-token as one value (not multiple). | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters