Review 14.3 Merged

93818[BUGFIX] Avoid mangled auto-gen install tool pw output

Christian Kuhn CR +2 V +2 Easy +9 −1 updated 04/23/26, 09:10

Commit message

Stumbled upon this by looking at flaky functional test
PasswordSetCommandTest::autogeneratedPasswordRespectsConfiguredLength
This one and some friends have a low percentage failure rate.

Turns out this is not a test issue:

> bin/typo3 install:password:set

with either `--no-interaction` or on <enter> when the
password should be typed in will auto-generate the
password and output it.

The auto generated password can contain '<', '>' or '\' since
special characters are part of the default installTool password
policy. The command wraps the password in '<info>...</info>' and
lets Symfony's OutputFormatter render it. That formatter ends
format() with a strtr() that unescapes '\<' to '<' and '\>' to '>',
silently dropping the backslash, and a password ending in '\'
additionally prevents the closing '</info>' tag from being
recognised.

As a result, the password shown on screen differs from the
password actually hashed and stored in settings.php -> The
user cannot log in with what they just copied from the
terminal. Yay.

Luckily, the test checking for correct length of generated
passwords then fails.

The patch emits the password via OutputInterface::OUTPUT_RAW
so it bypasses the formatter entirely, and applies the 'info'
style manually when decoration is enabled, so terminals still
show the green highlight.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
  • Verified V +2 Done
    • Christian Kuhn +2
    • core-ci +1 CI

Issues 2

Files 1

Review log 34

  1. Christian Kuhn uploaded patch set 1 04/23/26, 08:49

  2. core-ci voted on patch set 1 V +1 04/23/26, 09:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101007

  3. Christian Kuhn voted on patch set 1 CR +2 V +2 04/23/26, 09:10

  4. Christian Kuhn merged patch set 2 04/23/26, 09:10