From ff5ce767dffd976a2fd529e87d3e41c6273e4da5 Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Sat, 7 Jan 2023 15:11:23 +0000 Subject: [PATCH] Revert "add file soft link path resolve support (#1482)" (#1495) This reverts commit eaf401eda93ea97f95136e480f465dba8b652275. --- common/platform/filesystem/file.go | 8 ++------ infra/conf/serial/builder.go | 7 +------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/common/platform/filesystem/file.go b/common/platform/filesystem/file.go index e8ee46b0..e10bfc11 100644 --- a/common/platform/filesystem/file.go +++ b/common/platform/filesystem/file.go @@ -3,7 +3,7 @@ package filesystem import ( "io" "os" - "path/filepath" + "github.com/xtls/xray-core/common/buf" "github.com/xtls/xray-core/common/platform" ) @@ -11,11 +11,7 @@ import ( type FileReaderFunc func(path string) (io.ReadCloser, error) var NewFileReader FileReaderFunc = func(path string) (io.ReadCloser, error) { - resolved_path,err:=filepath.EvalSymlinks(path) - if err!= nil{ - return nil,err - } - return os.Open(resolved_path) + return os.Open(path) } func ReadFile(path string) ([]byte, error) { diff --git a/infra/conf/serial/builder.go b/infra/conf/serial/builder.go index fc9a0c3c..443dbdb0 100644 --- a/infra/conf/serial/builder.go +++ b/infra/conf/serial/builder.go @@ -2,7 +2,6 @@ package serial import ( "io" - "path/filepath" "github.com/xtls/xray-core/core" "github.com/xtls/xray-core/infra/conf" @@ -11,11 +10,7 @@ import ( func BuildConfig(files []string, formats []string) (*core.Config, error) { cf := &conf.Config{} - for i, file_ := range files { - file, err := filepath.EvalSymlinks(file_) - if err != nil { - return nil, err - } + for i, file := range files { newError("Reading config: ", file).AtInfo().WriteToLog() r, err := confloader.LoadConfig(file) if err != nil {