Commit Graph

15047 Commits

Author SHA1 Message Date
Jiří Klimeš
3dbe8041a7 libnm-glib: add nm_device_is_software() function to NMDevice
It says whether the device is a software one, according to device capabilities.
2014-07-22 14:24:42 +02:00
Jiří Klimeš
bbf13002d3 device: indicate software devices in NMDeviceCapabilities
It is visible by clients in 'capabilities' property.
2014-07-22 14:24:42 +02:00
Jiří Klimeš
4c36ff7062 include: add NM_DEVICE_CAP_IS_SOFTWARE capability
for marking software devices.
2014-07-22 14:24:42 +02:00
Dan Williams
d8d0b37adc platform: fix uninitialized variable usage after fdf78b3d
'address' was not initialized, so using address.ifindex was not
going to work.

==6777== Conditional jump or move depends on uninitialised value(s)
==6777==    at 0x44A6DB: check_cache_items (nm-linux-platform.c:1510)
==6777==    by 0x44AA4F: announce_object (nm-linux-platform.c:1586)
==6777==    by 0x44A59A: refresh_object (nm-linux-platform.c:1666)
==6777==    by 0x44A676: check_cache_items (nm-linux-platform.c:1517)
==6777==    by 0x44A812: announce_object (nm-linux-platform.c:1566)
==6777==    by 0x44D957: handle_udev_event (nm-linux-platform.c:3964)
==6777==    by 0x3BAFC125A7: g_closure_invoke (gclosure.c:777)
==6777==    by 0x3BAFC2465C: signal_emit_unlocked_R (gsignal.c:3586)
==6777==    by 0x3BAFC2C3E1: g_signal_emit_valist (gsignal.c:3330)
==6777==    by 0x3BAFC2C69E: g_signal_emit (gsignal.c:3386)
==6777==    by 0x3D93A03BE3: ??? (in /usr/lib64/libgudev-1.0.so.0.1.3)
==6777==    by 0x3BAF8521D5: g_main_context_dispatch (gmain.c:3066)
2014-07-21 13:09:47 -05:00
Thomas Haller
faa6c34db1 libnm-glib: evaluate assert check only once in test-remote-settings-client
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-21 12:20:56 +02:00
Dan Williams
02a5b972e6 trivial: simplify some code 2014-07-20 12:00:21 -05:00
Dan Winship
396610d14a libnm-glib: fix assertion-failure messages in test-remote-settings-client
test-remote-setting-client uses a macro:

    #define test_assert(condition) \
    do { \
        if (!G_LIKELY (condition)) \
            cleanup (); \
        g_assert (condition); \
    } while (0)

