aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-11-27 11:17:35 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-11-27 11:17:35 +0100
commit202fd6904f31bb7bd166a600a84d0909754d8579 (patch)
treee300d150793eedfe702fdcd6abbe3e25e1889bb2
parenttunnel: add wintun ordered unit test (diff)
downloadwireguard-windows-202fd6904f31bb7bd166a600a84d0909754d8579.tar.xz
wireguard-windows-202fd6904f31bb7bd166a600a84d0909754d8579.zip
conf: migrate when windows.old is S-1-5-32-544
Reported-by: Mantas Mikulėnas <grawity@gmail.com>
-rw-r--r--conf/migration_windows.go4
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)