#2084 check for active sessions not troll proc for uids
Closed: Fixed None Opened 11 years ago by simo.

When we want to check if a user is logged in (in oreder to decide, for example. whether to keep an old random FILE cache type name) we currently troll /proc to find if any user proces for that uid is present.

We should instead use proper system session management (libsystemd-login and utmp as fallback) to check if a user is actually logged in or not.

It will be faster and cleaner.


Fields changed

owner: somebody => simo
status: new => assigned

Fields changed

changelog: => Previously sssd would retain the exact same ccache name (when using name randomization) if any process beloging to the user was found on the machine, this could lead to unpredicatable behavior, and false positives (hung processes etc).
With this change we retain the old ccache only when there actual open sessions, so all of them share the same credential cache, but not if the aren't any yet.
The previous behavior is still maintained if systemd is not used (RHEL < 7 and other distributions) or if there is a fatal error in trying to obtain information from libsystemd-login.

Fields changed

patch: 0 => 1

Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.12 beta
rhbz: => 0
type: defect => task

Fields changed

rhbz: 0 =>

resolution: => fixed
status: assigned => closed

The self-tests appear to always fail when the package is built under mock for a release which includes systemd-logind.
A build of 5cd4414 made at http://koji.fedoraproject.org/koji/taskinfo?taskID=5977686 errored out on x86_64 with: http://kojipkgs.fedoraproject.org//work/tasks/7689/5977689/build.log.

Replying to [comment:8 nalin]:

The self-tests appear to always fail when the package is built under mock for a release which includes systemd-logind.
A build of 5cd4414 made at http://koji.fedoraproject.org/koji/taskinfo?taskID=5977686 errored out on x86_64 with: http://kojipkgs.fedoraproject.org//work/tasks/7689/5977689/build.log.

Right, thanks for reporting this. We're tracking the problem as https://fedorahosted.org/sssd/ticket/2094 and Simo already kindly provided patch, but it's part of a larger patchset that I haven't fully reviewed yesterday.

Metadata Update from @simo:
- Issue assigned to simo
- Issue set to the milestone: SSSD 1.12 beta

7 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/3126

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Log in to comment on this ticket.

Metadata