Skip to content

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

Open
ivanprado wants to merge 1 commit into
fxsjy:masterfrom
ivanprado:master
Open

ivanprado wants to merge 1 commit into
fxsjy:masterfrom
ivanprado:master

Conversation

@ivanprado

Copy link
Copy Markdown

… 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

kmike commented Nov 8, 2018

Copy link
Copy Markdown

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

gumblex commented Nov 8, 2018

Copy link
Copy Markdown
Contributor

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

@ivanprado

ivanprado commented Nov 8, 2018 via email

Copy link
Copy Markdown
Author

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.

3 participants