Bug 1229861 - NetworkManager.conf sensitive to trailing spaces
Summary: NetworkManager.conf sensitive to trailing spaces
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Thomas Haller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-09 19:25 UTC by Matthew Miller
Modified: 2015-10-04 22:52 UTC (History)
6 users (show)

Fixed In Version: NetworkManager-1.0.6-6.fc22
Clone Of:
Environment:
Last Closed: 2015-10-04 22:52:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Matthew Miller 2015-06-09 19:25:02 UTC
Description of problem:

I swear this was working before today's, but maybe I accidentally messed it up when playing with "dns=unbound". I apparently had the line "dhcp=internal   " with trailing spaces, and that caused all connections to fail, with the warning 

  <warn>  No usable DHCP client found ('internal   ' support not found or not enabled.)! DHCP configurations will fail.

And it took me a little bit to figure out that it was just the spaces. Could NetworkManager strip trailing (and for that matter leading) whitespace?


Version-Release number of selected component (if applicable):

NetworkManager-1.0.2-1.fc22.x86_64

How reproducible:

easy

Steps to Reproduce:
1. put "dhcp=internal     " in NetworkManager.conf
2. restart NM
3. watch it fail with the above error

Actual results:

Warning that "internal    " can't be found, network all broken.

Expected results:

"internal" used, and works.

Additional info:

Comment 1 Jirka Klimes 2015-06-15 10:46:58 UTC
Pushed upstream branches fixing the issue:
jk/strip-cfg-values-rh1229861            (master)
jk/strip-cfg-values-rh1229861-nm-1-0     (nm-1-0))
jk/strip-cfg-values-rh1229861-1.0.2      (for 1.0.2 release, applicable to F22)

Fedora 22 scratch build:
http://koji.fedoraproject.org/koji/taskinfo?taskID=10057634

Comment 2 Beniamino Galvani 2015-06-15 14:25:25 UTC
There are some other options in src/nm-config.c that probably need the same fix.

Comment 3 Thomas Haller 2015-06-16 11:43:08 UTC
Upstream branch is https://bugzilla.gnome.org/show_bug.cgi?id=750659


this conflicts with th/nm-config-intern-bgo750558.


For one, we should get clear about when to use g_key_file_get_value() vs. g_key_file_get_string(). In many cases, get_string() is more appropriate.
A patch on th/nm-config-intern-bgo750558 fixes that.

For example:
  priv->connectivity.uri = g_key_file_get_value (priv->keyfile, "connectivity", 
is wrong.





I think NMConfig we should only strip properties, where we know the meaning of it.

+    priv->connectivity.uri = _key_file_get_value_strip (priv->keyfile, "connectivity", "uri", NULL);

is good, because we know we have the URI at hand, stripping is appropriate.

For nm_config_data_get_connection_default() it isn't because we don't know what we are about to strip. E.g. stripping 802-11-wireless-security.psk is wrong.

Comment 4 Jirka Klimes 2015-06-16 13:55:33 UTC
(In reply to Thomas Haller from comment #3)
> Upstream branch is https://bugzilla.gnome.org/show_bug.cgi?id=750659
> 
> 
> this conflicts with th/nm-config-intern-bgo750558.
> 
Then just take the bug.

Comment 5 Dan Williams 2015-06-18 21:36:05 UTC
Should read_config() also strip the values when merging settings?  We might as well just use the new function everywhere we used to call g_key_file_get_value()

Comment 6 Thomas Haller 2015-06-26 12:28:17 UTC
(In reply to Jirka Klimes from comment #4)
> (In reply to Thomas Haller from comment #3)
> > Upstream branch is https://bugzilla.gnome.org/show_bug.cgi?id=750659
> > 
> > 
> > this conflicts with th/nm-config-intern-bgo750558.
> > 
> Then just take the bug.

Taken. See th/nm-config-intern-bgo750558.

Comment 7 Thomas Haller 2015-07-07 14:00:58 UTC
th/nm-config-intern-bgo750558 got merged upstream (in two parts).

master:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=65753dbc133f77ccd5531288aab9a9e80da3b786
http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=05db3ee08a30edc503e2b9033993ee3d2cbf019f


the first part fixes this bug and was backported to nm-1-0:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=cf15f2a4a82f085d67f54f49ab9355d0d40c0969



ATM there is no RHEL-7.2 build yet (but coming).

Comment 8 Fedora Update System 2015-08-23 01:49:15 UTC
NetworkManager-1.0.6-0.2.20150813git7e2caa2.fc22, network-manager-applet-1.0.4-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update network-manager-applet NetworkManager'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-10143

Comment 9 Fedora Update System 2015-09-02 16:21:50 UTC
NetworkManager-1.0.6-2.fc22, NetworkManager-openswan-1.0.6-2.fc22, NetworkManager-openvpn-1.0.6-3.fc22, NetworkManager-vpnc-1.0.6-3.fc22, network-manager-applet-1.0.6-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update network-manager-applet NetworkManager-openvpn NetworkManager-vpnc NetworkManager NetworkManager-openswan'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-10143

Comment 10 Fedora Update System 2015-09-08 11:14:47 UTC
NetworkManager-1.0.6-3.fc22 NetworkManager-openswan-1.0.6-2.fc22 NetworkManager-openvpn-1.0.6-3.fc22 NetworkManager-vpnc-1.0.6-3.fc22 network-manager-applet-1.0.6-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-10143

Comment 11 Fedora Update System 2015-09-08 21:26:26 UTC
NetworkManager-1.0.6-4.fc22, NetworkManager-openswan-1.0.6-2.fc22, NetworkManager-openvpn-1.0.6-3.fc22, NetworkManager-vpnc-1.0.6-3.fc22, network-manager-applet-1.0.6-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update network-manager-applet NetworkManager NetworkManager-openvpn NetworkManager-openswan NetworkManager-vpnc'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-10143

Comment 12 Fedora Update System 2015-09-28 21:01:02 UTC
NetworkManager-1.0.6-6.fc22 NetworkManager-openswan-1.0.6-2.fc22 NetworkManager-openvpn-1.0.6-3.fc22 NetworkManager-vpnc-1.0.6-3.fc22 network-manager-applet-1.0.6-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-10143

Comment 13 Fedora Update System 2015-10-02 03:49:32 UTC
NetworkManager-1.0.6-6.fc22, NetworkManager-openswan-1.0.6-2.fc22, NetworkManager-openvpn-1.0.6-3.fc22, NetworkManager-vpnc-1.0.6-3.fc22, network-manager-applet-1.0.6-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update NetworkManager-openswan network-manager-applet NetworkManager NetworkManager-openvpn NetworkManager-vpnc'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-10143

Comment 14 Fedora Update System 2015-10-04 22:52:16 UTC
NetworkManager-1.0.6-6.fc22, NetworkManager-openswan-1.0.6-2.fc22, NetworkManager-openvpn-1.0.6-3.fc22, NetworkManager-vpnc-1.0.6-3.fc22, network-manager-applet-1.0.6-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.