Bug 7855 - get_sessions RPC call does not always respect username filter
Summary: get_sessions RPC call does not always respect username filter
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Server (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.15.0
Assignee: William Sjöblom
URL:
Keywords: ossman_tester, prosaic
Depends on:
Blocks: 7833
  Show dependency treegraph
 
Reported: 2022-03-09 10:52 CET by William Sjöblom
Modified: 2022-03-10 11:26 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description William Sjöblom cendio 2022-03-09 10:52:12 CET
The master RPC procedure `get_sessions' does not respect the `username'
filter parameter if asked to also verify the sessions.

When telling `get_sessions' to filter by username, the reasonable
behavior would be only returning sessions belonging to the specified
user, regardless of whether we ask to verify the sessions or not. We now
instead get different behavior depending on if we choose to validate the
sessions or not. If we do not validate, we get the expected
behavior. But if choose to validate, we get an unfiltered list instead
(but with only the sessions belonging to the given username verified).

This behavior is relied upon by tlwebadm and is not entirely
unreasonable in that context since it saves us an additional
`get_sessions' call. It is nonetheless poorly documented and not
especially intuitive, so it should be fixed.
Comment 2 William Sjöblom cendio 2022-03-09 16:31:27 CET
A fix has now been committed and I have done the following regression
tests using server build #2495 running on Fedora 35:
• ☑ tlwebadm → Status → Sessions shows the active sessions
• ☑ tlwebadm → Status → Sessions can show details about a user's session
  • ☑ If the user has one active session
  • ☑ If the user has more than one active session
• ☑ Stopping vsmagent and clicking on an entry under tlwebadm → Status →
  Sessions show the agent as down (i.e. the sessions are still
  verified).

Marking as resolved!
Comment 3 Pierre Ossman cendio 2022-03-10 11:26:34 CET
Tested on Ubuntu 20.04 with build 2499. Started four sessions with four different users.

 * "tlctl session list" shows all sessions

 * "tlctl session list --user user1" shows just that session

 * tlwebadm shows all sessions

 * getting details for a session in tlwebadm works, and still shows the other sessions

 * "tlctl session terminate --user user1" shows just that session, and only kills that session

 * "tlctl session terminate --all" shows all sessions, kills them all

Code and tests looks good.

Note You need to log in before you can comment on or make changes to this bug.