1
0
Fork 0
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:
Marius van der Wijden 2025-01-06 07:52:01 +01:00 committed by GitHub
parent a9ab53d751
commit c5a8d34851
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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