conf: bring over changes from wireguard-windows#10

https://github.com/WireGuard/wireguard-windows/pull/10 don't appear to
be of interest, and now need big rebasing.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2021-04-21 07:05:50 -04:00
parent 77158f3dde
commit d5812860fc
No known key found for this signature in database
GPG key ID: 524F155275DF0C3E
6 changed files with 128 additions and 4 deletions

18
conf/path.go Normal file
View file

@ -0,0 +1,18 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (C) 2019 WireGuard LLC. All Rights Reserved.
*/
package conf
var cachedConfigFileDir string
var cachedRootDir string
var disableAutoMigration bool
// PresetRootDirectory causes RootDirectory() to not try any automatic deduction, and instead
// uses what's passed to it. This isn't used by wireguard-windows, but is useful for external
// consumers of our libraries who might want to do strange things.
func PresetRootDirectory(root string) {
cachedRootDir = root
disableAutoMigration = true
}