core/rawdb/eradb: remove symlink check

This commit is contained in:
Felix Lange 2025-05-15 01:11:21 +02:00 committed by lightclient
parent c84e977ce2
commit 4bdf29612d
No known key found for this signature in database
GPG key ID: 657913021EF45A6A

View file

@ -21,7 +21,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"io/fs" "io/fs"
"os"
"path/filepath" "path/filepath"
"sync" "sync"
@ -65,17 +64,6 @@ const (
// New opens the store directory. // New opens the store directory.
func New(datadir string) (*Store, error) { func New(datadir string) (*Store, error) {
// 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 erastore is not supported", "path", datadir)
return nil, errors.New("symbolic link datadir is not supported")
}
}
db := &Store{ db := &Store{
datadir: datadir, datadir: datadir,
lru: lru.NewBasicLRU[uint64, *fileCacheEntry](openFileLimit), lru: lru.NewBasicLRU[uint64, *fileCacheEntry](openFileLimit),