After update i cant shutdown/reboot, even after i create file with rules in: /usr/local/etc/polkit-1/rules.d/ Aug 18 09:22:37 rimwks polkitd[1085]: Loading rules from directory /usr/local/etc/polkit-1/rules.d Aug 18 09:22:37 rimwks polkitd[1085]: Error opening rules directory: Error opening directory '/usr/local/etc/polkit-1/rules.d': Permission denied (g-file-error-quark, 2) Aug 18 09:22:37 rimwks polkitd[1085]: Loading rules from directory /usr/local/share/polkit-1/rules.d ls /usr/local/etc/ ... drwx------ 3 root wheel 512B Aug 18 05:02:57 2015 polkit-1/ ... ls /usr/local/etc/polkit-1/ total 12 drwx------ 3 root wheel 512B Aug 18 05:02:57 2015 ./ drwxr-xr-x 34 root wheel 2.0K Aug 19 20:04:09 2015 ../ drwx------ 2 polkitd wheel 512B Aug 18 05:03:22 2015 rules.d/
fix: chown polkitd:wheel /usr/local/etc/polkit-1/
Created attachment 163339 [details] pkg-plist patch Here's a possible fix to the problem of creating 'rules.d' directory structure under 'polkit-1' that is accessible to only 'polkitd', while the 'polkit-1' directory is only accessible to root. Alternative perhaps the two directories should have the default perms, to be like 'localauthority' structure.
The fix suggested is not working on FreeBSD 11 with polkit-0.113_1. Maybe because the structure of dirs has changed.
I have tested again and I run: # pkg info -D xfce4-session Copy the rule suggested to shutdown to: /usr/local/etc/polkit-1/rules.d/50-HOSTNAME.rules where HOSTNAME I replace by my hostname. Replace PUTYOURGROUPHERE by wheel and double check if the user that must can shutdown is in group wheel, otherwise add. Run # chown polkitd:wheel /usr/local/etc/polkit-1 An then, I have restarted hald and dbus. So, I did login with my user. The xfce4 nows enable the poweroff button. Click with right button, properties and check restart. I have tested on FreeBSD 10 and 11 and it works.
A commit references this bug: Author: woodsb02 Date: Sun Feb 12 15:50:52 UTC 2017 New revision: 433951 URL: https://svnweb.freebsd.org/changeset/ports/433951 Log: sysutils/polkit: Fix directory permissions to allow reading config files If the $LOCALBASE/etc/polkit-1 directory is owned by root and set 700, then polkit which is running as the polkitd user cannot read the config files in $LOCALBASE/etc/polkit-1/rules.d/* resulting in this error: Loading rules from directory /usr/local/etc/polkit-1/rules.d Error opening rules directory: Error opening directory \ '/usr/local/etc/polkit-1/rules.d': Permission denied \ (g-file-error-quark, 2) Loading rules from directory /usr/local/share/polkit-1/rules.d To fix this, change the $LOCALBASE/etc/polkit-1 to be set 755, and the $LOCALBASE/etc/polkit-1/localauthority to be set 700. This was sense checked with Fedora Linux which does the same, and with Debian/Ubuntu which have /etc/polkit-1/localauthority as owned by root:polkitd and set 750. PR: 202615 Reported by: rozhuk.im@gmail.com Changes: head/sysutils/polkit/Makefile head/sysutils/polkit/pkg-plist
Committed the fix to the ports head branch - thanks for reporting this. Will merge to the ports quarterly branch soon.
A commit references this bug: Author: woodsb02 Date: Tue Feb 14 10:34:30 UTC 2017 New revision: 434073 URL: https://svnweb.freebsd.org/changeset/ports/434073 Log: MFH: r433951 sysutils/polkit: Fix directory permissions to allow reading config files If the $LOCALBASE/etc/polkit-1 directory is owned by root and set 700, then polkit which is running as the polkitd user cannot read the config files in $LOCALBASE/etc/polkit-1/rules.d/* resulting in this error: Loading rules from directory /usr/local/etc/polkit-1/rules.d Error opening rules directory: Error opening directory \ '/usr/local/etc/polkit-1/rules.d': Permission denied \ (g-file-error-quark, 2) Loading rules from directory /usr/local/share/polkit-1/rules.d To fix this, change the $LOCALBASE/etc/polkit-1 to be set 755, and the $LOCALBASE/etc/polkit-1/localauthority to be set 700. This was sense checked with Fedora Linux which does the same, and with Debian/Ubuntu which have /etc/polkit-1/localauthority as owned by root:polkitd and set 750. PR: 202615 Reported by: rozhuk.im@gmail.com Approved by: ports-secteam (junovitch) Changes: _U branches/2017Q1/ branches/2017Q1/sysutils/polkit/Makefile branches/2017Q1/sysutils/polkit/pkg-plist