Hi,
The attached is a very simple patch, which is working but possibly not
suitable for inclusion at this point, that locks the x11 session when
the client disconnects.
Locking is performed using "xdg-screensaver lock", which seems like an
ok implementation given that "xdg-open" is used in the file-transfer code.
I looked at the ovirt-guest-agent code and that agent also locks the
session on disconnect unless specifically disabled.
Citrix (ICAClient) sessions also automatically lock when the client
disconnects.
Other thoughts:
1) Should text consoles be considered? (me: NO)
2) Does GDM need any special exception? (me: needs to be tested)
3) Is there any point checking the exit status of the lock command? (me: NO)
4) Should the lock command be configurable? (me: grumble)
5) Should the lock-on-disconnect be optional and what default value?
(me: default: lock)
6) If lock-on-disconnect is optional, how to configure? (me: Because the
process we care about is running in a specific user session,
configuration may be left to the user, and so possibly
~/.spice-vdagent.conf). Note: there are other options to spice-vdagent
that I can't see how anyone would be able to control using configuration
files.
7) Windows agent feature parity?
--
Thanks,
David Mansfield
Cobite, INC.
diff -ur spice-vdagent-0.15.0.orig/src/vdagent-x11.c spice-vdagent-0.15.0/src/vdagent-x11.c
--- spice-vdagent-0.15.0.orig/src/vdagent-x11.c 2013-10-14 08:52:01.000000000 -0400
+++ spice-vdagent-0.15.0/src/vdagent-x11.c 2015-09-23 09:46:00.166210785 -0400
@@ -1308,11 +1308,17 @@
void vdagent_x11_client_disconnected(struct vdagent_x11 *x11)
{
int sel;
+ int status;
for (sel = 0; sel < VD_AGENT_CLIPBOARD_SELECTION_SECONDARY; sel++) {
if (x11->clipboard_owner[sel] == owner_client)
vdagent_x11_clipboard_release(x11, sel);
}
+
+ status = system("xdg-screensaver lock");
+ if (status != 0) {
+ /* exit status is not checked */
+ }
}
/* Function used to determine the default location to save file-xfers,
Only in spice-vdagent-0.15.0/src: vdagent-x11.c~
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel