diff options
| author | 2019-11-27 11:17:35 +0100 | |
|---|---|---|
| committer | 2019-12-11 12:06:25 +0100 | |
| commit | bede411f8a643fc37bed4e86eeec53925ed16c7f (patch) | |
| tree | aa2d970adc38639f16b6d309b48afdb201dc8a64 | |
| parent | tunnel: add wintun ordered unit test (diff) | |
| download | wireguard-windows-bede411f8a643fc37bed4e86eeec53925ed16c7f.tar.xz wireguard-windows-bede411f8a643fc37bed4e86eeec53925ed16c7f.zip | |
conf: migrate when windows.old is S-1-5-32-544
Reported-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| -rw-r--r-- | conf/migration_windows.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/conf/migration_windows.go b/conf/migration_windows.go index fb12eaf0..72b298b6 100644 --- a/conf/migration_windows.go +++ b/conf/migration_windows.go @@ -36,8 +36,8 @@ func maybeMigrate(c string) { log.Printf("Not migrating configuration from ‘%s’ due to GetSecurityDescriptorOwner error: %v", oldRoot, err) return } - if defaulted || !owner.IsWellKnown(windows.WinLocalSystemSid) { - log.Printf("Not migrating configuration from ‘%s’, as it is not explicitly owned by SYSTEM, but rather ‘%v’", oldRoot, owner) + if defaulted || (!owner.IsWellKnown(windows.WinLocalSystemSid) && !owner.IsWellKnown(windows.WinBuiltinAdministratorsSid)) { + log.Printf("Not migrating configuration from ‘%s’, as it is not explicitly owned by SYSTEM or Built-in Administrators, but rather ‘%v’", oldRoot, owner) return } err = windows.MoveFileEx(windows.StringToUTF16Ptr(oldC), windows.StringToUTF16Ptr(c), windows.MOVEFILE_COPY_ALLOWED) |
