]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
systemd: dont set polkit permissions manually
authorMarkus Volk <f_l_k@t-online.de>
Wed, 14 Aug 2024 08:29:25 +0000 (10:29 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 1 Sep 2024 11:27:29 +0000 (12:27 +0100)
According to this commit polkit rules should go to ${datadir} instead of ${sysconfdir}:
https://git.openembedded.org/meta-openembedded/commit/?h=master-next&id=d5e90541f8e35916abc930b2da6de037b23d51a1
Theres no need to adjust the permissions for ${datadir} anymore:
https://git.openembedded.org/meta-openembedded/commit/?h=master-next&id=6da0fd21c900e32a0693a6b27d38182f19c8c76c

Dont set polkit permissions manually. This allows to drop the manually
set polkit permissions for all files in meta-openembedded and also for
libvirt in meta-virtualization.

In addition, manually setting the permissions would not be needed for
new recipes anymore.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd_256.5.bb

index 1485614c713bc6bbc8bc9e3cd24f9bb5d631fffd..1d456707801247374eab5b691004b3af5478a62b 100644 (file)
@@ -368,14 +368,6 @@ do_install() {
                rm -r ${D}${sysconfdir}/X11
        fi
 
-       # If polkit is setup fixup permissions and ownership
-       if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
-               if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
-                       chmod 700 ${D}${datadir}/polkit-1/rules.d
-                       chown polkitd:root ${D}${datadir}/polkit-1/rules.d
-               fi
-       fi
-
        # If polkit is not available and a fallback was requested, install a drop-in that allows networkd to
        # request hostname changes via DBUS without elevating its privileges
        if ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'true', 'false', d)}; then
@@ -471,7 +463,7 @@ GROUPADD_PARAM:udev = "-r render"
 GROUPADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', '-r systemd-hostname;', '', d)}"
 USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /sbin/nologin systemd-coredump;', '', d)}"
 USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /sbin/nologin systemd-network;', '', d)}"
-USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
+USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${datadir}/polkit-1 polkitd;', '', d)}"
 USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /sbin/nologin systemd-resolve;', '', d)}"
 USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /sbin/nologin systemd-timesync;', '', d)}"
 USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'oomd', '--system -d / -M --shell /sbin/nologin systemd-oom;', '', d)}"