Add polkit action for Wi-Fi scans

Previously, Wi-Fi scans uses polkit action
"org.freedesktop.NetworkManager.network-control". This is introduced
in commit 5e3e19d0. But in a system with restrict polkit rules, for
example "org.freedesktop.NetworkManager.network-control" was set as
auth_admin. When you open the network panel of GNOME Control Center, a
polkit dialog will keep showing up asking for admin password, as GNOME
Control Center scans the Wi-Fi list every 15 seconds.

Fix that by adding a new polkit action
"org.freedesktop.NetworkManager.wifi.scan" so that distributions can
add specific rule to allow Wi-Fi scans.

[thaller@redhat.com: fix macro in "shared/nm-common-macros.h"]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/68
This commit is contained in:
Jonathan Kang
2019-01-25 14:33:11 +08:00
committed by Thomas Haller
parent 696cf38f45
commit 243af16c5b
7 changed files with 20 additions and 3 deletions

View File

@@ -74,6 +74,16 @@
</defaults>
</action>
<action id="org.freedesktop.NetworkManager.wifi.scan">
<_description>Allow control of Wi-Fi scans</_description>
<_message>System policy prevents Wi-Fi scans</_message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="org.freedesktop.NetworkManager.wifi.share.protected">
<_description>Connection sharing via a protected Wi-Fi network</_description>
<_message>System policy prevents sharing connections via a protected Wi-Fi network</_message>