Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPA_Supplicant DBUS Interface Permissions #6

Open
buildscientist opened this issue Jan 31, 2021 · 0 comments
Open

WPA_Supplicant DBUS Interface Permissions #6

buildscientist opened this issue Jan 31, 2021 · 0 comments

Comments

@buildscientist
Copy link
Contributor

buildscientist commented Jan 31, 2021

@mark2b Opening this up as an issue more for documentation purposes in case anyone else runs into this. I ran into this issue while developing a Go service using your library on Ubuntu. Likely not an issue on Raspberry PI OS since it doesn't use Polkit.

When using DBUS to manage wpa_supplicant some Linux distributions utilize Polkit (formerly known as PolicyKit) to manage permissions for processes that can interface directly with the bus.

This blog provides a good treatise on the subject matter. Developers running on Debian based distro's like Ubuntu will need to modify the /etc/dbus-1/system.d/wpa_supplicant.conf to allow your user (non-root) access to interface with dbus.

Add another <policy_user> block in addition to the existing one.

<busconfig>
        <policy user="yourUserName">
                <allow own="fi.w1.wpa_supplicant1"/>

                <allow send_destination="fi.w1.wpa_supplicant1"/>
                <allow send_interface="fi.w1.wpa_supplicant1"/>
                <allow receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
        </policy>
</busconfig>

Note the policy user you set should be identical to the owner of the process running the Go binary using the wpa-connect library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant