Skip to content

Commit

Permalink
remote-desktop: Accept ConnectToEIS only with started sessions
Browse files Browse the repository at this point in the history
The ConnectToEIS() method allows the client to communicate directly
with EIS via a socket.

But we need to allow for this only with a fully started session,
otherwise ConnecToEIS() would allow to bypass the permission and
the user dialog entirely.
  • Loading branch information
ofourdan authored and whot committed Dec 8, 2022
1 parent 97932e4 commit 25fa5ef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/remote-desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1407,13 +1407,18 @@ handle_connect_to_eis (XdpDbusRemoteDesktop *object,

switch (remote_desktop_session->state)
{
case REMOTE_DESKTOP_SESSION_STATE_STARTED:
break;
case REMOTE_DESKTOP_SESSION_STATE_INIT:
case REMOTE_DESKTOP_SESSION_STATE_DEVICES_SELECTED:
case REMOTE_DESKTOP_SESSION_STATE_SELECTING_DEVICES:
case REMOTE_DESKTOP_SESSION_STATE_SOURCES_SELECTED:
case REMOTE_DESKTOP_SESSION_STATE_SELECTING_SOURCES:
break;
case REMOTE_DESKTOP_SESSION_STATE_STARTED:
g_dbus_method_invocation_return_error (invocation,
G_DBUS_ERROR,
G_DBUS_ERROR_FAILED,
"Session is not ready");
return G_DBUS_METHOD_INVOCATION_HANDLED;
case REMOTE_DESKTOP_SESSION_STATE_STARTING:
g_dbus_method_invocation_return_error (invocation,
G_DBUS_ERROR,
Expand Down

0 comments on commit 25fa5ef

Please sign in to comment.