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

Free space check should respect symlinks #7

Open
DCNick3 opened this issue Aug 29, 2023 · 4 comments
Open

Free space check should respect symlinks #7

DCNick3 opened this issue Aug 29, 2023 · 4 comments

Comments

@DCNick3
Copy link

DCNick3 commented Aug 29, 2023

Currently the free space check does not handle symlinks correctly

For example, if I have a symlink from ~/.local/anime-game-launcher to /var/games/anime-game and /var is a different disk from /, the free space check will incorrectly return the free space for /.

Probably this can be done by resolving the symlink to a real path before doing the mount point check

if path.starts_with(disk.mount_point()) {

@krypt0nn
Copy link
Member

No it doesn't. Use the proper way to store your data in different locations - by editing config.json

@krypt0nn krypt0nn closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2023
@krypt0nn
Copy link
Member

People on the server won. I'll add real path resolution here in future versions

@krypt0nn krypt0nn reopened this Aug 29, 2023
@SpraxDev
Copy link

I'm glad this is planned to be fixed.

It seems I do not have enough Rust experience to create a PR sadly but https://doc.rust-lang.org/std/fs/fn.canonicalize.html looks like the right thing to use instead of read_link?

let path = path.as_ref()
.read_link()
.unwrap_or_else(|_| path.as_ref().to_path_buf());

@XenHat
Copy link

XenHat commented May 19, 2024

Would this be the cause for an-anime-team/the-honkers-railway-launcher#143 ?

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

No branches or pull requests

4 participants