Commit Graph

13873 Commits

Author SHA1 Message Date
Thomas Haller
83e99c2227 cli: add nmc_property_set_int() function
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-12 20:13:17 +02:00
Thomas Haller
c9476a4242 cli: fix type when setting variadic argument in nmc_property_set_uint()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-12 20:13:17 +02:00
Thomas Haller
210e0dbc11 ifcfg-rh: add support for NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-12 20:13:17 +02:00
Thomas Haller
212f5dcba6 ifcfg-rh: add svGetValueInt64() utility function
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-12 20:13:17 +02:00
Thomas Haller
24a2f9c6cd libnm: add NMSettingConnection:autoconnect-priority setting
The autoconnect priority has only any relevance, if the connection
is autoconnect too.

The priority defaults to zero, with higher numbers meaning preferred.
The valid range is limited to [-999,999].

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-12 20:13:17 +02:00
Thomas Haller
b145700656 libnm: make @copy_func argument in _nm_utils_copy_strdict() optional
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-12 20:13:17 +02:00
Thomas Haller
884040fa8f nmtst: improve nmtst_assert_connection_verifies_without_normalization()
If the assertion in verifies_without_normalization() fails due to
@was_modified, the error message is not helpful.
Assert first against the content of the connection. This prints
most likely the settings that were actually modified.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-12 20:11:31 +02:00
Thomas Haller
71c5e5dea1 contrib/nm-live-vm: install perl dependancy (YAML) in mock build
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-10 20:52:38 +02:00
Dan Winship
60cce40042 libnm: fix crash in nm_client_new_async(), add a test for it
nm_client_new_async() got broken in the NMManager split. Fix it, and
use it from one of the tests in test-nm-client to make sure it's
getting tested in the future.
2014-10-10 13:44:54 -04:00
Dan Winship
af8fb3da47 libnm: fix NMActiveConnection object-path-valued properties (bgo #738103) 2014-10-10 13:10:28 -04:00
Dan Winship
677314c540 libnm: fix NMActiveConnection object-path-valued properties
NMActiveConnection:connection was an object path rather than an
NMRemoteConnection because in the past the NMObject property system
wasn't capable of handling NMRemoteConnection-valued properties.
NMActiveConnection:master was an object path rather than an NMDevice
entirely by accident. Fix both.

NMActiveConnection:specific-object can't currently be converted to an
object, because we don't know ahead of time what object type it is,
and NMObject can't deal with that. Instead, we rename it to
:specific-object-path (and likewise for its get function), both to
emphasize that it doesn't behave like other properties, and to leave
the old name open for an actual object-valued property later on.
2014-10-10 13:10:19 -04:00
Dan Winship
8c3d6f734b libnm: add nm-types.h, to avoid include loops
Add nm-types.h defining all the type structs, to avoid future include
loops. Clean up the includes in all of the installed headers.
2014-10-10 13:10:18 -04:00
Dan Winship
dccaffe143 libnm: merge NMRemoteSettings into NMClient (bgo #738103) 2014-10-10 13:09:43 -04:00
Dan Winship
6f3d1f9526 libnm: merge NMRemoteSettings into NMClient
Make NMRemoteSettings internal and have NMClient wrap all of its APIs,
just like it does with NMManager.
2014-10-10 12:40:19 -04:00
Dan Winship
c1f1e96181 cli: (trivial) rename NmCli.system_connections to connections
Rename NmCli.system_connections to connections, since the "user
connections" have been gone forever.
2014-10-10 12:40:15 -04:00
Dan Winship
90f66ff456 libnm: split "NMManager" out of NMClient
Clone NMClient as NMManager, and make NMClient just be a wrapper
around that new class.
2014-10-10 12:40:14 -04:00
Dan Winship
98bcc51240 libnm: clean up NMClient semantics when NM is not running
Add a single function to check if NM is running and set a GError if
not, then use it as appropriate.

Don't bother to check if NM is running in get_*() functions if
nm_running_changed_cb() would have reset the field anyway (and fix
that up to reset a few more fields).
2014-10-10 12:40:14 -04:00
Dan Winship
66bb00f677 libnm: (trivial) reorder NMClient function declarations/code
Rearrange the NMClient function declarations and the functions
themselves, and group them into "general", "device", and "active
connection" sections.

No code changes, just moving things around.
2014-10-10 12:40:08 -04:00
Thomas Haller
a6b4d54499 core: merge branch 'th/bgo737731-kill-process'
Add utility function to kill non-child processes and fix the wrong
use of nm_utils_kill_child_process_sync() in nm-dhcp-client.c

https://bugzilla.gnome.org/show_bug.cgi?id=737731

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-10 12:31:40 +02:00
Thomas Haller
4bfc163b63 dhcp: relax check valid PID for dhcp process
All callers only pass a PID that previously was returned from
spawning a process. AFAIS, there is no officially reserved range
for lower PIDs that would enforce valid PIDs to be larger then 25.
Relax this check.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-10 12:30:22 +02:00
Thomas Haller
5bbd8750c7 core/dhcp: kill external dhcp process using nm_utils_kill_process_sync()
nm_utils_kill_child_sync() is not able to reap the external process.
This causes NM to hang for 500 ms and logs the following error:

  <debug> [1412167360.400201] [NetworkManagerUtils.c:534] nm_utils_kill_child_sync(): kill child process 'dhcp-client' (7109): waiting up to 500 milliseconds for process to terminate normally afte
  <debug> [1412167360.900298] [NetworkManagerUtils.c:549] nm_utils_kill_child_sync(): kill child process 'dhcp-client' (7109): sending SIGKILL...
  <error> [1412167360.900369] [NetworkManagerUtils.c:576] nm_utils_kill_child_sync(): kill child process 'dhcp-client' (7109): after sending SIGTERM (15) and SIGKILL, waitpid failed with No child

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-10 12:28:59 +02:00
Thomas Haller
efd8be04f1 core: add nm_utils_kill_process_sync() function
This utility function is for killing other processes.
Contrary to nm_utils_kill_child_*() which is for killing
and reaping child processes.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-10 12:28:59 +02:00
Thomas Haller
99c5edbacd core: add nm_utils_get_start_time_for_pid() function
Move the code from nm-auth-subject.c over to NetworkManagerUtils.c

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-10 11:51:40 +02:00
Dan Williams
15b2a85ec5 ifcfg-rh: fix build on 32-bit 2014-10-09 13:20:06 -05:00
Thomas Haller
94a6f609f7 platform: fix format string for logging MTU in nm_platform_link_set_mtu()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-09 13:12:51 +02:00
Dan Williams
8c48fcf96c ifcfg-rh: read and write WiFi bands with BAND keyword
BAND alone will be honored, but CHANNEL will override BAND
since CHANNEL almost always implies BAND as well.
2014-10-08 21:55:31 -05:00
Dan Williams
4a6ded1cfd supplicant: fix handling of 'freq_list' option and band locking (bgo #737795)
The supplicant has a custom parsing function for freq_list which
handles the list as a string.  Having NM marshal the option
as TYPE_BYTES causes the supplicant to interpret the values that
NM passes (which are in ASCII) as a byte-array and thus the
supplicant gets a bogus frequency list.  Instead, NM should
marshal freq_list as a simple string (using TYPE_KEYWORD without
value checking).

https://bugzilla.gnome.org/show_bug.cgi?id=737795
2014-10-08 21:55:20 -05:00
Thomas Haller
f77297ec85 ifnet: fix parsing dhcp configuration
- fix memleaks if the script contains duplicate lines
- only accept either dhclient or dhcpcd syntax, depending
  on the file
- be more strikt in parsing:
  - don't use strstr() when parsing dhcpcd.conf. It wrongly
    accepts "# send dhcp-client-identifier".
  - enfore that keyword are terminated by space. Would no longer
    accept "hostnameHOSTNAME"
- be less strict in parsing:
  - accept any number of spaces between "send" and "host-name"/
    "dhcp-client-identifier"

https://bugzilla.gnome.org/show_bug.cgi?id=738125

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-08 23:02:12 +02:00
Nilamdyuti Goswami
b6cf21543e po: update Assamese (as) translation (bgo #738105)
https://bugzilla.gnome.org/show_bug.cgi?id=738105

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-08 22:41:57 +02:00
Dan Winship
81e236455d tui: master/slave deletion fixes (rh #1131574) 2014-10-08 10:20:28 -04:00
Dan Winship
66f19feef9 tui: when deleting a bridge/bond/team, delete its slaves too (rh #1131574) 2014-10-08 10:20:18 -04:00
Dan Winship
27650c2198 tui: show orphaned slaves in the connection editor list
If a master is deleted but its slaves are left behind, show those
slaves in the appropriate part of the connection list, so they can be
deleted. (This code is just copied from nm-connection-editor.)
2014-10-08 10:20:18 -04:00
Dan Winship
754a5d01f0 tui: fix multiple route editor bugs (rh #1149175)
Fix nmtui route editor bugs introduced in 98375657.
2014-10-08 10:18:42 -04:00
Dan Winship
4f9f33fc35 tui: fix some valgrind warnings
nmt_newt_grid_size_allocate() depends on nmt_newt_grid_size_request()
having been called immediately prior, which would normally be true,
except that NmtNewtSection adjusts the label widgets in its border to
match its allocation, so when its size changes, it will end up calling
size_allocate() on the border with out-of-date requisition data. Fix
that by re-size_requesting the border after modifying it.

https://bugzilla.gnome.org/show_bug.cgi?id=738010
2014-10-07 07:54:47 -04:00
sray
9c02e1c742 po: update Bengali bn_IN translation (rh #738055)
https://bugzilla.gnome.org/show_bug.cgi?id=738055

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-07 12:31:28 +02:00
Dimitris Spingos
c2cd6c8315 po: update Greek (el) translation (bgo #737972)
https://bugzilla.gnome.org/show_bug.cgi?id=737972

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-07 11:39:17 +02:00
Jiří Klimeš
f4cd7dec11 cli: fix setting secrets flags 2014-10-06 17:03:22 +02:00
Thomas Haller
50bd216a50 test: fix check-local in Makefile to print newline after message
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-06 16:42:51 +02:00
Jiří Klimeš
0fa6e75b14 cli: fix setting SSID property in the editor
SSID is now GBytes, not GByteArray.
2014-10-06 15:43:37 +02:00
Jiří Klimeš
e7666a8532 tui: fix accessing NULL in g_bytes_get_data()
GLib-CRITICAL **: g_bytes_get_size: assertion 'bytes != NULL' failed
GLib-CRITICAL **: g_bytes_get_data: assertion 'bytes != NULL' failed
libnm-CRITICAL **: nm_utils_ssid_to_utf8: assertion 'ssid != NULL' failed
GLib-CRITICAL **: g_bytes_get_size: assertion 'bytes != NULL' failed
GLib-CRITICAL **: g_bytes_get_data: assertion 'bytes != NULL' failed
libnm-CRITICAL **: nm_utils_ssid_to_utf8: assertion 'ssid != NULL' failed

Additional fixes to commit 4359e556e4.
2014-10-06 13:52:43 +02:00
Thomas Haller
33e50e817b logging: merge branch 'th/bgo737593_log_trace'
https://bugzilla.gnome.org/show_bug.cgi?id=737593

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-05 20:31:59 +02:00
Thomas Haller
1ac3a1de23 core/dbus: log messages in nm-dbus-manager.c with "TRACE" priority
The messages logged by nm-dbus-manager.c are not very useful, but amount to
a significant part of DEBUG logging. Log those messages with the lower TRACE priority.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-05 18:24:36 +02:00
Thomas Haller
bdea7d61d0 logging: add new logging level "TRACE"
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-05 18:24:36 +02:00
Dan Winship
c9e0e66a80 libnm, libnm-glib: clarify nm_client_activate_connection() semantics
nm_client_activate_connection() and
nm_client_add_and_activate_connection() return when the activation has
*started*, not when it *finishes*. Clarify this a bit more in the
libnm docs, and copy that clarification to libnm-glib as well.

https://bugzilla.gnome.org/show_bug.cgi?id=736233
2014-10-05 11:21:16 -04:00
Lubomir Rintel
5a040b4058 device: drop leftover bad assert
NetworkManager:ERROR:devices/nm-device.c:7089:nm_device_update_hw_address: assertion failed: (hwaddrlen <= sizeof (priv->hw_addr))
Aborted (core dumped)

Breaks 32-bit, works on 64-bit by dumb luck.

https://bugzilla.gnome.org/show_bug.cgi?id=737900

Fixes: b019348fdd
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-05 11:29:33 +02:00
Dan Winship
9bd603b4d2 libnm: make use of GParamSpecFlags and GParamSpecEnum (bgo #737485) 2014-10-03 17:23:20 -04:00
Dan Winship
a91e60902e libnm-core: make NMSettingSerial:parity an enum
NMSettingSerial:parity was defined as a char-typed property that could
have the (case-sensitive!) values 'n', 'E', or 'o'. This is zany. Add
an NMSettingSerialParity enum, and use that instead.
2014-10-03 09:36:28 -04:00
Dan Winship
fcfb4b40ba libnm: make use of GParamSpecFlags and GParamSpecEnum
Make enum- and flags-valued properties use GParamSpecEnum and
GParamSpecFlags, for better introspectability/bindability.

This requires no changes outside libnm-core/libnm since the expected
data size is still the same with g_object_get()/g_object_set(), and
GLib will internally convert between int/uint and enum/flags GValues
when using g_object_get_property()/g_object_set_property().
2014-10-03 09:36:28 -04:00
Dan Winship
ad25e5c970 libnm: reorganize demarshal_generic(), make unrecognized type a warning
Redo the HANDLE_TYPE macro in demarshal_generic() in a more
syntactically-sane way (both to help the editor with indentation and
to make it not look so weird).

Also, if demarshal_generic() is asked to handle a property of a type
that it doesn't know how to handle, that's a programmer error, so do a
g_warning() in that case (as opposed to being asked to demarshal a
value of the wrong D-Bus type, which could just be a bug in the peer
that sent the data, so that stays as a debug message).
2014-10-03 09:36:28 -04:00
Dan Winship
5c2d2eed30 libnm: fix properties-changed debug logging
The code was mistakenly still using G_VALUE_TYPE_NAME() instead of
g_variant_get_type_string().

Also, refer to the properties with standard gtk-doc punctuation:
"TypeName:property-name".
2014-10-03 09:36:27 -04:00