[PATCH 1/2] RDP compositor: make the seat dynamic and don't destroy it on removal

Hardening rdp.effort at gmail.com
Tue May 19 02:39:24 PDT 2015


Le 19/05/2015 11:20, Pekka Paalanen a écrit :
> On Tue, 19 May 2015 10:07:39 +0200
> David FORT <rdp.effort at gmail.com> wrote:
> 
>> This patch makes the seat dynamic and leak it on purpose during seat removal to
>> prevent the ghost object case.
>> ---
>>  src/compositor-rdp.c | 39 +++++++++++++++++++++++++++------------
>>  1 file changed, 27 insertions(+), 12 deletions(-)
>>
>> diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
>> index 3185141..f1dcda0 100644
>> --- a/src/compositor-rdp.c
>> +++ b/src/compositor-rdp.c
>> @@ -105,7 +105,7 @@ enum peer_item_flags {
>>  struct rdp_peers_item {

[...]
>> +		weston_seat_release_pointer(seat);
>> +
>> +		/* picked from weston_seat_release(context->item.seat); */
>> +		wl_list_remove(&seat->link);
>> +		if (seat->saved_kbd_focus)
>> +			wl_list_remove(&seat->saved_kbd_focus_listener.link);
>> +		wl_global_destroy(seat->global);
> 
> Hi,
> 
> are you sure destroying the global is ok? Ah, but the thing you want to
> keep are the *existing* protocol objects.
> 

I have picked code weston_seat_release() from that was releasing things
in the seat without freeing it, but...

Thinking of it, it's really a bad idea to destroy the global, it could
cause clients to be disconnected if they try to do anything with the
seat. We're really lacking the release event...

I will modify this to try to handle this more nicely.

Thanks.
-- 
David FORT
website: http://www.hardening-consulting.com/



More information about the wayland-devel mailing list