mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-06 13:39:07 +02:00
Address CodeRabbit review and fix CI on embedded-vnc
This commit is contained in:
@@ -1,19 +1,10 @@
|
||||
package server
|
||||
|
||||
import "errors"
|
||||
|
||||
// consoleHasInteractiveUser returns true when a user is logged into the
|
||||
// console (i.e. an Aqua session is active). At the loginwindow there is
|
||||
// nobody to display an approval prompt to, so callers can decline
|
||||
// without waiting on the broker.
|
||||
func consoleHasInteractiveUser() bool {
|
||||
if _, err := consoleUserID(); err != nil {
|
||||
if errors.Is(err, errNoConsoleUser) {
|
||||
return false
|
||||
}
|
||||
// Unknown error: fail closed so a probe-time glitch does not
|
||||
// silently let an unattended console accept VNC sessions.
|
||||
return false
|
||||
}
|
||||
return true
|
||||
// interactiveUserError returns nil when a user is logged into the console
|
||||
// (i.e. an Aqua session is active). At the loginwindow there is nobody to
|
||||
// display an approval prompt to, so callers can decline without waiting on
|
||||
// the broker. Any error (including errNoConsoleUser) is treated as decline.
|
||||
func interactiveUserError() error {
|
||||
_, err := consoleUserID()
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user