where cleanup() kills the fake remote-settings service and unrefs
settings. However, in many cases, "condition" would involve a test
against a connection that was owned by settings, so if the check
failed, the connection would end up getting freed by cleanup(), and so
then the second invocation of condition would result in the program
aborting on a failed check somewhere else (eg, "invalid unclassed
pointer in cast to 'NMConnection'") rather than displaying the failed
assertion that had gotten us to that point.

Fix this by not unreffing settings from cleanup(); in the normal exit
case we can just have main() unref it, and in the assertion-failed
case, we don't need to free things anyway.
2014-07-20 08:58:56 -04:00
Thomas Schäfer
bcd554724e dhcp: let dhclient handle requesting the 'server-id' option
Always requesting this appears to cause some devices to ignore
DHCP requests, like the ZTE 823D, ZTEMF93E, Alcatel W800Z.
dhclient probably knows better than NM when to request the
server's ID, so leave that up to dhclient.  We don't do anything
interesting with it anyway.
2014-07-17 15:53:04 -05:00
David Lechner
7f2afbbcdc vapi: add bindings for new_async methods (bgo #732253)
https://bugzilla.gnome.org/show_bug.cgi?id=732253
2014-07-16 17:11:02 -05:00
Dan Winship
dd2e751b07 tui: fix Wi-Fi section of "nmtui connect" list in non-UTF-8 locales
In locales where the Wi-Fi signal-strength characters couldn't be
represented (eg, LANG=C), the entire Wi-Fi SSID + signal strength
string would fail to convert, causing the Wi-Fi section of the
connection list to show up as a series of blank lines.

Fix this by testing beforehand whether the characters can convert, and
falling back to plain ASCII if not. (And also, fix the similar code in
nmt-newt-section.c, which got broken when nmt_newt_locale_from_utf8()
was changed to never return NULL.)

Also, for paranoia, represent the signal-strength strings via \nnn
escapes rather than actual UTF-8 data, to guarantee that they get
compiled to the expected values even if the source files get
re-encoded.

https://bugzilla.gnome.org/show_bug.cgi?id=733007
2014-07-16 12:05:44 -04:00
Thomas Haller
fad552694e merge branch 'th/libgsystem'
Remove libgsystem submodule and include the gsystem-local-alloc.h
header file directly.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:54:31 +02:00
Thomas Haller
6cf9724f7d platform: use gs_free (instead of own define auto_g_free)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:50:36 +02:00
Thomas Haller
37f08bc848 core: use gs_free_slist in NMManager
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:50:36 +02:00
Thomas Haller
51bd942575 build: remove setup of git-submodules in autogen.sh
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:50:36 +02:00
Thomas Haller
39fce7371a libgsystem: remove submodule libgsystem
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:50:36 +02:00
Thomas Haller
2856fcb3de libgsystem: add local copy of gsystem-local-alloc.h
Taken from libgsystem:src/gsystem-local-alloc.c
(commit de2619271ee3ab42971fc770cae110f23e330c30).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:50:32 +02:00
Thomas Haller
7a5af89f0b core: #include gsystem-local-alloc.h instead of libgsystem.h
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:47:43 +02:00
Thomas Haller
2fdaa29f08 libnm-util: fix leak in _nm_connection_verify()
Regression introduced by commit 2570c5a17c.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 21:57:34 +02:00
Terry Chuang
49463a9e7b po: update Traditional Chinese translation (rh #1046891) 2014-07-15 12:18:12 -05:00
Leah Liu
d9713d30b5 po: update Simplified Chinese translation (rh #1046891) 2014-07-15 12:18:12 -05:00
ypoyarko
e6e1a6a4b9 po: update Russian translation (rh #1046891) 2014-07-15 12:18:12 -05:00
asaini
ff9a4d2800 po: update Punjabi translation (rh #1046891) 2014-07-15 12:18:12 -05:00
Ani Peter
3bcacec009 po: update Malayalam translation (rh #1046891) 2014-07-15 12:18:12 -05:00
eukim
a6caffd60a po: update Korean translation (rh #1046891) 2014-07-15 12:18:12 -05:00
Noriko Mizumoto
5dd8465225 po: update Japanese translation (rh #1046891) 2014-07-15 12:18:12 -05:00
Sam Friedmann
90ce0a5ff1 po: update French translation (rh #1046891) 2014-07-15 12:18:11 -05:00
gguerrer
93192f3926 po: update Spanish translation (rh #1046891) 2014-07-15 12:18:11 -05:00
sray
a391e4f61a po: update Bengali bn_IN translation (rh #1046891) 2014-07-15 12:18:11 -05:00
Dan Winship
30c74c6007 build: more srcdir!=builddir fixes
nm-version.h was getting disted, making srcdir!=builddir work for
tarball builds, but not for git builds.

Also, remove "-I${top_builddir}/include" from all Makefile.ams, since
there's nothing generated in include/ any more.
2014-07-15 11:37:19 -04:00
Dan Winship
c9e2c34029 build: fix srcdir!=builddir build after previous merge 2014-07-15 10:52:50 -04:00
Dan Winship
741ee7d051 Miscellaneous libnm-util/libnm-glib/include cleanups
https://bugzilla.gnome.org/show_bug.cgi?id=732867
2014-07-15 10:17:49 -04:00
Dan Winship
6e51e460df libnm-util: NetworkManager.h/NetworkManagerVPN.h doc fixups
Add gtk-docs for enum types that previously didn't have them.

Explicitly note the relationship between NetworkManager.h /
NetworkManagerVPN.h types and the corresponding introspection/*.xml
types.
2014-07-15 09:44:55 -04:00
Dan Winship
e42ab85f1b introspection: fix VPN.Plugin State type
It was listed as being tp:type="NM_VPN_CONNECTION_STATE", but it's
actually NM_VPN_SERVICE_STATE (which wasn't previously documented).
2014-07-15 09:44:55 -04:00
Dan Winship
3aad3124f1 libnm-glib: drop separate test library
Previously, we built a second copy of libnm-glib that was hacked to
use the session bus rather than the system bus, for use by the test
programs. Rather than doing that, just have test-nm-client explicitly
override the choice of bus. (test-remote-settings-client was actually
already doing this, although it leaked the bus after.)
2014-07-15 09:44:55 -04:00
Dan Winship
2570c5a17c libnm-util, libnm-glib: whitespace fixes
Fix indentation, kill trailing whitespace, split some long lines.
2014-07-15 09:44:55 -04:00
Dan Winship
cb7e1893e7 libnm-util, libnm-glib: standardize copyright/license headers
- Remove list of authors from files that had them; these serve no
  purpose except to quickly get out of date (and were only used in
  libnm-util and not libnm-glib anyway).

- Just say "Copyright", not "(C) Copyright" or "Copyright (C)"

- Put copyright statement after the license, not before

- Remove "NetworkManager - Network link manager" from the few files
  that contained it, and "libnm_glib -- Access network status &
  information from glib applications" from the many files that
  contained it.

- Remove vim modeline from nm-device-olpc-mesh.[ch], add emacs modeline
  to files that were missing it.
2014-07-15 09:44:54 -04:00
Dan Winship
4223fa47e4 libnm-util, libnm-glib: tweak (element-type) annotations in docs
g-i allows you to specify types in annotations using either their
fully-qualified introspected names (eg, "NMClient.Device") or their
plain C names ("NMDevice"). Switch from the former to the latter (so
that they'll still be correct when migrated to libnm later).
2014-07-15 09:44:54 -04:00
Dan Winship
7eb0288aa0 libnm-util: move NetworkManager.h, etc, from include/ to here
NetworkManager.h, NetworkManagerVPN.h, and nm-version.h are part of
the libnm-util API, so move them to libnm-util.

include/ still contains headers that are strictly NM-internal (eg,
nm-glib-compat.h).
2014-07-15 09:44:54 -04:00
Thomas Haller
f352bfd2af trivial/libnm-glib: rename internal PROP_* enum values
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-14 19:31:34 +02:00
Jiří Klimeš
0105fb884a core: use nm_utils_is_specific_hostname() instead of hardcoded "localhost" 2014-07-14 17:36:07 +02:00
Jiří Klimeš
bf1231d02a policy: don't use default hostname as configured hostname (rh #1110436)
Even if administrator-configured hostname (/etc/hostname) takes precedence
over other hostname configurations, we don't take "localhost", "localhost6",
"localhost.localdomain", "localhost6.localdomain6" as such. These values might
be set by some tools (like installer). But that's not right and we compensate
for that. It doesn't make much sense that an admimistrator would set these
values manually (intentionally), because leaving /etc/hostname empty will
result in "localhost" hostname anyway (set by systemd).

https://bugzilla.redhat.com/show_bug.cgi?id=1110436
2014-07-14 17:36:07 +02:00
Jiří Klimeš
70e930bc0e utils: add nm_utils_is_specific_hostname()
The function detects whether the hostname is a specific hostname diferrent
from default hostnames like localhost, localhost[6].localdomain[6].
2014-07-14 17:36:07 +02:00
Thomas Haller
568742ed41 libnm-glib: fix initialization of NMObject type
Ensure that the @type_funcs and @type_async_funcs
hashes are initialized before running the class
init function.

libnm-glib-scan hits the following assertion:
  GLib-CRITICAL **: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
  #0  0x0000003370c504e9 in g_logv (log_domain=0x3370cb2f4e "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffd1578f70) at gmessages.c:989
  #1  0x0000003370c5063f in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1025
  #2  0x00007f2169f42545 in _nm_object_register_type_func (base_type=base_type@entry=13597296, type_func=type_func@entry=0x7f2169f47ae9 <_nm_device_type_for_path>, type_async_func=type_async_func@entry=
      0x7f2169f47880 <_nm_device_type_for_path_async>) at nm-object.c:551
  #3  0x00007f2169f48664 in nm_device_get_type () at nm-device.c:62
  #4  0x0000000000402577 in get_object_types () at libnm-glib-scan.c:46
  #5  0x0000000000404b0b in main (argc=<optimized out>, argv=<optimized out>) at libnm-glib-scan.c:135

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-14 16:14:03 +02:00
Dan Williams
66d1f2f53c platform: ignore RTM_F_CLONED (eg, cache) routes
The kernel adds these for various operations; they are short-lived,
added often, and not useful to NetworkManager.  Ignore them.  This
prevents NetworkManager from continuously updating the IPv6 config
and emitting state changes to clients via D-Bus for useless changes.
2014-07-11 14:51:12 -05:00
Dan Winship
09da178639 libnm-util: fix build with --with-crypto=gnutls
The non-"_t"-suffixed type names in gnutls have been deprecated since
1.x, and in recent versions will trigger deprecation warnings. Fix by
using "gnutls_datum_t" instead of "gnutls_datum".
2014-07-11 12:09:39 -04:00
Thomas Haller
98bc1c8cf9 config: replace g_warning() by nm_log_warn()
Quite possibly these logging lines hit before we setup nm-logging
initially and before NM main() calls nm_logging_syslog_openlog().
This is because NM first needs to read the configuration, before setting
up logging.

Note however, that nm-logging is robust against both.

If nm_logging_setup() was not yet called, it will automatically setup
"DEFAULT","INFO".

If nm_logging_syslog_openlog() was not yet called, it will redirect
logging to g_log() -- which basically ends up at g_warning() again.

Still this is useful in case when hitting those lines *afterwards*.
Especially, later when we support reloading of configuration.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-11 13:13:15 +02:00
Thomas Haller
a218199eb6 config: fix leaked GError when no default config file exists
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-11 13:13:15 +02:00
Thomas Haller
397762c2c7 merge branch 'th/kill_child'
https://bugzilla.gnome.org/show_bug.cgi?id=725660

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-10 16:33:45 +02:00
Thomas Haller
ff3b753857 core: use nm_utils_kill_child_async() and nm_utils_kill_child_sync()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-10 16:25:10 +02:00
Thomas Haller
1f8418541e core: add nm_utils_kill_child_async() and nm_utils_kill_child_sync() function
Add utility function to kill and reap a child process.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-10 16:25:10 +02:00