Commit Graph

13873 Commits

Author SHA1 Message Date
Jiří Klimeš
11cce07c66 Allow saving connection profile as temporary in nmcli (bgo #723175)
'nmcli con add' has a new '[save yes|no]' argument.
'nmcli con edit' 'save' command has changed to 'save [persistent|temporary]'.

https://bugzilla.gnome.org/show_bug.cgi?id=723175
2014-01-30 10:55:12 +01:00
Thomas Haller
6d25080e6a cli/bash-completion: complete 'save' option for nmcli connection add
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 10:49:51 +01:00
Jiří Klimeš
ec0f629ed2 cli: persistent vs. temporary save for 'nmcli con edit' 2014-01-30 10:49:51 +01:00
Jiří Klimeš
2d523bd800 cli: allow creating temporary (unsaved) connection with 'nmcli con add' 2014-01-30 10:49:51 +01:00
Thomas Haller
97ededafd9 libnm-glib: fix leak in nm_remote_connection_get_secrets
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 10:40:51 +01:00
Thomas Haller
fbdca67baa po: fix newline differences in translations
msgfmt fails if the newline of the message is not matched by the
translation. Fix it.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-29 15:13:58 +01:00
Krishna Babu K
4dabe28868 po: update Telugu (te) translation (bgo #723231)
https://bugzilla.gnome.org/show_bug.cgi?id=723231

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-29 13:57:49 +01:00
Rajesh Ranjan
7c7b026e9c po: update Hindi (hi) translation (bgo #723227)
https://bugzilla.gnome.org/show_bug.cgi?id=723227

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-29 13:21:42 +01:00
Hedda Peters
81ce43bdb8 po: update German (de) translation (bgo #723207)
https://bugzilla.gnome.org/show_bug.cgi?id=723207

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-29 10:08:31 +01:00
Thomas Haller
fa81901ed8 core/platform: replace strcpy by g_strlcpy
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-28 20:19:29 +01:00
Thomas Haller
c9e241e2f9 ifcfg-rh: change algorithm for svUnescape
The previous algorithm had runtime complexity O(n^2). Change
it to O(2*n).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-28 19:19:49 +01:00
Dan Winship
ff350c04c0 core: fix crash when connecting to new Wi-Fi network (bgo #723163)
If the user is AddAndActivating a new network, the connection may not
have an NMSettingConnection yet, but we know that once it does, the
user will be authorized.
2014-01-28 12:09:22 -05:00
Thomas Haller
9694723f08 tui/po: fix po/POTFILES.in referencing invalid file
Fix removing a file 36ed2e91bb.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-28 17:12:24 +01:00
Dan Winship
6096ba797f Import some libnm-gtk functionality into libnm-util/libnm-glib (bgo #720844)
nmtui was using local copies of some functions that were originally in
libnm-gtk. Move them into the appropriate places in libnm-util and
libnm-glib instead.
2014-01-27 15:41:55 -05:00
Thomas Haller
0ee3f23534 tui: use nm_remote_settings_get_connection_by_id()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-27 15:39:51 -05:00
Thomas Haller
f76934de15 libnm-glib: add function nm_remote_settings_get_connection_by_id()
Utility function, to search the list of connections for a connection
with a matching id/name. Returns the first match.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-27 15:39:51 -05:00
Dan Winship
36ed2e91bb tui: use the new libnm-util/libnm-glib device/connection utils
Use the new methods copied into libnm-util/libnm-glib from libnm-gtk,
and remove nmtui's local copies.
2014-01-27 15:39:51 -05:00
Dan Winship
f7b1b28202 libnm-util, libnm-glib: add device/connection describing functions
Add functions to describe and disambiguate devices and connections for
display to the user. Originally from libnm-gtk.
2014-01-27 15:39:51 -05:00
Dan Williams
078d177874 ifcfg-rh: add tests for Team master and port 2014-01-27 12:49:55 -06:00
Dan Williams
76c3bd9898 ifcfg-rh: unescape Team configuration (rh #1051517)
4f3a9cca6f stopped unescaping Team
configuration when reading ifcfg files due to inefficient algorithms
in svUnescape().  Unfortunately, since Team configuration is escaped
when written out, reading it in creates invalid configuration that
teamd rejects.

The pathological case was a 9MB invalid Team configuration. Since a
Team configuration will never, ever be that large, fix the issue by
warning the user or rejecting the configuration if it is over 20000
bytes in size (an arbitrary number).  Thus svUnescape() will never
be called with huge strings, but the configuration is still unescaped.

https://bugzilla.redhat.com/show_bug.cgi?id=1051517
2014-01-27 12:49:55 -06:00
Jiří Klimeš
df4c9347fc libnm-glib: chain up the parent constructed() of NMRemoteConnection 2014-01-27 17:39:29 +01:00
Jiří Klimeš
2c11fd477c introspection: add PropertiesChanged signal for o.f.N.Settings.Connection
Some users, e.g. libnm-glib's NMRemoteConnection, use it to get changes of
properties.
2014-01-27 17:39:22 +01:00
Jiří Klimeš
0bba6e77e5 man: update dispatcher scripts description in NetworkManager(8) manual page 2014-01-27 13:27:41 +01:00
Sandeep Shedmake
828da6e9ee po: update Marathi (mr) translation (bgo #723044)
https://bugzilla.gnome.org/show_bug.cgi?id=723044

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-26 21:48:30 +01:00
Nilamdyuti Goswami
59a585aeb5 po: update Assamese (as) translation (bgo #723006)
https://bugzilla.gnome.org/show_bug.cgi?id=723006

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-26 21:41:58 +01:00
Nilamdyuti Goswami
f2496dea8c po: update Assamese (as) translation (bgo #722966)
https://bugzilla.gnome.org/show_bug.cgi?id=722966

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-25 18:33:11 +01:00
Dan Williams
199ef9320e trivial: reorgranize some NMManager functions
No code changes at all, just moving GObject-related functions to
the bottom of the file per NM conventions.
2014-01-24 13:43:50 -06:00
Dan Williams
891dcfad7d core: more usage of g_signal_handlers_disconnect_by_func() 2014-01-24 13:43:46 -06:00
Dan Williams
505248b0ce core: use g_signal_handlers_disconnect_by_func() to simplify some code 2014-01-24 13:43:19 -06:00
Dan Williams
016dbcc99e core: provide useful error messages to main() on Manager creation failure 2014-01-24 13:14:05 -06:00
Dan Williams
e62b212be3 core: exit cleanly if D-Bus cannot be initialized (rh #1057738)
Instead of crashing, let's exit cleanly.
2014-01-24 13:14:04 -06:00
Dan Williams
c9b6f13c56 policy: fix policy after dcbw/kill-at-console merge (bgo #707983) (rh #979416)
Polkit documentation suggests that <allow_any> applies to all
clients, but that's actually not the case.  allow_any,
allow_inactive, and allow_active are evaluated individually based
on whether the user is local and active (allow_active), local and
inactive (allow_inactive), and not local (allow_any).  Thus all
three allow options must be specified for any authorization other
than 'no'.
2014-01-24 12:32:43 -06:00
Dan Williams
de56f28db6 merge: handle interface-less VPNs like open/libre-swan (bgo #721724) (rh #1030068)
IPSec-based VPNs that use the kernel IPSec functionality don't have tunnel
interfaces.  Instead, the IP addresses and routes they create are added
to the parent interface and the kernel handles securing the traffic based
on routing.  Modify NM to handle this.

Also modify NM to ensure it doesn't touch routes added externally, and to
preserve various route properties correctly.
2014-01-24 09:46:25 -06:00
Thomas Haller
8959b6dbcb core/platform: sort routes before adding them in nm_platform_ipX_route_sync()
A gateway route can only be added, if there exists a device route
for that gateway. Therefore, nm_platform_ip4_route_sync() and
nm_platform_ip6_route_sync() has to add the device routes first,
before adding gateway routes.

Note: usually for all configured addresses, there is also a device
route for the subnet added by the kernel. This means, NM must first
configure the addresses before route_sync, so that these implicit device
routes already exist -- this is however already done correctly.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-24 09:42:52 -06:00
Thomas Haller
c8d7a06d64 core/platform: revise failure to activate connection on error of setting route
This revises the commit fbde824584 which
causes the activation of a connection to fail generally when a route
cannot be added. Instead, we only want to fail for user configured
routes.

Related: https://bugzilla.gnome.org/show_bug.cgi?id=722843
Related: https://bugzilla.redhat.com/show_bug.cgi?id=999544
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1005416
Related: https://bugzilla.gnome.org/show_bug.cgi?id=721771

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-24 09:42:52 -06:00
Thomas Haller
29501c9955 core/platform: compare IPv4 addresses in nm_platform_ip4_*_cmp() as integers, without memcmp()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-24 09:42:52 -06:00
Dan Williams
8d9bfcdd5a platform: don't replace routes that already exist
If a route already exists that matches the network, prefix, gateway,
and metric of a route NM would like to add, don't try to overwrite
the route.

Unlike IP addresses, the kernel doesn't update the details, it
appears to completely replace that route, which might screw up
external tools that added the route originally.

One example of this is IPSec via openswan/libreswan.  They add the
routes to the kernel upon connection, and if NM replaces those routes,
IPSec no longer works.  While this may be due to kernel bugs or
bad handling of route replacement, there's no reason for NM to touch
routes that it wouldn't materially change anyway.

(yes, we could perhaps use NLM_F_REPLACE in add_kernel_object() only
when we really wanted to replace something, but why ask the kernel
to do the work when it's not required anyway?)
2014-01-24 09:42:52 -06:00
Dan Williams
4c16f3c7e2 core/platform: preserve external and static route metrics
Two issues:

1) routes added by external programs or by users with /sbin/ip should not
be modified, but NetworkManager was always changing those routes' metrics
to match the device priority.  This caused the nm_platform_ipX_route_sync()
functions to remove the original, external route (due to mismatched metric)
and re-add the route with the NetworkManager specified metric.  Fix that
by not touching routes which came from the kernel.

2) Static routes (from persistent connections) that specified a metric were
getting their metric overwritten with the NetworkManager device priority.
Stop doing that.

Since the platform no longer defaults the metric to 1024, callers of
nm_platform_ip4_route_add() (like NMPolicy's default route handling)
must do that themselves, if they desire this behavior.
2014-01-24 09:42:52 -06:00
Dan Williams
067db6f8d7 core/platform: add address/route sources (rh#1005416, bgo#722843)
Tag addresses and routes with their source.  We'll use this later to do
(or not do) operations based on where the item came from.

One thing to note is that when synchronizing items with the kernel, all
items are read as source=KERNEL even when they originally came from
NetworkManager, since the kernel has no way of providing this source
information.  This requires the source 'priority', which
nm_ip*_config_add_address() and nm_ip*_config_add_route() must respect
to ensure that NM-owned routes don't have their source overwritten
when merging various IP configs in ip*_config_merge_and_apply().

Also of note is that memcmp() can no longer be used to compare
addresses/routes in nm-platform.c, but this had problems before
anyway with ifindex, so that workaround from nm_platform_ip4_route_sync()
can be removed.

https://bugzilla.gnome.org/show_bug.cgi?id=722843
https://bugzilla.redhat.com/show_bug.cgi?id=1005416
2014-01-24 09:42:52 -06:00
Dan Williams
d7c369712b vpn: handle missing tunnel interface for IP-based VPNs (bgo #721724) (rh #1030068)
IPSec-based VPNs that use the kernel IPSec stack don't have tunnel
interfaces, and the IP details (address, routes) get added directly
to the parent network device.  NetworkManager previously required
a tunnel interface and failed the VPN if one was not provided.

When no tunnel interface is passed, construct the VPN IP configuration
using available details and pass that to the NMDevice as the VPN IP
config.  The device will merge that config with its own and apply
any configuration that the kernel/VPN has not already applied.

https://bugzilla.gnome.org/show_bug.cgi?id=721724
https://bugzilla.redhat.com/show_bug.cgi?id=1030068

https://bugzilla.redhat.com/show_bug.cgi?id=865883
https://bugzilla.redhat.com/show_bug.cgi?id=845599
2014-01-24 09:42:51 -06:00
Dan Williams
3cab4ee6cd dispatcher: handle VPN connections without interface names 2014-01-24 09:42:51 -06:00
Dan Williams
78d6008239 dns-manager: allow NULL interface name for IP configs
VPN services that use the kernel's IPSec stack (like OpenSwan/LibreSWAN)
obviously don't have a tunnel interface, so don't require one.  If
those services provide Link-Local IPv6 DNS servers they simply won't
work, but perhaps we can filter those out later or warn about them.
2014-01-24 09:42:51 -06:00
Jiří Klimeš
d96d242bc6 examples: a Python GOI example for adding connections persistent vs. not saved 2014-01-24 12:24:01 +01:00
Jiří Klimeš
ee7615e147 man: document the default value for autoconnect 'nmcli con add' argument 2014-01-24 12:21:52 +01:00
Shantha kumar
6f4c2046e5 po: update Tamil (ta) translation (bgo #722895)
https://bugzilla.gnome.org/show_bug.cgi?id=722895

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-24 11:41:41 +01:00
Jiří Klimeš
9433ea502b man: fix typo in commands in Team example 2014-01-24 11:13:31 +01:00
Dan Williams
e861f7e5d7 merge: add some missing D-Bus interface properties (bgo #715186)
Add properties for things that previously were missing to help out
Qt bindings, among others.  Also converts libnm-glib over to use the
new properties, and adds some testcases to ensure libnm-glib works
correctly with them.

https://bugzilla.gnome.org/show_bug.cgi?id=715186
2014-01-23 17:51:46 -06:00
Dan Williams
24ba56faab trivial: remove unused #defines
These are no longer used by anything, but are determined
automatically from the GObject property names.
2014-01-23 17:46:20 -06:00
Dan Williams
bce1fc7c3b libnm-glib: add testing framework and testcases
Add a fake NM service and test various aspects of the new NM D-Bus
properties.
2014-01-23 17:46:20 -06:00
Dan Williams
41aa72a86c libnm-glib: remove unused pseudo-property code
Now that all previous pseudo-properties have been converted to
real D-Bus and GObject properties, we can remove this code.
2014-01-23 17:34:13 -06:00