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

MCR-2885 proposal for a start of a more controlled handling of "alien objects"… #1841

Draft
wants to merge 3 commits into
base: 2022.06.x
Choose a base branch
from

Conversation

vs-gsi
Copy link
Contributor

@vs-gsi vs-gsi commented May 17, 2023

… in data directory – fixes metadata rebuild command while arbitrary files present in data dirs (project/type)

Link to jira.

… in data directory – fixes metadata rebuild command while arbitrary files present in data dirs (project/type)
* 2 - dirty
*/
private int typeDirStatus(Object path) {
File p = new File(path.toString());
Copy link

Choose a reason for hiding this comment

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

9% of developers fix this issue

PATH_TRAVERSAL_IN: This API (java/io/File.(Ljava/lang/String;)V) reads a file whose location might be specified by user input


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.

@yagee-de yagee-de self-requested a review May 23, 2023 13:18
@yagee-de
Copy link
Member

We should discuss this in a video call together and need to improve our contribute documentation a bit.

@kkrebs kkrebs changed the title proposal for a start of a more controlled handling of "alien objects"… MCR-2885 proposal for a start of a more controlled handling of "alien objects"… Jun 6, 2023
@vs-gsi
Copy link
Contributor Author

vs-gsi commented Jun 28, 2023

just updated the PR

@vs-gsi
Copy link
Contributor Author

vs-gsi commented Jul 4, 2023

(updated after @rsteph-de pointed out today, that i should use pure nio here)

@@ -0,0 +1,7 @@
package org.mycore.datamodel.common;

public enum ProjectDirState {
Copy link
Member

Choose a reason for hiding this comment

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

Is this enum still needed? Or can it be simplified to a boolean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The enum was proposed by someone else and i think this solution has both advantages included:

  • We have a (minimalistic) stable boolean wrapper function
  • The Enum can be freely extended without changing any current code dependent on it
    (Or at least minimal&obvious changes if the inequality should go in another direction longer term for whatever reason)
    => to advertise it a bit: maximum flexibility with minimalistic (but still guiding) implementation

@rsteph-de rsteph-de marked this pull request as draft March 26, 2024 13:36
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.

3 participants