<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Users logging in gets previous user's XDG_RUNTIME_DIR"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=62866">62866</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Users logging in gets previous user's XDG_RUNTIME_DIR
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>keith@dartworks.biz
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I have a Gentoo system with systemd set up. It's a laptop with multiple users. 
When a user logs the first time they get a XDG_RUNTIME_DIR that is correct for
them. Then they log out, and another user logs in. That next user gets the
previous user's value for XDG_RUNTIME_DIR. That dir (/run/user/100x) is owned
by previous user and various services fail for next user. 

The journal entries:

Mar 28 03:29:07 venus slim[8131]: pam_systemd(slim:session): Asking logind to
create session: uid=1003 pid=8131 service=slim type=x11 class=user seat=seat0
vtnr=7 tty= display=:0.0 remote=no remote_user=root remote_host=

Mar 28 03:29:07 venus slim[8131]: pam_systemd(slim:session): Reply from logind:
id=8 object_path=/org/freedesktop/login1/session/_38
runtime_path=/run/user/1000 session_fd=16 seat=seat0 vtnr=7

Which makes pam_systemd set XDG_RUNTIME_DIR to /run/user/1000, not the current
user's dir. Then:

Mar 28 03:29:07 venus gnome-keyring-daemon[8141]: couldn't create socket
directory: Permission denied

Notice the runtime_path is different from the uid that logged in. It's the
previous user.</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>