Comment 3 for bug 262817

Revision history for this message
TJ (tj) wrote :

Alexander, this affects the PPA 0.7~~svn20080928t225540+eni0-0ubuntu2~nm3~hardy1 package.

I'd been using my own variation of the 0.7 package but yesterday allowed it to upgrade to the network-manager PPA version. A few hours later after a system restart neither the wired or wireless interfaces could get a connection using NetworkManager.

I added an fprintf() to nm-dhc-client-action.c:main(), built, and installed. Then I renamed

/usr/lib/NetworkManager/nm-dhcp-client.action
 to
/usr/lib/NetworkManager/nm-dhcp-client.action.exe

and created a shell script in its place that sets up logging and then calls the original binary:

#!/bin/bash
exec >> /tmp/dhclient-debug.log 2>&1
set -x
/usr/lib/NetworkManager/nm-dhcp-client.action.exe
echo "exit code=$?"

The log reported:

+ /usr/lib/NetworkManager/nm-dhcp-client.action.exe
nm-dhcp-client-action.c::main(1, '/usr/lib/NetworkManager/nm-dhcp-client.action.exe')
Error: Could not acquire the NM DHCP client service. Message: (org.freedesktop.DBus.Error.AccessDenied) Connection ":1.4688" is not allowed to own the service "org.freedesktop.nm_dhcp_client" due to security policies in the configuration file
+ echo 'exit code=1'
exit code=1

The contents of /etc/dbus-1/system.d/nm-dhcp-client.conf on the system (and in the .deb) were:

<!DOCTYPE busconfig PUBLIC
 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
        <policy user="dhcp">
                <allow own="org.freedesktop.nm_dhcp_client"/>
  <allow send_interface="org.freedesktop.nm_dhcp_client"/>
        </policy>
        <policy context="default">
                <deny own="org.freedesktop.nm_dhcp_client"/>
  <deny send_interface="org.freedesktop.nm_dhcp_client"/>
        </policy>
</busconfig>

Before I found this bug report I then tried adding:

        <policy user="root">
                <allow own="org.freedesktop.nm_dhcp_client"/>
  <allow send_interface="org.freedesktop.nm_dhcp_client"/>
        </policy>

and restarted dbus.

NetworkManager immediately worked correctly.