mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-30 18:49:08 +02:00
Fail fast when no console session exists and keep the SAS value type
This commit is contained in:
@@ -112,8 +112,14 @@ func enableSoftwareSAS() {
|
||||
defer sasStateMu.Unlock()
|
||||
|
||||
if !savedSASState.captured {
|
||||
prev, _, err := key.GetIntegerValue("SoftwareSASGeneration")
|
||||
prev, valType, err := key.GetIntegerValue("SoftwareSASGeneration")
|
||||
switch {
|
||||
case err == nil && valType != registry.DWORD:
|
||||
// Restoring writes a DWORD, so anything else would come back with a
|
||||
// different type than the administrator set, even when the number
|
||||
// itself fits.
|
||||
log.Warnf("SoftwareSASGeneration has registry type %d rather than DWORD, leaving it alone", valType)
|
||||
return
|
||||
case err == nil && prev > math.MaxUint32:
|
||||
// A DWORD is what the policy takes, so a wider value is not ours to
|
||||
// narrow and restore.
|
||||
|
||||
Reference in New Issue
Block a user