Skip to content

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

Open
ivanprado wants to merge 1 commit intofxsjy:masterfrom
ivanprado:master
Open

Changing cache file rigths to 666 so that different users on the same…#686
ivanprado wants to merge 1 commit intofxsjy:masterfrom
ivanprado:master

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.

3 participants