Decline VNC approval early when no console user is logged in

This commit is contained in:
Viktor Liu
2026-05-23 19:15:01 +02:00
parent 544ebb3575
commit bde5c6fdcc
4 changed files with 44 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
package server
// consoleHasInteractiveUser returns true when there is a logged-in user
// session on the box. At the lock/login screen WTSQueryUserName is empty,
// which means there is nobody to display an approval prompt to. Callers
// should decline without waiting on the broker in that case.
func consoleHasInteractiveUser() bool {
sid := getActiveSessionID()
if sid == 0 {
return false
}
return wtsSessionHasUser(sid)
}