Commit Graph
4 Commits
Author SHA1 Message Date
Chen Rotem Levy 3c2ee85295 Merge branch 'issue_1261'
Adding to Expose.__init__(..., follow_symlink_out=False).

If the user didn't override this, and if the OS supports symlinks, we
test that the we will not expose any symlinks that points outside of
self.base.

Expose is not also covered by unittests.
2016-06-11 12:38:21 +03:00
Chen Rotem Levy 9877ad5155 fix in_base for base='/'
If the base directory already ends with '/' the test failed.

It failed because we added an extra '/' to make sure that '/foobar' is
not under '/foo', so ask '/foobar/'.startswith('/foo/').

Whoever when we have the base already start with '/' we might test:
'/foo/bar/'.startwith('/foo//'), and give a false negative.  We
shouldn't have this case, because we normalized the path, but in the
case of the root directory ('/') even a normalized path ends with '/',
and thus when base='/' this function failed.

Some re-factoring was needed to make this base testable.
2016-06-11 12:19:16 +03:00
Chen Rotem Levy e020395bdc apply pull request #1313
This should have resolved security issue#1261 -- gluon.tools.Expose
symlinks, however it does not deal well with the case where the base
exposed directory is '/'
2016-06-11 11:20:23 +03:00
Chen Rotem Levy 07d764f3c6 issue#1310
undo PR#1194
2016-04-30 13:41:11 +03:00