Skip to content
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

Added check to validate Windows path separator #265 #268

Merged
merged 2 commits into from
Jun 28, 2018

Conversation

joachimmetz
Copy link
Member

Added check to validate Windows path separator #265

@joachimmetz joachimmetz requested review from Onager and grrrrrrrrr and removed request for Onager June 11, 2018 05:26
@codecov
Copy link

codecov bot commented Jun 11, 2018

Codecov Report

Merging #268 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #268      +/-   ##
=========================================
+ Coverage   91.24%   91.3%   +0.06%     
=========================================
  Files           7       7              
  Lines         411     414       +3     
=========================================
+ Hits          375     378       +3     
  Misses         36      36
Impacted Files Coverage Δ
artifacts/definitions.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 520a314...fee1114. Read the comment docs.

if source.type_indicator in (
definitions.TYPE_INDICATOR_FILE, definitions.TYPE_INDICATOR_PATH):
if source.supported_os == [definitions.SUPPORTED_OS_WINDOWS]:
if source.separator != '\\':
Copy link
Contributor

@grrrrrrrrr grrrrrrrrr Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check kind of implies that all artifacts that support Windows need to have the separator set to \. If this is the case, why have the separator user defined at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have the separator user defined at all?

There are various different types of path separators: https://en.wikipedia.org/wiki/Path_(computing) and artifacts are intended to self contain the necessary information in the definition. We could create a WINDOWS_PATH but IMHO that does not improve this.

One additional thing the validator could check if the path contains more \ than '/' for Windows. This change is a short term fix to ensure existing definition (for at least Windows) are explicit about their path segment separator.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right I get the intention behind this. What I'm saying is that it will be confusing that when an artifact actually defines a path separator that is not '', let's say that artifact wants to use '/' instead. In that case, the validation will complain with "Missing path separator...", which doesn't make sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add the additional check for the number of \ versus '/' for now, but I somewhat agree with you on one side but on another side also would like this validated.

@joachimmetz joachimmetz merged commit 1af5531 into ForensicArtifacts:master Jun 28, 2018
@joachimmetz joachimmetz deleted the winpath branch June 28, 2018 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants