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

Unintended access to the filesystem #118

Open
GetPsyched opened this issue Dec 25, 2023 · 0 comments
Open

Unintended access to the filesystem #118

GetPsyched opened this issue Dec 25, 2023 · 0 comments

Comments

@GetPsyched
Copy link
Contributor

The problematic line:

# Create directory if it doesn't exist
os.makedirs(os.path.dirname(DEFAULT_DB_PATH), exist_ok=True)

This is run when imported here:

from nexus.Freqlog.Definitions import BanlistAttr, CaseSensitivity, WordMetadataAttr

Even though the Definitions class isn't imported, it is executed since all the code in it is not inside some function, like __init__.

This causes an issue in my Nix derivation of it during the test phase where it tries to access the filesystem since during a build, the HOME directory does not exist. This will likely happen in any package manager that runs tests in a homeless system. I've temporarily fixed this by adding export HOME=$TMPDIR in the derivation; however a fix for this should be done in here.

A solution would be to create an __init__

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

1 participant