geoipupdate icon indicating copy to clipboard operation
geoipupdate copied to clipboard

LocalFileWriter Close needs to release lock file

Open amzhughe opened this issue 6 years ago • 2 comments

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

amzhughe avatar Dec 16 '19 16:12 amzhughe

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.

horgh avatar Dec 18 '19 19:12 horgh

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.

oschwald avatar Dec 20 '19 22:12 oschwald