Skip to content

ValidatorTest.isValidDirectoryPath() has tests that fail under Windows if ESAPI tests run from different drive where Windows installed #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kwwall opened this issue Jun 22, 2019 · 0 comments · Fixed by #501

Comments

@kwwall
Copy link
Contributor

kwwall commented Jun 22, 2019

@davewichers reported this issue.

On Dave's Windows box, ESAPI is installed under D: drive and Windows is installed on C: drive. This results in several failed tests in ValidatorTest.isValidDirectoryPath().

These tests fail because when DefaultValidator.isValidDirectoryPath is called with 'input' and 'parent', one of the tests verification checks that takes place is to make sure that the specified 'input' directory is "inside" the specified 'parent' directory. But for Dave's case, running on D: drive, 'parent' (which is set to 'new File("/");') will end up having a canonical path of "D:\", so in DefaultValidator, the check results in
"C:\\".startsWith("D:\\")
which obviously fails.

@kwwall kwwall self-assigned this Jun 22, 2019
@kwwall kwwall added this to the 2.2 milestone Jun 22, 2019
jeremiahjstacey pushed a commit that referenced this issue Jun 24, 2019
* Change release version to 2.2.0.0 for official release.

* Update / correct ESAPI release steps.

* Fix ironic spelling typo.

* Fix ironic spelling typo.

* Changes to suppress most of the noise, but also fixes to all for .XML and .PROPERTIES suffixes and to fix and return null when property is null or empty string.

* Changes to suppress most of the noise and to actually handle the exceptions that we should have been all along (e.g., IOExceptions).

* Comment out the crude benchmark related assertion that sometimes was failing because of JIT-related issues. Needs to be eventually replaced by JMH.

* Close #499 by resetting 'parent' when Windows is detected to root of drive where Windows is installed.

* Close issue #488. These are slight enhancements to PR #489 by @JoergAdler that I rejected because Eclipse did something to cause every line to differ. But shout out to Jörg Adler for originally finding this issue and patching it.

* Close issue #488. These are slight enhancements to PR #489 by @JoergAdler that I rejected because Eclipse did something to cause every line to differ. But shout out to Jörg Adler for originally finding this issue and patching it.
I also added an additional test or 2, so don't blame @JoergAdler if I messed that up.

* Close issue #488. These are slight enhancements to PR #489 by @JoergAdler that I rejected because Eclipse did something to cause every line to differ. But shout out to Jörg Adler for originally finding this issue and patching it.
I tremendously stripped down the contents of this file because really all it needed was a single property referencing the validation.properties file.

* Add 3 additional issues that were closed and fixes to some minor formatting.

* Final updates for the ESAPI 2.2.0.0 official release.

* Figure I probably ought to add my name instead of assuming people knew it and my email address.

* Changed schema from allowing unbounded number of properties to allow only 10000. That really should NOT be a problem.
However, it should help silence some of the SAST engines.

* Additional changes to fix GitHub Issue #500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant