<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - user_elect_display() overwrites DISPLAY with TTY session when switching VT away from a graphical session"
href="https://bugs.freedesktop.org/show_bug.cgi?id=90769">90769</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>user_elect_display() overwrites DISPLAY with TTY session when switching VT away from a graphical session
</td>
</tr>
<tr>
<th>Product</th>
<td>systemd
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>major
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Assignee</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>bugzilla@tecnocode.co.uk
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr></table>
<p>
<div>
<pre>Patch coming to fix logind’s user_elect_display() to be more stable when
switching VT from a graphical session to a TTY session, while still keeping the
graphical session open.
See the commit message for full details.
This is important because it affects the session returned by
sd_uid_get_display(), which will be used by PolicyKit to find the correct
session context to make policy decisions in. Hence this may (depending on the
particular udisks2 policy in force) break auto-mounting of USB disks if the
user starts a remote session after their X11 session, for example.
See also: <a class="bz_bug_link
bz_status_NEW "
title="NEW - allow_active/inactive match against the active session not the active user"
href="show_bug.cgi?id=67728">bug #67728</a>, <a class="bz_bug_link
bz_status_NEW "
title="NEW - Please use sd_uid_get_state() to make security decisions, not sd_pid_get_session()"
href="show_bug.cgi?id=76358">bug #76358</a>.
---
The incorrect behaviour can be tested by:
1. In an X11 terminal, `cat /run/systemd/users/$uid` gives SESSIONS=c1
DISPLAY=c1.
2. Switch VT, log in, `cat /run/systemd/users/$uid` gives SESSIONS="c2 c1"
DISPLAY=c2. Here, DISPLAY is incorrect and will result in the wrong return
value from sd_uid_get_display().
3. Switch back to X11 and cat again; details are the same.
4. Log out of the VT and cat again; DISPLAY=c1 SESSIONS=c1 again (correct).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>