Commit Graph

10612 Commits

Author SHA1 Message Date
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
Thomas Haller
3b1528417a bond: fix setting bond option 'lacp_rate'
Setting 'lacp_rate' is only possible in '802.3ad' (4) mode.
Otherwise writing to sysctl fails and results in the following
error log:

    <error> [1412337854.026285] [platform/nm-linux-platform.c:2093] sysctl_set(): sysctl: failed to set '/sys/class/net/nm-bond/bonding/lacp_rate' to '0': (13) Permission denied
    <warn>  (nm-bond): failed to set bonding attribute 'lacp_rate' to '0'

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1061702

Fixes: 47555449fa
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 14:53:06 +02:00
Jiří Klimeš
b365a38bc3 build: fix compilation with GLib 2.32 2014-10-03 13:57:44 +02:00
Thomas Haller
a64de150c3 contrib/rpm: detect ppp version based on installed package
Also fixes build failure if user had no /sbin/pppd in its $PATH.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 12:49:19 +02:00
Thomas Haller
d4cd8b5785 libnm: merge branch 'th/bgo737725-libnm-private-dbus-connection'
https://bugzilla.gnome.org/show_bug.cgi?id=737725

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 12:46:24 +02:00
Thomas Haller
97b2c1b0d1 libnm: share private DBUS connection
Cache the private DBUS connection and reuse it. Otherwise we end up
creating several private connnections, as an NMObject instance creates
a new connection (unless it is passed in as NMObject:dbus-connection
property).

We already pass the existing "parent" DBUS connection when creating
the proxy objects. However, when creating two independent objects
(e.g. nm_client_new() and nm_remote_settings_new()), their private
DBUS connections were not shared.

Implement this sharing inside nm-dbus-helpers.c

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:21:40 +02:00
Thomas Haller
df57b6b4d1 libnm: add NMObject:dbus-connection property to inject DBUS connection
Commit b732380d1e removed the gobject
property "NMObject:connection". However, this property is still needed
to inject the DBUS connection when creating new proxy objects. Without it,
we call _nm_dbus_new_connection() in the constructor for every proxy NMObject.

In case of non-private connections, g_bus_get_sync() already returns the same
connection. However for private connections, g_dbus_connection_new_for_address_sync()
would create a separate DBUS connection.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:21:17 +02:00
Thomas Haller
284a14d62f libnm: assert for interface name in _nm_object_class_add_interface()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:21:17 +02:00
Thomas Haller
94331184d8 libnm: remove unused variable NMObjectPrivate:private_connection
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:21:17 +02:00
Thomas Haller
52ccce8c2c core/dbus: debug log unix file descriptor when closing private dbus connection
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:21:17 +02:00
Thomas Haller
20a746f68a contrib/rpm: fix --quick option of build_clean.sh
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:02:46 +02:00
Dan Williams
e80d03b5fa merge: fix DHCP 'expire' state handling (rh #1139326) (bgo #737225) 2014-10-02 15:03:00 -05:00