Re: NM: git HEAD breaks (wifi plugin not available), Debian source works



On Sun, Aug 17, 2014 at 2:33 PM, Thomas Haller <thaller redhat com> wrote:
On Sat, 2014-08-16 at 00:12 -0400, dwk wrote:
Hello NM folks,

This is an issue I encountered while trying to run the latest
NetworkManager. I am compiling the latest git HEAD, and I am compiling
from Debian's source; the latter works, but the git version refuses to
detect any network connections. In particular, when the git version is
run with debug enabled, I get some startup messages and then:

NetworkManager[26170]: <info>  (wlan0): 'wifi' plugin not available; creating generic device
NetworkManager[26170]: <info>  (wlan0): carrier is OFF
NetworkManager[26170]: <info>  (wlan0): new Generic device (driver: 'iwlwifi' ifindex: 2)
NetworkManager[26170]: <info>  (wlan0): exported as /org/freedesktop/NetworkManager/Devices/1

And nmcli shows that wlan0 is unmanaged. In comparison, the Debian
version runs quite well. The corresponding output is instead,


Since nm-0-9-10, support for wifi devices moved to a device plugin.

First you must make sure that you actually build with wifi support.
For example it should build a file:
  src/devices/wifi/.libs/libnm-device-plugin-wifi.so


Then on startup you should see lines like:

Aug 17 23:29:29 hal NetworkManager[12722]: <info>  Loaded device plugin: 
/usr/lib64/NetworkManager/libnm-device-plugin-adsl.so
Aug 17 23:29:29 hal NetworkManager[12722]: <info>  Loaded device plugin: 
/usr/lib64/NetworkManager/libnm-device-plugin-team.so
Aug 17 23:29:29 hal NetworkManager[12722]: <info>  Loaded device plugin: 
/usr/lib64/NetworkManager/libnm-device-plugin-wifi.so
Aug 17 23:29:29 hal NetworkManager[12722]: <info>  Loaded device plugin: 
/usr/lib64/NetworkManager/libnm-device-plugin-bluetooth.so
Aug 17 23:29:29 hal NetworkManager[12722]: <info>  Loaded device plugin: 
/usr/lib64/NetworkManager/libnm-device-plugin-wwan.so


Did you do `make install` when running NetworkManager?
You can also run NM from the source tree but maybe you have to take
care of setting the proper paths in the configure options.
I did do a make install, but to a local prefix (I set --prefix in my
configure flags). The issue was that the new NM code actually checks to
see if the plugin library files are owned by the root user, and refuses
to load them if this is not the case. For a local install, the libraries
will be owned by the local user.

If you want to support local installs, I suggest the following diff.
Stop checking for root user owning the library files, and warn if no
plugins were found (because then likely no devices will work):

diff --git a/src/nm-manager.c b/src/nm-manager.c
index b829c4c..26b98dc 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -1987,8 +1987,6 @@ read_device_factory_paths ()
                        goto continue_with_error;
                if (!S_ISREG (data.st.st_mode))
                        goto continue_silently;
-               if (data.st.st_uid != 0)
-                       goto continue_with_error;
                if (data.st.st_mode & (S_IWGRP | S_IWOTH | S_ISUID))
                        goto continue_with_error;

@@ -2022,8 +2020,10 @@ load_device_factories (NMManager *self)
        char **paths;

        paths = read_device_factory_paths ();
-       if (!paths)
+       if (!paths) {
+               nm_log_warn (LOGD_HW, "no device factory paths found,
will not load plugins");
                return;
+    }

        for (path = paths; *path; path++) {
                GError *error = NULL;


I suppose it may be a security risk to allow plugin files from any user
(even though the plugin directory should have restrictive permissions);
in that case, perhaps files owned by uid 0 or the current user should be
allowed.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]