Review 9.5 Abandoned

65813[BUGFIX] Remove pre-checks on "transport_spool_filepath"

Daniel Goerz CR 0 V 0 Easy +2 −2 updated 10/09/20, 06:57

Commit message

FileSpool uses GeneralUtility::mkdir_deep() if path does not exist.
mkdir_deep() also tries to fix permissions.
Even if this fails, there are further writable-checks down the line
in \TYPO3\CMS\Core\Mail\FileSpool constructor.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 89

  1. Daniel Goerz commented on patch set 1 09/21/20, 12:35

    Cherry Picked from branch master.
  2. TYPO3com voted on patch set 1 V +1 09/21/20, 12:51 Completed build in 15m 50s on Mon, 21 Sep, 12:51 PM Test Summary: 75192 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-810

  3. Daniel Goerz voted on patch set 1 V +2 CR +2 09/21/20, 12:52

  4. Daniel Goerz voted on patch set 1 V 0 CR 0 09/21/20, 12:53

  5. Daniel Goerz commented on patch set 1 09/21/20, 12:55

    I just realized, in 9 we create an instance of Swift_FileSpool, which of course does not call mkdir_deep(). However, some basic checks are done nevertheless, so I guess patch is fine here, too. But one more pair of eyes please. Swift_FileSpool constructor: if (!file_exists($this->_path)) { if (!mkdir($this->_path, 0777, true)) { throw new Swift_IoException(sprintf('Unable to create path "%s".', $this->_path)); } }
  6. Markus Gerdes commented on patch set 1 V +1 CR +1 09/29/20, 16:01

    Swift_MailSpool takes care of the write permission, so should be ok.
  7. Daniel Goerz abandoned the change 10/08/20, 13:37

    Not a priority bugfix and not without risk
  8. Ingo Fabbri commented on patch set 1 10/08/20, 22:00

    LOL Swift_FileSpool calls mkdir() with recursive flag. This is the official php-world equivalent of the self-baked GeneralUtility::mkdir_deep() (but I have to admit: without the permission fixes). If mkdir() would fail there in the constructor, it raises a Swift_Io Exception. So nothing wrong here. But hey, stay with the current state, where we EARLY EXIT with an exception: "oooops, the directory does not exit. I will not create it dear user - JUST PANIC AND throw this exception."
  9. Daniel Goerz commented on patch set 1 10/09/20, 06:57

    > Patch Set 1: > > LOL > > Swift_FileSpool calls mkdir() with recursive flag. This is the official php-world equivalent of the self-baked GeneralUtility::mkdir_deep() (but I have to admit: without the permission fixes). If mkdir() would fail there in the constructor, it raises a Swift_Io Exception. So nothing wrong here. But hey, stay with the current state, where we EARLY EXIT with an exception: "oooops, the directory does not exit. I will not create it dear user - JUST PANIC AND throw this exception." That sure is one way of expressing disagreement. How about a more respectful tone?