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

Proposal: Better Path handling Mechanisms #240

Closed
newtoallofthis123 opened this issue Feb 24, 2024 · 3 comments · Fixed by #243 or #246
Closed

Proposal: Better Path handling Mechanisms #240

newtoallofthis123 opened this issue Feb 24, 2024 · 3 comments · Fixed by #243 or #246

Comments

@newtoallofthis123
Copy link
Collaborator

newtoallofthis123 commented Feb 24, 2024

In the codebase, there are many places, especially within swhks where filenames and paths have been manipulated using strings and with no sufficient checks in place as to whether they exist or the user has permission to access them.

This proposal is to use high efficient crates like path_abs and dirs along with some higher order use of functions in order to fix this issue.

Some examples of this in the code base are:
swhks/src/main.rs line: 160, 161, 67
main/swhkd/src/daemon.rs line: 567, 561

Moreover, the usuage of env variables can be centralised and validated, reducing code complexity and the use of crate: path_abs would provide good validations as well

This issue is a proposal to make these changes and I am ready to go more into the details of it

@newtoallofthis123 newtoallofthis123 changed the title Proposal: Better Filename and Path handling Systems Proposal: Better Path handling Mechanisms Feb 24, 2024
@newtoallofthis123
Copy link
Collaborator Author

Addressed in PR #243

@Shinyzenith
Copy link
Member

Hi, this isn't complete yet as swhkd now needs the same transforms.

@Shinyzenith Shinyzenith linked a pull request Feb 27, 2024 that will close this issue
@newtoallofthis123
Copy link
Collaborator Author

Also addressed in #246

@Shinyzenith Shinyzenith linked a pull request Feb 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants