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: https://github.com/haskell/cabal/issues/6268 (cherry picked from commit 95f48ad7) # Conflicts: # cabal-install/src/Distribution/Client/Setup.hs # cabal-install/src/Distribution/Deprecated/ParseUtils.hs
Showing
- cabal-install/src/Distribution/Client/Setup.hs 82 additions, 0 deletionscabal-install/src/Distribution/Client/Setup.hs
- cabal-install/src/Distribution/Deprecated/ParseUtils.hs 40 additions, 0 deletionscabal-install/src/Distribution/Deprecated/ParseUtils.hs
- cabal-testsuite/PackageTests/UserConfig/cabal.out 3 additions, 0 deletionscabal-testsuite/PackageTests/UserConfig/cabal.out
- cabal-testsuite/PackageTests/UserConfig/cabal.test.hs 6 additions, 0 deletionscabal-testsuite/PackageTests/UserConfig/cabal.test.hs
- changelog.d/issue-6268 19 additions, 0 deletionschangelog.d/issue-6268
- doc/cabal-commands.rst 13 additions, 1 deletiondoc/cabal-commands.rst
Loading
Please register or sign in to comment