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

LocalFileWriter Close needs to release lock file #59

Open
amzhughe opened this issue Dec 16, 2019 · 2 comments
Open

LocalFileWriter Close needs to release lock file #59

amzhughe opened this issue Dec 16, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@amzhughe
Copy link
Contributor

The LocalFileDatabaseWriter's Close() method releases the lock file when finished, but doesn't erase it. This lead to an issue where if a different user tries to run the updater, they don't have permission to access the lock file.

https://github.com/maxmind/geoipupdate/blob/master/pkg/geoipupdate/database/local_file_writer.go#L96

@horgh
Copy link
Contributor

horgh commented Dec 18, 2019

Yeah, it'd be ideal to delete the file. It's that way currently to avoid race conditions. It might be possible to do it, but we'll have to be careful to consider races.

@oschwald
Copy link
Member

Could you expand a bit more on your use case? The lock file uses the database directory by default. Both users would need to be able to write to that directory for the database downloads to work.

Perhaps it would make sense for us to have a configuration option to set the access permissions on the files created by geoipupdate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants