<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - logind: Save the user’s state when a session enters SESSION_ACTIVE"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90818#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - logind: Save the user’s state when a session enters SESSION_ACTIVE"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90818">bug 90818</a>
              from <span class="vcard"><a class="email" href="mailto:bugzilla@tecnocode.co.uk" title="Philip Withnall <bugzilla@tecnocode.co.uk>"> <span class="fn">Philip Withnall</span></a>
</span></b>
        <pre>Created <span class=""><a href="attachment.cgi?id=116244" name="attach_116244" title="logind: Save the user’s state when a session enters SESSION_ACTIVE">attachment 116244</a> <a href="attachment.cgi?id=116244&action=edit" title="logind: Save the user’s state when a session enters SESSION_ACTIVE">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=90818&attachment=116244'>[review]</a>
logind: Save the user’s state when a session enters SESSION_ACTIVE

When (for example) switching from X11 to a new VT and logging in there,
creating a new session, the user state file (/run/systemd/users/$uid) is
not updated after the session becomes active. The latest time it is
saved is when the session is in SESSION_OPENING.

This results in a /run/systemd/users/$uid file which contains
STATE=online for the current user on the current active VT, which is
obviously wrong.

As functions like sd_uid_get_state() use this file to get the user’s
state, this could result in things like PolicyKit making incorrect
decisions about the user’s state. (See
<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">https://bugs.freedesktop.org/show_bug.cgi?id=76358</a>.)

Fix this by re-saving the state for a session’s user after completing
the state_job for that session.</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>