forked from forks/go-ethereum
core/rawdb: fix panic in freezer (#30973)
Fixes an issue where the node panics when an LStat fails with something other than os.ErrNotExist closes https://github.com/ethereum/go-ethereum/issues/30968
This commit is contained in:
parent
a9ab53d751
commit
c5a8d34851
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue