Skip to content

Commit

Permalink
core/rawdb: fix panic in freezer (ethereum#30973)
Browse files Browse the repository at this point in the history
Fixes an issue where the node panics when an LStat fails with something 
other than os.ErrNotExist

closes ethereum#30968
  • Loading branch information
MariusVanDerWijden authored and s1na committed Jan 15, 2025
1 parent 31b5c06 commit f470540
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 @@ -87,6 +87,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 f470540

Please # to comment.