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

Changing cache file rigths to 666 so that different users on the same… #686

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ivanprado
Copy link

… machine could use it concurrently.

Otherwise, it fails at initialization and cache is not used so there are no initialization gains in the case of two different users running the library in the same machine.

… machine could use it concurrently.

Otherwise it fails at initialization and cache is not used so there is no inicialization gains in the case of two users running the library in the same machine.
@kmike
Copy link

kmike commented Nov 8, 2018

To give more details: currently temporary cache file is created with permissions which allow reading and writing only for the current user. It is then moved to the global temp dir (/tmp on Linux), with the same permissions. Once the file is created by one user, other users can't overwrite it. What's worse, they can't even read it. So once cache file is created, jieba cache stops working for all other users, they're getting a traceback in logs each time.

@gumblex
Copy link
Contributor

gumblex commented Nov 8, 2018

Write permission for other users can be a security risk because marshal files cannot be securely loaded.

@ivanprado
Copy link
Author

ivanprado commented Nov 8, 2018 via email

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

Successfully merging this pull request may close these issues.

None yet

3 participants