Review main Merged

22923[BUGFIX] Files with unclean path indexed multiple times

Steffen Ritter CR +2 V +2 Normal +234 −15 updated 08/20/13, 19:56

Commit message

When adding a file or requesting a file by an identifier
cleanup any . and .. in the path before handing off
to the driver so files are not indexed multiple times.

Review

  • Code review CR +2
    • Stefan Neufeind +2
    • Wouter Wolters +1
    • Helmut Hummel +1
  • Verified V +2
    • Stefan Neufeind +2
    • Wouter Wolters +1
    • Helmut Hummel +1

Files 6

Review log 24

  1. Mr. Jenkins commented on patch set 1 08/07/13, 12:27

  2. Jigal van Hemert commented on patch set 1 08/08/13, 09:18

    A few questions/doubts.

    BasicFileUtility.php:30

    Why is this removed (see also next comment) No use for PathUitility?

    BasicFileUtility.php:135

    If the use statement is removed, this won't work anymore.
  3. Steffen Ritter commented on patch set 1 08/08/13, 09:20

    right, seems to be a cherry-picking/merging error...
  4. Steffen Ritter uploaded patch set 2 08/11/13, 17:43

  5. Mr. Jenkins commented on patch set 2 08/11/13, 17:44

  6. Steffen Ritter uploaded patch set 3 08/11/13, 17:44

  7. Mr. Jenkins commented on patch set 3 08/11/13, 17:45

  8. Helmut Hummel commented on patch set 3 08/15/13, 09:53

    AbstractHierarchicalFilesystemDriver.php:45

    I think we should keep that for better testability

    ResourceStorage.php:217

    What do we need that for?

    BasicFileUtility.php:174

    Why did you change that?

    BasicFileUtility.php:202

    Same here?

    PathUtility.php:209

    Should we call this normalize<Foo> instead of clean<Foo> to make clear this is not a security related method? "clean" may be understood as "safe"
  9. Helmut Hummel commented on patch set 3 CR -1 08/20/13, 14:45

    working on an update...
  10. Stefan Neufeind commented on patch set 3 08/20/13, 16:36

    @Helmut: thanks for taking a look and following up on this patch

    AbstractHierarchicalFilesystemDriver.php:45 Reply

    if I remember right we originally had it still in, then discussed and decided we don't need it anymore. But yes, we can have it.

    ResourceStorage.php:217 Reply

    looks like a leftover now. Maybe also from porting a previous patch or so

    BasicFileUtility.php:174 Reply

    not intentional. Must have been ported over from an older patch, reverting a replacement meanwhile done inbetween.

    BasicFileUtility.php:202 Reply

    same here :-)

    PathUtility.php:209 Reply

    Fine with me. "clean" was a bit meant with "security" in mind ... well, creating absolute paths and not going above top-level etc. But normalize is fine as well.
  11. Helmut Hummel uploaded patch set 4 08/20/13, 16:50

  12. Mr. Jenkins commented on patch set 4 08/20/13, 16:51

  13. Helmut Hummel commented on patch set 4 V -1 CR -1 08/20/13, 16:51

    There is still an error
  14. Helmut Hummel uploaded patch set 5 08/20/13, 17:06

  15. Mr. Jenkins commented on patch set 5 08/20/13, 17:07

  16. Stefan Neufeind commented on patch set 5 08/20/13, 17:14

    Well done, Helmut. Thanks a lot.

    PathUtilityTest.php:305

    use __NAMESPACE__ (testing-namespace) here

    PathUtilityTest.php:312

    then here as well
  17. Wouter Wolters commented on patch set 5 V +1 CR +1 08/20/13, 17:17

    All unit-tests are green on my side.
  18. Helmut Hummel uploaded patch set 6 08/20/13, 17:28

  19. Helmut Hummel voted on patch set 6 V +1 CR +1 08/20/13, 17:29

  20. Helmut Hummel commented on patch set 5 08/20/13, 17:29

    PathUtilityTest.php:305 Reply

    Done

    PathUtilityTest.php:312 Reply

    Done
  21. Mr. Jenkins commented on patch set 6 08/20/13, 17:29

  22. Wouter Wolters voted on patch set 6 V +1 CR +1 08/20/13, 17:34

  23. Stefan Neufeind voted on patch set 6 V +2 CR +2 08/20/13, 19:56

  24. Stefan Neufeind merged patch set 7 08/20/13, 19:56