mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
On Windows, calling configurev4.IsConfigureNotExists() triggered the v4 library to lazy-initialize using its Linux-default config path (/etc/v2raya). On Windows, /etc/v2raya resolves to \etc\v2raya on the current drive root (e.g. C:\etc\v2raya). The v4 library then called os.MkdirAll to create that directory and bbolt.Open to create boltv4.db inside it -- neither of which is intentional or useful on Windows. v2rayA v4 was Linux-only, so no v4 configuration data can ever exist on a Windows machine. Guard the entire v4 migration check with a runtime.GOOS check to skip it on Windows. Also extend sanitizeConfigDirForPlatform to catch the relative-path variant etc/v2raya (without a leading slash) in addition to the existing check for the drive-relative /etc/v2raya, providing defence-in-depth if V2RAYA_CONFIG is ever set to such a value.