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

[Bug Report] Fix IsPathInDir #1188

Closed
WithoutPants opened this issue Mar 9, 2021 · 0 comments · Fixed by #1192
Closed

[Bug Report] Fix IsPathInDir #1188

WithoutPants opened this issue Mar 9, 2021 · 0 comments · Fixed by #1192
Labels
bug Something isn't working
Milestone

Comments

@WithoutPants
Copy link
Collaborator

WithoutPants commented Mar 9, 2021

From Discord:

https://github.com/stashapp/stash/blob/develop/pkg/utils/file.go#L275 <-- IsPathInDir returns true when dir is inside pathToCheck and when pathToCheck is inside dir.

eg. IsPathInDir("/media/.previews", "/media") and IsPathInDir("/media","/media/.previews") both return true, the first one shouldn't. .previews is in media, media is not in .previews.

Took me quite a while to work out why my scanning stopped working, because it wont scan /media because due to PR#1118 and the above, it stopped scanning /media, when it should've just stopped scanning /media/.previews

the check inside IsPathInDir should be changed to
if strings.HasPrefix(rel, "..") {

@WithoutPants WithoutPants added help wanted Extra attention is needed bug Something isn't working and removed help wanted Extra attention is needed labels Mar 9, 2021
@WithoutPants WithoutPants added this to the Version 0.6.0 milestone Mar 10, 2021
bnkai added a commit to bnkai/stash that referenced this issue Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant