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

fix: use a lower file permission in file creation #18206

Merged
merged 6 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ func DefaultBaseappOptions(appOpts types.AppOptions) []func(*baseapp.BaseApp) {
func GetSnapshotStore(appOpts types.AppOptions) (*snapshots.Store, error) {
homeDir := cast.ToString(appOpts.Get(flags.FlagHome))
snapshotDir := filepath.Join(homeDir, "data", "snapshots")
if err := os.MkdirAll(snapshotDir, os.ModePerm); err != nil {
if err := os.MkdirAll(snapshotDir, 0o644); err != nil {
Dismissed Show dismissed Hide dismissed
alexanderbez marked this conversation as resolved.
Show resolved Hide resolved
return nil, fmt.Errorf("failed to create snapshots directory: %w", err)
}

Expand Down
4 changes: 2 additions & 2 deletions store/storage/rocksdb/comparator.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func CreateTSComparator() *grocksdb.Comparator {
//
// NOTICE: The behavior must be identical to RocksDB builtin comparator
// "leveldb.BytewiseComparator.u64ts".
func compareTS(bz1 []byte, bz2 []byte) int {
func compareTS(bz1, bz2 []byte) int {
ts1 := binary.LittleEndian.Uint64(bz1)
ts2 := binary.LittleEndian.Uint64(bz2)

Expand All @@ -48,7 +48,7 @@ func compareTS(bz1 []byte, bz2 []byte) int {
//
// NOTICE: The behavior must be identical to RocksDB builtin comparator
// "leveldb.BytewiseComparator.u64ts".
func compare(a []byte, b []byte) int {
func compare(a, b []byte) int {
ret := compareWithoutTS(a, true, b, true)
if ret != 0 {
return ret
Expand Down
Loading