Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 920383 - sys-auth/elogind-252.9 has policykit compiled in even when built with USE="-policykit"
Summary: sys-auth/elogind-252.9 has policykit compiled in even when built with USE="-p...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andreas Sturmlechner
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 923258
  Show dependency tree
 
Reported: 2023-12-20 14:44 UTC by wga9im
Modified: 2024-01-29 11:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info sys-auth/elogind (emerge--info_elogind.txt,6.92 KB, text/plain)
2023-12-20 14:44 UTC, wga9im
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wga9im 2023-12-20 14:44:51 UTC
Created attachment 880091 [details]
emerge --info sys-auth/elogind

sys-auth/elogind-252.9 has USE "policykit" as PDEPEND only, it's not influencing emesonargs. As a result, elogind is built WITH polkit support even though polkit is not installed.

This leads to libseat error when attempting to activate seat:


$ LIBSEAT_BACKEND=logind hikari
00:00:00.000 [libseat] [libseat/backend/logind.c:317] Could not activate session: Permission denied
00:00:00.000 [libseat] [libseat/libseat.c:58] Backend 'logind' failed to open seat: Permission denied
00:00:00.000 [backend/session/session.c:84] Unable to create seat: Permission denied
00:00:00.000 [backend/session/session.c:249] Failed to load session backend
00:00:00.000 [backend/backend.c:86] Failed to start a session
00:00:00.000 [backend/backend.c:352] Failed to start a DRM session
error: could not create backend


Looking on "# dbus-monitor --system", it's evident that non-existing org.freedesktop.PolicyKit1 is called:


method call time=1703069235.410501 sender=:1.15 -> destination=org.freedesktop.login1 serial=8 path=/org/freedesktop/login1/session/_32; interface=org.freedesktop.login1.Session; member=Activate
method call time=1703069235.410581 sender=:1.0 -> destination=org.freedesktop.DBus serial=98 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetConnectionUnixUser
   string ":1.15"
method return time=1703069235.410584 sender=org.freedesktop.DBus -> destination=:1.0 serial=16 reply_serial=98
   uint32 1000
method call time=1703069235.410711 sender=:1.0 -> destination=org.freedesktop.PolicyKit1 serial=99 path=/org/freedesktop/PolicyKit1/Authority; interface=org.freedesktop.PolicyKit1.Authority; member=CheckAuthorization
   struct {
      string "system-bus-name"
      array [
         dict entry(
            string "name"
            variant                string ":1.15"
         )
      ]
   }
   string "org.freedesktop.login1.chvt"
   array [
   ]
   uint32 0
   string ""
error time=1703069235.410732 sender=org.freedesktop.DBus -> destination=:1.0 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=99
   string "The name org.freedesktop.PolicyKit1 was not provided by any .service files"
error time=1703069235.410775 sender=:1.0 -> destination=:1.15 error_name=org.freedesktop.DBus.Error.AccessDenied reply_serial=8
   string "Permission denied"


As per [1] the only way to remove polkit support is "-Dpolkit=false". When I modify ebuild in local overlay:


--- /var/db/repos/gentoo/sys-auth/elogind/elogind-252.9.ebuild  2023-08-26 18:10:30.000000000 +0200
+++ /var/db/repos/local/sys-auth/elogind/elogind-252.9-r1.ebuild        2023-12-20 11:49:47.620171264 +0100
@@ -108,6 +108,7 @@
                -Drootprefix="${EPREFIX}/"
                -Dbashcompletiondir="${EPREFIX}/usr/share/bash-completion/completions"
                -Dman=auto
+               -Dpolkit=$(usex policykit auto false)
                -Dsmack=true
                -Dcgroup-controller=openrc
                -Ddefault-hierarchy=${cgroupmode}


it indeed helps - libseat is able to activate seat, there are no more calls to "org.freedesktop.PolicyKit1" and therefore I don't have to use seatd daemon to start hikari. I guess this would benefit all users of wlroots-based compositors with no polkit installed.


[1] https://github.com/elogind/elogind/issues/206