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

If the baseDir for BoundOS is /, then insideBaseDir and insideBaseDirEval always fail #42

Closed
t0rr3sp3dr0 opened this issue Dec 31, 2023 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@t0rr3sp3dr0
Copy link

BoundOS has two function to check whether or not a file is inside the base directory. Their implementation rely on appending filepath.Separator to fs.baseDir and using strings.HasPrefix with filename. This causes a problem when fs.baseDir is the root directory. That's because strings.HasPrefix("/" + filepath.Separator, filename) will never return true with a clean filename.

@pjbgf pjbgf added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Jan 2, 2024
@pjbgf
Copy link
Member

pjbgf commented Jan 2, 2024

@t0rr3sp3dr0 nice find. Would you be keen to propose a PR to fix the issue?

@t0rr3sp3dr0
Copy link
Author

Yeah, sure! I’ll work on that.

@rminnich
Copy link
Contributor

I think this is fixed.

@pjbgf
Copy link
Member

pjbgf commented May 16, 2024

Fixed as per #48.

@pjbgf pjbgf closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants