Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 921677 - sys-auth/polkit-123 cannot open /usr/share/polkit-1/rules.d resulting in no loaded actions
Summary: sys-auth/polkit-123 cannot open /usr/share/polkit-1/rules.d resulting in no l...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-09 18:30 UTC by Martin Kuchta
Modified: 2024-01-11 16:44 UTC (History)
1 user (show)

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


Attachments
emerge --info (emerge.info,6.66 KB, text/plain)
2024-01-09 18:30 UTC, Martin Kuchta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Kuchta 2024-01-09 18:30:33 UTC
Created attachment 881791 [details]
emerge --info

sys-auth/polkit cannot open /usr/share/polkit-1/rules.d resulting in no loaded rules. This happens with all the versions currently in tree.

Following error is logged:

polkitd[2981]: Error opening rules directory: Error opening directory “/usr/share/polkit-1/rules.d”: Permission denied (g-file-error-quark, 2)
polkitd[2981]: Finished loading, compiling and executing 0 rules

This happens despite the daemon running as polkitd user and the directory permissions being:

drwx------   2 polkitd root  4096 Jan  9 17:35 rules.d

I have re-emerged the system and then the world. I have tried downgrading but nothing changes. I have opened a thread on gentoo forums asking for advice but there is no reply.

https://forums.gentoo.org/viewtopic-p-8812531.html#8812531
Comment 1 Martin Kuchta 2024-01-11 14:29:06 UTC
Looks like the problem is in /usr/share being a symbolic link. Is there a way to make it work with symbolic links or is there a reason why it should not be?
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-11 14:37:12 UTC
What is /usr/share a symlink to on your system? Did you do it (which is fine, although interesting), or did something do it for you?

(Also, just reposting my own comment: we should check if this is related to the systemd unit hardeing in the newer versions.)
Comment 3 Martin Kuchta 2024-01-11 14:40:30 UTC
(In reply to Sam James from comment #2)
> What is /usr/share a symlink to on your system? Did you do it (which is
> fine, although interesting), or did something do it for you?
> 
> (Also, just reposting my own comment: we should check if this is related to
> the systemd unit hardeing in the newer versions.)

Thanks. Yes I did some years ago as I ran out of room on /

No problems until now.
Comment 4 Martin Kuchta 2024-01-11 14:43:33 UTC
(In reply to Sam James from comment #2)
> What is /usr/share a symlink to on your system? Did you do it (which is
> fine, although interesting), or did something do it for you?
> 
> (Also, just reposting my own comment: we should check if this is related to
> the systemd unit hardeing in the newer versions.)

Sorry, it points to /home/share where /home is a different partition than / on the same SSD.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-11 14:46:41 UTC
https://gitlab.freedesktop.org/polkit/polkit/-/commit/25eef55dddbf0b4d635fbdd508710b496be80d9c

Could you try the old version of the unit file?

That is, just something like:
```
[Unit]
Description=Authorization Manager
Documentation=man:polkit(8)

[Service]
Type=dbus
BusName=org.freedesktop.PolicyKit1
ExecStart=/usr/lib/polkit-1/polkitd --no-debug
User=polkitd
Group=polkitd
```
Comment 6 Martin Kuchta 2024-01-11 15:44:00 UTC
(In reply to Sam James from comment #5)
> https://gitlab.freedesktop.org/polkit/polkit/-/commit/
> 25eef55dddbf0b4d635fbdd508710b496be80d9c
> 
> Could you try the old version of the unit file?
> 
> That is, just something like:
> ```
> [Unit]
> Description=Authorization Manager
> Documentation=man:polkit(8)
> 
> [Service]
> Type=dbus
> BusName=org.freedesktop.PolicyKit1
> ExecStart=/usr/lib/polkit-1/polkitd --no-debug
> User=polkitd
> Group=polkitd
> ```

Yes, that works fine! Thank you. What a rabbit hole...
Comment 7 Martin Kuchta 2024-01-11 15:44:44 UTC
(In reply to Sam James from comment #5)
> https://gitlab.freedesktop.org/polkit/polkit/-/commit/
> 25eef55dddbf0b4d635fbdd508710b496be80d9c
> 
> Could you try the old version of the unit file?
> 
> That is, just something like:
> ```
> [Unit]
> Description=Authorization Manager
> Documentation=man:polkit(8)
> 
> [Service]
> Type=dbus
> BusName=org.freedesktop.PolicyKit1
> ExecStart=/usr/lib/polkit-1/polkitd --no-debug
> User=polkitd
> Group=polkitd
> ```

Heppy to do more testing if needed.
Comment 8 Mike Gilbert gentoo-dev 2024-01-11 16:30:55 UTC
I don't think systemd really supports having /usr/share as a symlink to protected locations like /home.

If you must maintain this setup, you will probably need to disable the ProtectHome setting in the polkit unit file.
Comment 9 Mike Gilbert gentoo-dev 2024-01-11 16:39:54 UTC
You might have better luck using a bind mount instead of a symlink.
Comment 10 Martin Kuchta 2024-01-11 16:44:07 UTC
(In reply to Mike Gilbert from comment #9)
> You might have better luck using a bind mount instead of a symlink.

Thank you. I will do that.