Skip to contentSkip to conversation

systemd: use update-alternatives to solve conflicts with polkit

PATCH In review [email protected] 4 participants 11 messages Aug 28, 2024 – Aug 29, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: use update-alternatives to solve conflicts with polkit

From: Wang Mingyu <[email protected]>

Error: Transaction test error:
file /usr/share/polkit-1/rules.d conflicts between attempted installs of polkit-125-r0.core2_64 and systemd-1:256.5-r0.core2_64

polkit also uses the doc '/usr/share/polkit-1/rules.d'. polkit has a priority of 100.

---
 meta/recipes-core/systemd/systemd_256.5.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_256.5.bb +5 -1
index ee656c81e5..1c408d075f 100644
@@ -848,7 +848,7 @@ python do_warn_musl() {
 }
 addtask warn_musl before do_configure
 
-ALTERNATIVE:${PN} = "halt reboot shutdown poweroff runlevel ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
+ALTERNATIVE:${PN} = "halt reboot shutdown poweroff runlevel rules.d ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
 
 ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
 ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
@@ -874,6 +874,10 @@ ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
 ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
 ALTERNATIVE_PRIORITY[runlevel] ?= "300"
 
+ALTERNATIVE_TARGET[rules.d] = "${datadir_native}/polkit-1/rules.d"
+ALTERNATIVE_LINK_NAME[rules.d] = "${datadir_native}/polkit-1/rules.d"
+ALTERNATIVE_PRIORITY[rules.d] ?= "50"
+
 pkg_postinst:${PN}:libc-glibc () {
 	if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then
 		sed -e '/^hosts:/s/\s*\<myhostname\>//' \
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/1 util-linux: use update-alternatives to solve conflicts with lastlog2

From: Wang Mingyu <[email protected]>

Error: Transaction test error:
file /usr/bin/lastlog2 conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64 file /usr/lib/security/pam_lastlog2.so conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64

lastlog2 also uses the doc '/usr/bin/lastlog2' and '/usr/lib/security/pam_lastlog2.so'. lastlog2 has a priority of 100.

---
 meta/recipes-core/util-linux/util-linux_2.40.2.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-core/util-linux/util-linux_2.40.2.bb +4 -0
index a8e346539a..e21a16ab84 100644
@@ -298,6 +298,10 @@ ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
 ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump"
 ALTERNATIVE_LINK_NAME[uuidgen] = "${bindir}/uuidgen"
 ALTERNATIVE_LINK_NAME[wall] = "${bindir}/wall"
+ALTERNATIVE:${PN}-lastlog2 = "lastlog2 pam_lastlog2"
+ALTERNATIVE_LINK_NAME[lastlog2] = "${bindir}/lastlog2"
+ALTERNATIVE_TARGET[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
+ALTERNATIVE_LINK_NAME[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
 
 ALTERNATIVE:${PN}-doc = "\
 blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 libblkid.3 logger.1 mesg.1 \
Signature · 1 line
2.34.1
#2 lore raw

Re: [OE-core] [PATCH] util-linux: use update-alternatives to solve conflicts with lastlog2

I don't think this is the right way to resolve the problem. You should be installing one or the other, but not both.

Alex

Quoted 42 lines · wangmy via lists.openembedded.org

From: Wang Mingyu <[email protected]>

Error: Transaction test error:
file /usr/bin/lastlog2 conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64 file /usr/lib/security/pam_lastlog2.so conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64

lastlog2 also uses the doc '/usr/bin/lastlog2' and '/usr/lib/security/pam_lastlog2.so'. lastlog2 has a priority of 100.

---
 meta/recipes-core/util-linux/util-linux_2.40.2.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-core/util-linux/util-linux_2.40.2.bb +4 -1
index a8e346539a..e21a16ab84 100644
@@ -298,6 +298,10 @@ ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
 ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump"
 ALTERNATIVE_LINK_NAME[uuidgen] = "${bindir}/uuidgen"
 ALTERNATIVE_LINK_NAME[wall] = "${bindir}/wall"
+ALTERNATIVE:${PN}-lastlog2 = "lastlog2 pam_lastlog2"
+ALTERNATIVE_LINK_NAME[lastlog2] = "${bindir}/lastlog2"
+ALTERNATIVE_TARGET[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
+ALTERNATIVE_LINK_NAME[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
 
 ALTERNATIVE:${PN}-doc = "\
 blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 libblkid.3 logger.1 mesg.1 \
--

2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203870): https://lists.openembedded.org/g/openembedded-core/message/203870
Mute This Topic: https://lists.openembedded.org/mt/108138530/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

RE: [OE-core] [PATCH] util-linux: use update-alternatives to solve conflicts with lastlog2

I found that the lastlog2 have been merged into util-linux:
https://github.com/thkukuk/lastlog2/commit/60bea9dcee0fa18ea3dce0372a14f5e4f177ada6

There are two solutions:
1. delete lastlog2
2. Add RCONFLICTS option for control

Which option is better to choose? Or if there are any other better suggestions, please let me know

--
Best Regards
---------------------------------------------------
Wang Mingyu
FUJITSU NANJING SOFTWARE TECHNOLOGY CO., LTD. (FNST) No.6 Wenzhu Road, Nanjing, 210012, China TEL:+86+25-86630566--8568
COINS: 79988548
FAX: +86+25-83317685
MAIL: [email protected]

Quoted 67 lines

-----Original Message-----
From: Alexander Kanavin <[email protected]>
Sent: Wednesday, August 28, 2024 4:32 PM
To: Wang, Mingyu/王 鸣瑜 <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core] [PATCH] util-linux: use update-alternatives to solve conflicts with lastlog2

I don't think this is the right way to resolve the problem. You should be installing one or the other, but not both.

Alex

Quoted 5 lines · wangmy via lists.openembedded.org

From: Wang Mingyu <[email protected]>

Error: Transaction test error:
file /usr/bin/lastlog2 conflicts between attempted installs of

lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64

Quoted 5 lines

file /usr/lib/security/pam_lastlog2.so conflicts between attempted
installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64

lastlog2 also uses the doc '/usr/bin/lastlog2' and

'/usr/lib/security/pam_lastlog2.so'.

meta/recipes-core/util-linux/util-linux_2.40.2.bb ALTERNATIVE_LINK_NAME[unshare] =

Quoted 13 lines

lastlog2 has a priority of 100.

---
 meta/recipes-core/util-linux/util-linux_2.40.2.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-core/util-linux/util-linux_2.40.2.bb +0 -0
index a8e346539a..e21a16ab84 100644
@@ -298,6 +298,10 @@ ALTERNATIVE_LINK_NAME[unshare] =

"${bindir}/unshare"

meta/recipes-core/util-linux/util-linux_2.40.2.bb ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"

Quoted 7 lines
meta/recipes-core/util-linux/util-linux_2.40.2.bb +4 -0
 ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump"
 ALTERNATIVE_LINK_NAME[uuidgen] = "${bindir}/uuidgen"
 ALTERNATIVE_LINK_NAME[wall] = "${bindir}/wall"
+ALTERNATIVE:${PN}-lastlog2 = "lastlog2 pam_lastlog2"
+ALTERNATIVE_LINK_NAME[lastlog2] = "${bindir}/lastlog2"
+ALTERNATIVE_TARGET[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
+ALTERNATIVE_LINK_NAME[pam_lastlog2] =

"${libdir}/security/pam_lastlog2.so"

Quoted 18 lines
meta/recipes-core/util-linux/util-linux_2.40.2.bb +0 -1
 ALTERNATIVE:${PN}-doc = "\
 blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 libblkid.3
 logger.1 mesg.1 \
--

2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#203870):
https://lists.openembedded.org/g/openembedded-core/message/203870
Mute This Topic: https://lists.openembedded.org/mt/108138530/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw

Re: [OE-core] [PATCH] util-linux: use update-alternatives to solve conflicts with lastlog2

Quoted 8 lines · Mingyu Wang (Fujitsu)

I found that the lastlog2 have been merged into util-linux:
https://github.com/thkukuk/lastlog2/commit/60bea9dcee0fa18ea3dce0372a14f5e4f177ada6

There are two solutions:
1. delete lastlog2
2. Add RCONFLICTS option for control

Which option is better to choose? Or if there are any other better suggestions, please let me know

Option 1 please. Send a patch to meta-openembedded that deletes the recipe.

Alex

#5 lore raw
In reply to [email protected]

This is really not the right way to resolve the issue: both recipes install files into this directory and expect those files to be present where they put them.

Is the real solution installing systemd or polkit but not both maybe? Or if you need both, then you should look into why package manager thinks they conflict in trying to create that directory.

Alex

Quoted 50 lines · wangmy via lists.openembedded.org

From: Wang Mingyu <[email protected]>

Error: Transaction test error:
file /usr/share/polkit-1/rules.d conflicts between attempted installs of polkit-125-r0.core2_64 and systemd-1:256.5-r0.core2_64

polkit also uses the doc '/usr/share/polkit-1/rules.d'. polkit has a priority of 100.

---
 meta/recipes-core/systemd/systemd_256.5.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_256.5.bb +5 -2
index ee656c81e5..1c408d075f 100644
@@ -848,7 +848,7 @@ python do_warn_musl() {
 }
 addtask warn_musl before do_configure
 
-ALTERNATIVE:${PN} = "halt reboot shutdown poweroff runlevel ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
+ALTERNATIVE:${PN} = "halt reboot shutdown poweroff runlevel rules.d ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
 
 ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
 ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
@@ -874,6 +874,10 @@ ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
 ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
 ALTERNATIVE_PRIORITY[runlevel] ?= "300"
 
+ALTERNATIVE_TARGET[rules.d] = "${datadir_native}/polkit-1/rules.d"
+ALTERNATIVE_LINK_NAME[rules.d] = "${datadir_native}/polkit-1/rules.d"
+ALTERNATIVE_PRIORITY[rules.d] ?= "50"
+
 pkg_postinst:${PN}:libc-glibc () {
        if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then
                sed -e '/^hosts:/s/\s*\<myhostname\>//' \
--

2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203869): https://lists.openembedded.org/g/openembedded-core/message/203869
Mute This Topic: https://lists.openembedded.org/mt/108138529/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#6 lore raw

The name of /usr/share/polkit-1/rules.d are the same, but the files contained in the path are different. What methods can be chosen to solve this problem in this situation?

--
Best Regards
---------------------------------------------------
Wang Mingyu
FUJITSU NANJING SOFTWARE TECHNOLOGY CO., LTD. (FNST) No.6 Wenzhu Road, Nanjing, 210012, China TEL:+86+25-86630566--8568
COINS: 79988548
FAX: +86+25-83317685
MAIL: [email protected]

Quoted 76 lines

-----Original Message-----
From: Alexander Kanavin <[email protected]>
Sent: Wednesday, August 28, 2024 4:36 PM
To: Wang, Mingyu/王 鸣瑜 <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] [OE-core] [PATCH] systemd: use update-alternatives to solve conflicts with polkit

This is really not the right way to resolve the issue: both recipes install files into this directory and expect those files to be present where they put them.

Is the real solution installing systemd or polkit but not both maybe? Or if you need both, then you should look into why package manager thinks they conflict in trying to create that directory.

Alex

Quoted 23 lines · wangmy via lists.openembedded.org

From: Wang Mingyu <[email protected]>

Error: Transaction test error:
file /usr/share/polkit-1/rules.d conflicts between attempted
installs of polkit-125-r0.core2_64 and systemd-1:256.5-r0.core2_64

polkit also uses the doc '/usr/share/polkit-1/rules.d'. polkit has a priority of 100.

---
 meta/recipes-core/systemd/systemd_256.5.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_256.5.bb +0 -0
index ee656c81e5..1c408d075f 100644
@@ -848,7 +848,7 @@ python do_warn_musl() {  }  addtask warn_musl

before do_configure

Quoted 1 line

-ALTERNATIVE:${PN} = "halt reboot shutdown poweroff runlevel

${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"

Quoted 1 line

+ALTERNATIVE:${PN} = "halt reboot shutdown poweroff runlevel rules.d

${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"

meta/recipes-core/systemd/systemd_256.5.bb ALTERNATIVE_TARGET[runlevel] =

Quoted 4 lines

ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd" ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"

meta/recipes-core/systemd/systemd_256.5.bb +0 -0
@@ -874,6 +874,10 @@ ALTERNATIVE_TARGET[runlevel] =

"${base_bindir}/systemctl"

meta/recipes-core/systemd/systemd_256.5.bb ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"

Quoted 9 lines
meta/recipes-core/systemd/systemd_256.5.bb +4 -0
 ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
 ALTERNATIVE_PRIORITY[runlevel] ?= "300"
 
+ALTERNATIVE_TARGET[rules.d] = "${datadir_native}/polkit-1/rules.d"
+ALTERNATIVE_LINK_NAME[rules.d] = "${datadir_native}/polkit-1/rules.d"
+ALTERNATIVE_PRIORITY[rules.d] ?= "50"
+
 pkg_postinst:${PN}:libc-glibc () {
        if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true',

'false', d)}; then

Quoted 15 lines
meta/recipes-core/systemd/systemd_256.5.bb +0 -1
                sed -e '/^hosts:/s/\s*\<myhostname\>//' \
--

2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#203869):
https://lists.openembedded.org/g/openembedded-core/message/203869
Mute This Topic: https://lists.openembedded.org/mt/108138529/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#7 lore raw
Quoted 3 lines · Mingyu Wang (Fujitsu)

The name of /usr/share/polkit-1/rules.d are the same, but the files contained in the path are different. What methods can be chosen to solve this problem in this situation?

Are you using package_rpm and dnf to compose the image? If so, you can look at the spec files used to produce the packages in ${WORKDIR} of systemd and polkit to see how /usr/share/polkit-1/rules.d is specified in both. It might be that permissions or ownership are different and dnf can't resolve that.

Alex

#8 lore raw

| Are you using package_rpm and dnf to compose the image? Yes.

I checked the permission of rules.d, they are different:

systemd: %attr(700,polkitd,root) %dir "/usr/share/polkit-1/rules.d" 
polkit:  %attr(755,root,root) %dir "/usr/share/polkit-1/rules.d"

If the permission need to be unified, which one should be unified into?

--
Best Regards
---------------------------------------------------
Wang Mingyu
FUJITSU NANJING SOFTWARE TECHNOLOGY CO., LTD. (FNST) No.6 Wenzhu Road, Nanjing, 210012, China TEL:+86+25-86630566--8568
COINS: 79988548
FAX: +86+25-83317685
MAIL: [email protected]

Quoted 21 lines

-----Original Message-----
From: Alexander Kanavin <[email protected]>
Sent: Wednesday, August 28, 2024 5:15 PM
To: Wang, Mingyu/王 鸣瑜 <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] [OE-core] [PATCH] systemd: use update-alternatives to solve conflicts with polkit

Quoted 2 lines · Mingyu Wang (Fujitsu)

The name of /usr/share/polkit-1/rules.d are the same, but the files contained

in the path are different.

Quoted 1 line

What methods can be chosen to solve this problem in this situation?

Are you using package_rpm and dnf to compose the image? If so, you can look at the spec files used to produce the packages in ${WORKDIR} of systemd and polkit to see how /usr/share/polkit-1/rules.d is specified in both. It might be that permissions or ownership are different and dnf can't resolve that.

Alex

#9 lore raw
Quoted 10 lines · wangmy via lists.openembedded.org

| Are you using package_rpm and dnf to compose the image? Yes.

I checked the permission of rules.d, they are different:

systemd: %attr(700,polkitd,root) %dir "/usr/share/polkit-1/rules.d"
polkit:  %attr(755,root,root) %dir "/usr/share/polkit-1/rules.d"

If the permission need to be unified, which one should be unified into?

Stricter is better so 700 seems good from security pov but we need to ensure it works with polkit

Quoted 51 lines

--
Best Regards
---------------------------------------------------
Wang Mingyu
FUJITSU NANJING SOFTWARE TECHNOLOGY CO., LTD. (FNST) No.6 Wenzhu Road, Nanjing, 210012, Chi
<https://www.google.com/maps/search/6+Wenzhu+Road,+Nanjing,+210012,+Chi?entry=gmail&source=g>
na
TEL:+86+25-86630566--8568
COINS: 79988548
FAX: +86+25-83317685
MAIL: [email protected]

Quoted 6 lines

-----Original Message-----
From: Alexander Kanavin <[email protected]>
Sent: Wednesday, August 28, 2024 5:15 PM
To: Wang, Mingyu/王 鸣瑜 <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] [OE-core] [PATCH] systemd: use update-alternatives

to

Quoted 6 lines

solve conflicts with polkit

Quoted 2 lines · Mingyu Wang (Fujitsu)

The name of /usr/share/polkit-1/rules.d are the same, but the files

contained

Quoted 4 lines

in the path are different.

Quoted 1 line

What methods can be chosen to solve this problem in this situation?

Are you using package_rpm and dnf to compose the image? If so, you can

look at

Quoted 2 lines

the spec files used to produce the packages in ${WORKDIR} of systemd and polkit to see how /usr/share/polkit-1/rules.d is specified in both. It

might be that

Quoted 3 lines

permissions or ownership are different and dnf can't resolve that.

Alex

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#203898):
https://lists.openembedded.org/g/openembedded-core/message/203898
Mute This Topic: https://lists.openembedded.org/mt/108138529/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#10 lore raw

Hi Khem, the owner/permission change is from the following commit in meta-oe:

commit 6da0fd21c900e32a0693a6b27d38182f19c8c76c

Author: Luca Boccassi [email protected]<mailto:[email protected]>
Date:   Mon Aug 12 12:15:40 2024 +0100

polkit: stop overriding DAC on /usr/share/polkit-1/rules.d

This is no longer required by upstream for data in /usr/, as it ships in packages so there's no point hiding its content. Still required for
/etc/ as that's for local modifications.

So either other recipes (e.g., systemd) adapt to this change, or we revert this change.

Regards,
Qi

From: [email protected] <[email protected]> On Behalf Of Khem Raj
Sent: Thursday, August 29, 2024 9:46 AM
To: [email protected]
Cc: Alexander Kanavin <[email protected]>; [email protected]
Subject: Re: [PATCH] [OE-core] [PATCH] systemd: use update-alternatives to solve conflicts with polkit

On Wed, Aug 28, 2024 at 6:22 PM wangmy via lists.openembedded.org<https://urldefense.com/v3/__http:/lists.openembedded.org__;!!AjveYdw8EvQ!bnEcUpbumHuTlZhWSalUVRI5pENjFzvB8Dyo_0Apcb-ZwHemDqMVurWfDumRGTuJgEI3jeBx76OPe_C8xDKFuw$> <[email protected]<mailto:[email protected]>> wrote:
| Are you using package_rpm and dnf to compose the image?
Yes.

I checked the permission of rules.d, they are different:

systemd: %attr(700,polkitd,root) %dir "/usr/share/polkit-1/rules.d"
polkit:  %attr(755,root,root) %dir "/usr/share/polkit-1/rules.d"

If the permission need to be unified, which one should be unified into?

Stricter is better so 700 seems good from security pov but we need to ensure it works with polkit

--
Best Regards
---------------------------------------------------
Wang Mingyu
FUJITSU NANJING SOFTWARE TECHNOLOGY CO., LTD. (FNST)
No.6 Wenzhu Road, Nanjing, 210012, Chi<https://urldefense.com/v3/__https:/www.google.com/maps/search/6*Wenzhu*Road,*Nanjing,*210012,*Chi?entry=gmail&source=g__;KysrKys!!AjveYdw8EvQ!bnEcUpbumHuTlZhWSalUVRI5pENjFzvB8Dyo_0Apcb-ZwHemDqMVurWfDumRGTuJgEI3jeBx76OPe_BzmA8PRQ$>na TEL:+86+25-86630566--8568
COINS: 79988548
FAX: +86+25-83317685
MAIL: [email protected]<mailto:[email protected]>

Quoted 21 lines

-----Original Message-----
From: Alexander Kanavin <[email protected]<mailto:[email protected]>>
Sent: Wednesday, August 28, 2024 5:15 PM
To: Wang, Mingyu/王 鸣瑜 <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [PATCH] [OE-core] [PATCH] systemd: use update-alternatives to solve conflicts with polkit

Quoted 2 lines · On Wed, 28 Aug 2024 at 11:04, Mingyu Wang (Fujitsu)…

The name of /usr/share/polkit-1/rules.d are the same, but the files contained

in the path are different.

Quoted 1 line

What methods can be chosen to solve this problem in this situation?

Are you using package_rpm and dnf to compose the image? If so, you can look at the spec files used to produce the packages in ${WORKDIR} of systemd and polkit to see how /usr/share/polkit-1/rules.d is specified in both. It might be that permissions or ownership are different and dnf can't resolve that.

Alex