On login, or when NetworkManager is restarted, an error message from PolicyKit 1 pops up:

System policy prevents enabling or disabling device statistics
An application is attempting to perform an action that requires privileges. Authentication is required to perform this action.
Password for root: ____
OK | Cancel

Call this Message 1.

On attempting to turn Airplane Mode on/off, two more messages pop up in sequence.

System policy prevents enabling or disabling Wi-Fi devices
An application is attempting to perform an action that requires privileges. Authentication is required to perform this action.
Password for root: ____
OK | Cancel
System policy prevents enabling or disabling mobile broadband devices
An application is attempting to perform an action that requires privileges. Authentication is required to perform this action.
Password for root: ____
OK | Cancel

Call these Messages 2A and 2B.

On attempting to connect to Wi-Fi, another message pops up.

System policy prevents control of network connections
An application is attempting to perform an action that requires privileges. Authentication is required to perform this action.
Password for root: ____
OK | Cancel

Call this Message 3.

Nothing happens (visibly) when message 1 is cancelled. When messages 2A and 2B are cancelled, airplane mode cannot be switched. Message 3 appears after I enter the Wi-Fi password. When message 3 is cancelled, Wi-Fi does not connect, and a notification appears.

Failed to add Network_SSID
Not authorized to control networking.

I have modified 2 files in /etc/polkit-1.

/etc/polkit-1/localauthority/50-local.d/10-allow-network-manager.pkla
[Network Manager all Users]
Identity=unix-user:*
Action=org.freedesktop.NetworkManager.*
ResultAny=no
ResultActive=yes
/etc/polkit-1/rules.d/10-org.freedesktop.NetworkManager.rules
polkit.addRule(function(action,subject) {
    if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {
        return polkit.Result.YES;
    }
});

My user is in the “network” group.

After making these modifications, messages 2A and 2B will still appear, but airplane mode will switch if they are cancelled. Messages 1 and 3 still appear.

I am on an Acer laptop, with OpenSUSE Tumbleweed and KDE.

What is the cause of this, and how can I fix it?

  • @LanisickeOP
    link
    11 year ago

    Bloody hell! Wi-fi requires root? It never used to on Debian Bullseye or OpenSUSE Leap 15.3 a few years ago.

    Network service: which one? Partial output of systemctl:

    NetworkManager.service  loaded active running
    network-pre.target      loaded active active
    network.target          loaded active active
    
    • Rustmilian
      link
      English
      1
      edit-2
      8 months ago

      You’re a little mislead here. WiFi doesn’t need root in the same way as running sudo program, it needs elevated privileges for some operations as the user-space bits needs to interact with the kernel APIs to tell it to run X code from the hardware driver to control the WiFi chip itself.
      It’s supposed to be handled by Polkit and Systemd out of the box without user input or configuration, but it looks like polkit might be miss configured in some way, or there’s a bug somewhere.

      systemctl status NetworkManager.service
      
      pkcheck