stable

Clone or download

Read-only

fix: whitelist not taken into account when list is too big

When I try to add content in a whitelisted folder in subversion, If the white list is too big (more than thousands of characters, depends on the content), Then the commit is denied. Immutable tags paths: * `/tags` Global whitelist: * `/tags/v1` * …lot of lines… Expectations (svn status): * Allowed: `A tags/v1/file` * Forbidden: `A tags/v2/file` Currently both are forbidden. This comes from preg_match/pcre that has some limit in the accepted pattern. It raises a warning if this limit is exceeded and does not perform the match. Since we are in a pre-commit hook, the warning is not visible and the pre-commit is declined. In order to mitigate the risk of exceeding the limit, we substitute the regexp alternation `|` by a `foreach()`. The performance shouldn't be too much degraded in regular situations. While investigating on the issue we noticed that the whitelist (that can be updated by REST) is stored in a TEXT that don't have infinite storage. If users are putting too much in the whitelist, then they may loose data. We will provide a solution for that in another patch. Fix request #23820: whitelist not taken into account when list is too big Change-Id: I201cbf23d3edd2d0d2d68f9edc4fd3c9865afec3

Modified Files

Name
M plugins/svn/include/SVN/Commit/ImmutableTagCommitValidator.php +12 −8 Go to diff View file
M plugins/svn/tests/unit/SVN/Commit/ImmutableTagCommitValidatorTest.php +108 −11 Go to diff View file