Skip to content

Commit

Permalink
Fix missing displays on sesman restart
Browse files Browse the repository at this point in the history
  • Loading branch information
matt335672 committed Dec 18, 2024
1 parent f18bebd commit 63c2e18
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
5 changes: 1 addition & 4 deletions libipm/ercp.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,7 @@ ercp_get_session_announce_event(struct trans *trans,

if (rv == 0)
{
if (display != NULL)
{
*display = i_display;
}
*display = i_display;
*uid = (uid_t)i_uid;
*type = (enum scp_session_type)i_type;
*start_width = i_width;
Expand Down
1 change: 0 additions & 1 deletion libipm/ercp.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ ercp_send_session_announce_event(struct trans *trans,
*
* @param trans EICP transport
* @param[out] display Display used by session.
* Pointer can be NULL if this is already known.
* @param[out] uid UID of user logged in to session
* @param[out] type Session type
* @param[out] start_width Starting width of seenio
Expand Down
17 changes: 16 additions & 1 deletion sesman/ercp_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ process_session_announce_event(struct session_item *si)
{
int rv;
const char *start_ip_addr;
unsigned int display;

rv = ercp_get_session_announce_event(si->sesexec_trans,
NULL,
&display,
&si->uid,
&si->type,
&si->start_width,
Expand All @@ -53,10 +54,24 @@ process_session_announce_event(struct session_item *si)
&si->guid,
&start_ip_addr,
&si->start_time);
if (rv == 0)
{
// We may already know the display we sent sesexec. If we do,
// check sesexec sent the same value back.
if (si->display >= 0 && display != (unsigned int)si->display)
{
LOG(LOG_LEVEL_ERROR, "Bugcheck: sesman expected display %d, got %u",
si->display, display);
rv = 1;
}
}

if (rv == 0)
{
snprintf(si->start_ip_addr, sizeof(si->start_ip_addr),
"%s", start_ip_addr);
si->display = display;

si->state = E_SESSION_RUNNING;
}

Expand Down

0 comments on commit 63c2e18

Please sign in to comment.