Bug 98688 - [PATCH] Add support for elogind session tracker to PolicyKit
Summary: [PATCH] Add support for elogind session tracker to PolicyKit
Status: RESOLVED FIXED
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-11 18:18 UTC by Sven Eden
Modified: 2018-04-12 06:07 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Enable elogind support in PolicyKit (5.48 KB, patch)
2016-11-11 18:18 UTC, Sven Eden
Details | Splinter Review
Enable elogind support in PolicyKit (configure.ac-only version) (2.64 KB, patch)
2018-03-30 17:10 UTC, Sven Eden
Details | Splinter Review

Description Sven Eden 2016-11-11 18:18:20 UTC
Created attachment 127917 [details] [review]
Enable elogind support in PolicyKit

Currently configure.ac allows the usage of either libsystemd-login or ConsoleKit for session tracking.

The elogind project (https://github.com/wingo/elogind) provides systemd-logind as a stand-alone daemon.
To allow users of systems not run by the full systemd suite, for whatever reason there might be, to at least be able to not have to use ConsoleKit for session tracking, an integration of elogind usage into PolicyKit would be very helpfull.

As elogind provides the same interface as systemd-login, integration is easy.

Please see the attached patch.

The patch :
a) adds --enable-libelogind to configure.ac,
b) adds LIBELOGIND_CFLAGS and _LIBS to
    src/polkitbackend/Makefile.am and
    src/polkit/Makefile.am and
c) adds an include <elogind/sd-login.h> to
    src/polkitbackend/polkitbackendjsauthority.c,
    src/polkitbackend/polkitbackendsessionmonitor-systemd.c and
    src/polkit/polkitunixsession-systemd.c
    if --enable-libelogind was issued by the user.

No other changes where needed.
Comment 1 Ray Strode [halfline] 2018-03-29 18:27:24 UTC
do you mind redoing this patch so that it only touches configure.ac ? elogind is a drop in replacement for logind these days
Comment 2 Sven Eden 2018-03-30 17:10:28 UTC
Created attachment 138447 [details] [review]
Enable elogind support in PolicyKit (configure.ac-only version)

Thank you for your answer.

You are right of course. I made elogind into a drop-in replacement, so reluctant upstreams can use it as if it was libsystemd-login, by only touching their configuration system.

I hope this new patch is acceptable, at least as a basis. Basically it just makes the system to "believe" it was using libsystemd-login, while it is really using libelogind.

... I do hope though, that this won't take another 16 months... ;-)
Comment 3 Ray Strode [halfline] 2018-03-31 17:52:56 UTC
i'm planning to do a release soon, so will make sure this lands first.
Comment 4 Ray Strode [halfline] 2018-04-03 18:26:53 UTC
Pushing to master now. will do a release shortly
Comment 5 Sven Eden 2018-04-06 17:00:48 UTC
Thank you very very much!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.