Make session key authorization atomic, unblock the encoder on teardown, drop agent privileges unconditionally

This commit is contained in:
Viktor Liu
2026-08-29 09:12:33 +02:00
parent 8b719f0b4e
commit 42450dbfbe
7 changed files with 119 additions and 14 deletions
+9
View File
@@ -68,6 +68,15 @@ func (c *xfixesCursor) Cursor() (*image.RGBA, int, int, uint64, error) {
}
return nil, 0, 0, 0, fmt.Errorf("cursor has zero extent")
}
// Anything past maxCursorDim is discarded by the encoder, so decoding it
// would allocate and convert a sprite that can only be thrown away. Keep
// showing the last good cursor instead.
if w > maxCursorDim || h > maxCursorDim {
if c.lastImg != nil {
return c.lastImg, c.lastHotX, c.lastHotY, c.lastSerial, nil
}
return nil, 0, 0, 0, fmt.Errorf("cursor %dx%d exceeds %d", w, h, maxCursorDim)
}
if len(reply.CursorImage) < w*h {
if c.lastImg != nil {
return c.lastImg, c.lastHotX, c.lastHotY, c.lastSerial, nil