Stop narrowing the shared runtime dir, close the injector on stop, allowlist VNC metrics

This commit is contained in:
Viktor Liu
2026-08-29 10:29:17 +02:00
parent 5ba3de375b
commit b56da75718
5 changed files with 138 additions and 15 deletions
+7
View File
@@ -761,6 +761,13 @@ func (s *Server) Stop() error {
if c, ok := s.capturer.(interface{ Close() }); ok {
c.Close()
}
// The injector owns OS resources of its own: the uinput backend holds a
// /dev/uinput descriptor and a registered virtual device, the X11 one an
// X connection. Leaving them open leaks one of each every time the VNC
// server is stopped and started again.
if i, ok := s.injector.(interface{ Close() }); ok {
i.Close()
}
if listenerErr != nil {
return fmt.Errorf("close VNC listener: %w", listenerErr)