Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use O_CREATE for bolt.Open(..) only when file doesn't exist
+ By default, etcd-io/bbolt appends an O_CREATE flag to the flags passed in no matter which mode the user attempts to open the db .. https://github.com/etcd-io/bbolt/blob/v1.3.5/db.go#L197...L213 + This appears to be bolt's design decision where they let you create a file that is only writeable by the process if it doesn't exist - even when it is OPEN-ed in READ-ONLY mode. + However, using an O_CREATE on a file that's owned by a different user but READ-able by all users, seems to be causing a permissions error. - While I cannot seem to reproduce this issue on osX, this seems to manifest on windows which complains ERROR_ACCESS_DENIED. + The proposal here is to overwrite Bolt.Options' OpenFile with a custom implementation that appends the O_CREATE file only if the file does not exist - sticking to bolt's design decision. + Should fix blevesearch#1623
- Loading branch information