Fix: create_channel_per_pid: remove channel on error
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 14 Nov 2018 22:49:21 +0000 (17:49 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 16 Nov 2018 20:48:07 +0000 (15:48 -0500)
The notification system of the session daemon tracks the lifetime
of per-pid buffers (in effect, channel keys) using two hooks:
  - the successful completion of create_channel_per_pid()
  - the deletion of the channel from an application's registry

Multiple error paths in create_channel_per_pid() can leave a channel
in an app's registry without notifying the notification system of its
existence.

When the channel is finally cleaned-up, the channel deletion hook will
inform the notification system that the channel should be deleted,
resulting in an error as that channel was previously unknown.

This fix ensures we remove the application's channel from its registry
on error (with the notify parameter set to 'false'), thus ensuring
that the notification system never tracks the incomplete channel.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>

No differences found
This page took 0.02421 seconds and 4 git commands to generate.