Polkit pkla 规则在 18.04 上不起作用

Polkit pkla 规则在 18.04 上不起作用

我有麻烦Gnome 3.28.1 上有臭名昭著的 colord 策略提示。使用同一系统上的 XFCE 桌面时,我没有遇到这样的问题。

我通过 xrdp 工作,并且总是此提示我无法禁用它。

每当我改变<action id="org.freedesktop.color-manager.create-device">政策/usr/share/polkit-1/actions/org.freedesktop.color.policy<allow_any>yes</allow_any>在日志中收到 Gnome 致命错误。

更新WinEunuuchs2Unix 建议后的日志:

gsd-media-keys[1099]: Unable to inhibit keypresses: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied
gsd-sharing[1059]: Failed to StopUnit service: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit gnome-user-share-webdav.service not loaded.
gsd-sharing[1059]: Failed to StopUnit service: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit rygel.service not loaded.
gsd-sharing[1059]: Failed to StopUnit service: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit gnome-remote-desktop.service not loaded.
gsd-sharing[1059]: Failed to StopUnit service: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit vino-server.service not loaded.
gnome-session-binary[877]: Entering running state
dbus-daemon[867]: [session uid=1000 pid=867] Successfully activated service 'org.gnome.evolution.dataserver.Calendar7'
systemd[847]: Started Evolution calendar service.
dbus-daemon[867]: [session uid=1000 pid=867] Activating service name='ca.desrt.dconf' requested by ':1.56' (uid=1000 pid=1176 comm="/usr/lib/evolution/evolution-calendar-factory-subp" label="unconfined")
dbus-daemon[867]: [session uid=1000 pid=867] Activating via systemd: service name='org.gnome.evolution.dataserver.AddressBook9' unit='evolution-addressbook-factory.service' requested by ':1.56' (uid=1000 pid=1176 comm="/usr/lib/evolution/evolution-calendar-factory-subp" label="unconfined")
systemd[847]: Starting Evolution address book service...
dbus-daemon[867]: [session uid=1000 pid=867] Successfully activated service 'ca.desrt.dconf'
dbus-daemon[867]: [session uid=1000 pid=867] Successfully activated service 'org.gnome.evolution.dataserver.AddressBook9'
systemd[847]: Started Evolution address book service.
gnome-shell[922]: Error looking up permission: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.impl.portal.PermissionStore was not provided by any .service files
kerneloops-appl[1152]: Failed to load module "canberra-gtk-module"
gsd-color[1088]: failed to get edid: unable to get EDID for output
colord[1140]: failed to get seat for session c1 [pid 1088]: No data available
gnome-shell[922]: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
gsd-color[1088]: unable to get EDID for xrandr-rdp0: unable to get EDID for output
kernel: [  213.817502] do_trap: 20 callbacks suppressed
kernel: [  213.817504] traps: gsd-color[1088] trap divide error ip:5592b1f5c94a sp:7fffbcc03a90 error:0 in gsd-color[5592b1f53000+12000]
gnome-shell[922]: Could not get current seat: No data available
gnome-shell[922]: GNOME Shell started at Mon May 21 2018 12:06:54 GMT+0300 (EEST)
gnome-session[877]: gnome-session-binary[877]: WARNING: Application 'org.gnome.SettingsDaemon.Color.desktop' killed by signal 8
gnome-session-binary[877]: WARNING: Application 'org.gnome.SettingsDaemon.Color.desktop' killed by signal 8
gsd-color[1240]: failed to get edid: unable to get EDID for output
colord[1140]: failed to get seat for session c1 [pid 1240]: No data available
gsd-color[1240]: unable to get EDID for xrandr-rdp0: unable to get EDID for output
kernel: [  220.142162] traps: gsd-color[1240] trap divide error ip:55c79912d94a sp:7ffcbd6a6020 error:0 in gsd-color[55c799124000+12000]
gnome-session[877]: gnome-session-binary[877]: WARNING: App 'org.gnome.SettingsDaemon.Color.desktop' respawning too quickly
gnome-session-binary[877]: WARNING: App 'org.gnome.SettingsDaemon.Color.desktop' respawning too quickly
gnome-session-binary[877]: Unrecoverable failure in required component org.gnome.SettingsDaemon.Color.desktop
gnome-session[877]: gnome-session-binary[877]: CRITICAL: We failed, but the fail whale is dead. Sorry....
gnome-session-binary[877]: CRITICAL: We failed, but the fail whale is dead. Sorry....
xrdp-sesman[846]: (846)(140561311482944)[CORE ] window manager (pid 859) did exit, cleaning up session
xrdp-sesman[846]: (846)(140561311482944)[INFO ] calling auth_stop_session and auth_end from pid 846
xrdp-sesman[846]: (846)(140561311482944)[DEBUG] cleanup_sockets:
xrdp-sesman[846]: (846)(140561311482944)[DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdp_chansrv_audio_out_socket_10
xrdp-sesman[846]: (846)(140561311482944)[DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdp_chansrv_audio_in_socket_10
xrdp-sesman[846]: (846)(140561311482944)[DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdpapi_10
xrdp-sesman[621]: (621)(140561311482944)[INFO ] ++ terminated session:  username xoob, display :10.0, session_pid 846, ip 192.168.1.100:7137 - socket: 12
xrdp[844]: (844)(140711347752192)[DEBUG] Closed socket 26 (AF_UNIX)
at-spi-bus-launcher[884]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":10.0"
at-spi-bus-launcher[884]:       after 23 requests (23 known processed) with 0 events remaining.
kernel: [  221.144168] gnome-shell[922]: segfault at 10 ip 00007fd88cb3712f sp 00007fff690fcac0 error 4 in libmutter-2.so.0.0.0[7fd88ca73000+156000]
gsd-power[1051]: gsd-power: Fatal IO error 11 (Resource temporarily unavailable) on X server :10.0.
gsd-xsettings[1069]: gsd-xsettings: Fatal IO error 11 (Resource temporarily unavailable) on X server :10.0.
gsd-wacom[1075]: gsd-wacom: Fatal IO error 11 (Resource temporarily unavailable) on X server :10.0.
gsd-clipboard[1084]: gsd-clipboard: Fatal IO error 11 (Resource temporarily unavailable) on X server :10.0.
gsd-media-keys[1099]: gsd-media-keys: Fatal IO error 11 (Resource temporarily unavailable) on X server :10.0.
gsd-keyboard[1093]: gsd-keyboard: Fatal IO error 11 (Resource temporarily unavailable) on X server :10.0.
kerneloops-applet.desktop[1152]: kerneloops-applet: Fatal IO error 11 (Resource temporarily unavailable) on X server :10.0.
conky.desktop[1150]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":10.0"
conky.desktop[1150]:       after 578 requests (578 known processed) with 0 events remaining.
xrdp[844]: (844)(140711347752192)[DEBUG] Closed socket 12 (AF_INET 192.168.1.201:7777)
xrdp[844]: (844)(140711347752192)[DEBUG] xrdp_mm_module_cleanup
xrdp[844]: (844)(140711347752192)[DEBUG] Closed socket 25 (AF_UNIX)

如果我只是尝试通过密码提示以交互方式登录,也会发生同样的情况。

我尝试在以下位置创建自定义 pkla 文件/var/lib/polkit-1/localauthority/50-local.d

<action id="org.freedesktop.color-manager.create-device">
  <description xml:lang="en">Create a color managed device</description>
  <message xml:lang="en">Authentication is required to create a color managed device</message>
  <defaults>
    <allow_any>yes</allow_inactive>
    <allow_inactive>yes</allow_inactive>
    <allow_active>yes</allow_active>
  </defaults>
</action>

在我看来,这相当于直接改变行动/usr/share/polkit-1/actions

我还尝试按照以下规则创建全局允许 pkla 规则这个建议

[No password prompt]
Identity=unix-group:sudo
Action=*
ResultActive=yes

我也有全球规则/etc/polkit-1/rules.d

polkit.addRule(function(action, subject) {
if (subject.isInGroup("group")) {
      return polkit.Result.YES;
   }
});

据我所知,如果我的 polkit < 0.106,则不会处理规则,应该使用 pkla 文件。如果我错了,请纠正我。我的pkaction --version节目0.105

以上方法均无效。我应该尝试哪些步骤以及如何调试?

答案1

我在 ubuntu 18.04 上遇到了无法从 ssh 会话连接到 vpn 的问题。该问题与 polkit 有关,因为

nmcli general permissions

显示缺乏权限。

我已成功使用以下方式在 ubuntu 18.04 中添加自定义 polkit 规则(仍然是 polkit 版本 0.105,不支持 javascript 规则)。以 root 身份执行以下命令:

 # cat > /etc/polkit-1/localauthority/50-local.d/allow-all-for-group-sudo-polkit105.pkla

并输入以下内容(注意,这允许 sudo 组用户执行所有操作,可能有风险):

[Allow all without authentication for members of sudo group even for ssh sessions]
Identity=unix-group:sudo
Action=*
ResultAny=yes

在这之后无需重新启动任何服务或重启我获得了从 ssh 使用任何 nmcli 命令的权限。

答案2

该问题与单项伽马坡道传递错误有关,而不是 256 项伽马坡道。该错误已修复在 xorgxrdp 版本 0.2.6 中。

答案3

检查 pkla 文件的语法。可能存在隐藏字符,导致 polkit 无法解析该文件。请参阅这里

相关内容