Skip to content

Commit

Permalink
Merge pull request #2241 from CortexFoundation/dev
Browse files Browse the repository at this point in the history
core/rawdb: fix panic in freezer
  • Loading branch information
ucwong authored Jan 6, 2025
2 parents 5554435 + 694097b commit e99e2e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/rawdb/freezer.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ func NewFreezer(datadir string, namespace string, readonly bool, maxTableSize ui
)
// Ensure the datadir is not a symbolic link if it exists.
if info, err := os.Lstat(datadir); !os.IsNotExist(err) {
if info == nil {
log.Warn("Could not Lstat the database", "path", datadir)
return nil, errors.New("lstat failed")
}
if info.Mode()&os.ModeSymlink != 0 {
log.Warn("Symbolic link ancient database is not supported", "path", datadir)
return nil, errSymlinkDatadir
Expand Down

0 comments on commit e99e2e0

Please sign in to comment.