Commit Graph

10582 Commits

Author SHA1 Message Date
Nilamdyuti Goswami
1e1bde7d83 po: update Assamese (as) translation (bgo #736024)
https://bugzilla.gnome.org/show_bug.cgi?id=736024
2014-09-04 14:36:21 +02:00
Dan Winship
799922c14b libnm-util: generate-plugin-docs.pl-related fixes
generate-plugin-docs.pl was assuming that it was being run out of
srcdir, and so failed in srcdir!=builddir builds (such as "make
distcheck"). Fix that.

Also, update .gitignore
2014-09-03 23:06:00 -04:00
Dan Williams
968f7958c9 ifcfg-rh: fix testcase to expect error reading iBFT configurations 2014-09-03 09:51:00 -05:00
Dan Winship
1838db9e71 all: remove a bunch of unnecessary dbus/dbus-glib includes 2014-09-03 10:45:24 -04:00
Jiří Klimeš
151645a648 bluetooth: don't crash when switching off bluetooth
Testcase:
- add a bluetooth connection (with auto-activate)
  $ nmcli con add type blue con-name phone bt-type panu addr 00:17:EA:84:E7:41
- make NM go to sleep (close a lid of laptop to suspend)
- switch off hardware wireless button
- resume the computer (open the lid)

Trace (from RHEL 7):
 (NetworkManager:3619): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'NMDeviceBt'
 (NetworkManager:3619): GLib-GObject-CRITICAL **: g_type_instance_get_private: assertion 'instance != NULL && instance->g_class != NULL' failed
 NetworkManager[3619]: <warn> Error connecting with bluez: Timeout was reached
 (NetworkManager:3619): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'NMDevice'
 (NetworkManager:3619): GLib-GObject-CRITICAL **: g_type_instance_get_private: assertion 'instance != NULL && instance->g_class != NULL' failed
 Program received signal SIGSEGV, Segmentation fault.
 nm_device_state_changed (device=0x7f8ffe63c7f0, state=state@entry=NM_DEVICE_STATE_FAILED, reason=reason@entry=
     NM_DEVICE_STATE_REASON_BT_FAILED) at devices/nm-device.c:6685
 6685            g_warn_if_fail (priv->in_state_changed == FALSE);
 Missing separate debuginfos, use: debuginfo-install ModemManager-glib-1.1.0-6.git20130913.el7.x86_64 dbus-glib-0.100-7.el7.x86_64 dbus-libs-1.6.12-8.el7.x86_64 glib2-2.40.0-2.el7.x86_64 glibc-2.17-58.el7.x86_64 gvfs-1.16.4-7.el7.x86_64 libbluray-0.2.3-5.el7.x86_64 libffi-3.0.13-11.el7.x86_64 libgcc-4.8.3-5.el7.x86_64 libgudev1-208-11.el7_0.2.x86_64 libndp-1.2-4.el7.x86_64 libnl3-3.2.21-6.el7.x86_64 libselinux-2.2.2-6.el7.x86_64 libsoup-2.46.0-2.el7.x86_64 libuuid-2.23.2-16.el7.x86_64 libxml2-2.9.1-5.el7.x86_64 nspr-4.10.6-2.el7.x86_64 nss-3.16.2-4.el7.x86_64 nss-softokn-3.16.2-2.el7.x86_64 nss-softokn-freebl-3.16.2-2.el7.x86_64 nss-util-3.16.2-2.el7.x86_64 pcre-8.32-13.el7.x86_64 polkit-0.112-5.el7.x86_64 sqlite-3.7.17-4.el7.x86_64 systemd-libs-208-11.el7_0.2.x86_64 teamd-1.12-1.el7.x86_64 xz-libs-5.1.2-8alpha.el7.x86_64 zlib-1.2.7-13.el7.x86_64
 (gdb) DHCPREQUEST on enp0s25 to 255.255.255.255 port 67 (xid=0x566289d3)
 DHCPACK from 10.34.0.254 (xid=0x566289d3)
 bt
 #0  nm_device_state_changed (device=0x7f8ffe63c7f0, state=state@entry=NM_DEVICE_STATE_FAILED, reason=reason@entry=
     NM_DEVICE_STATE_REASON_BT_FAILED) at devices/nm-device.c:6685
 #1  0x00007f8fee0847bf in bluez_connect_cb (object=<optimized out>, res=<optimized out>, user_data=<optimized out>)
     at nm-device-bt.c:738
 #2  0x00007f8ff93eb557 in g_simple_async_result_complete (simple=0x7f8ffe67d8a0) at gsimpleasyncresult.c:763
 #3  0x00007f8fee07ec85 in bluez_connect_cb (dbus_connection=<optimized out>, res=0x7f8ffe67d730, user_data=<optimized out>)
     at nm-bluez-device.c:484
 #4  0x00007f8ff93eb557 in g_simple_async_result_complete (simple=0x7f8ffe67d730) at gsimpleasyncresult.c:763
 #5  0x00007f8ff944637f in g_dbus_connection_call_done (source=<optimized out>, result=<optimized out>, user_data=0x7f8ffe64a840)
     at gdbusconnection.c:5492
 #6  0x00007f8ff93eb557 in g_simple_async_result_complete (simple=0x7f8ffe66de30) at gsimpleasyncresult.c:763
 #7  0x00007f8ff93eb5b9 in complete_in_idle_cb (data=<optimized out>) at gsimpleasyncresult.c:775
 #8  0x00007f8ff8c3b9ea in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
 #9  0x00007f8ff8c3bd38 in g_main_context_iterate.isra.24 () from /lib64/libglib-2.0.so.0
 #10 0x00007f8ff8c3c00a in g_main_loop_run () from /lib64/libglib-2.0.so.0
 #11 0x00007f8ffcaba9ba in main (argc=1, argv=0x7ffff6b335b8) at main.c:642
 (gdb)
2014-09-02 14:53:47 +02:00
Jiří Klimeš
6ed48691f7 man: add/update bonding and team examples in nm-settings-ifcfg-rh 2014-09-01 14:17:45 +02:00
Dan Williams
fc9c1f1557 merge: add settings plugin for reading iBFT configuration (bgo #734009) (rh #990480) 2014-08-29 18:51:34 -05:00
Dan Williams
a175ff090c core: allow connection assumption on pre-configured software devices
In the specific case that triggered this bug, both eth0 and eth0.123
existed and were configured before NM started, and a valid saved connection
existed for eth0.123.  eth0 was ordered before eth0.123 in the Platform's
link list.  When the end of add_devices() was reached for eth0 and
system_create_virtual_devices() was called, NM created an NMDevice for
the pre-existing eth0.123 link due to the saved connection, and
ignored the existing configuration because system_create_virtual_device()
re-calls add_device() with generate_con = FALSE.

Instead, we should allow system_create_virtual_device() to call add_device()
with generate_con = TRUE if the interface existed before NM created it. We
only want to skip connection assumption if the device was actually just
created by NM, in which case it cannot have any configuration to assume.
2014-08-29 18:46:11 -05:00
Dan Williams
af13376e2b core: allow plugin/factory originated devices to assume connections
This didn't previously matter because BT/WWAN/WiFi/ADSL can't easily
assume existing connections due to the external helpers involved, but
when we converted Team support to a plugin we now want to allow this.
2014-08-29 18:46:11 -05:00
Dan Williams
b9d8fe8085 ifcfg-rh: more conversions to g_assert() 2014-08-29 18:46:11 -05:00
Dan Williams
7b714524b9 ifcfg-rh: remove iBFT handling (use the ibft plugin instead) (bgo #734009) (rh #990480)
Now that the ibft plugin handles iBFT data, no reason to do so from the
ifcfg-rh plugin.

https://bugzilla.gnome.org/show_bug.cgi?id=734009
2014-08-29 18:46:11 -05:00
Dan Williams
448254f761 ibft: add settings plugin for reading iBFT configuration (bgo #734009)
Instead of handling iBFT (iSCSI Boot Firmware Table) in the ifcfg-rh plugin,
create a new plugin for it.  This allows all distributions to use iBFT
configuration, and makes both iBFT handling and ifcfg-rh less complicated.

The plugin (like the old ifcfg-rh code) creates read-only connections backed
by the data exported by iscsiadm.  The plugin does not support adding new
connections or modifying existing connections (since the iBFT data is
read-only anyway).  Instead, users should change their iBFT data through
the normal firmware interfaces.

Unmanaged devices can be configured through NetworkManager.conf and the
normal 'keyfile' mechanisms.

(In the future, we'll read this data directly from the kernel's
/sys/firmware/ibft/ethernetX directory instead of iscsiadm, since the
kernel has all the information we need and that's where iscsiadm gets
it from anyway.)

https://bugzilla.gnome.org/show_bug.cgi?id=734009
2014-08-29 18:46:11 -05:00
Dan Williams
a27c7e3721 ifcfg-rh: trivial: remove unused parameter 2014-08-29 18:15:44 -05:00
Dan Williams
0c54a617e9 merge: apply static IPv6 configuration before starting SLAAC (rh #1101809) 2014-08-29 16:03:42 -05:00
Dan Williams
cbcca18149 core: complete IPv6 even if RA times out when there are manual/external addresses
Even if we never receive an RA, if there are manually-specified or external
addresses, consider IPv6 to complete successfully.  No reason to fail IPv6
if we have IP configuration already, but RA doesn't respond.  If RA shows
up again, we're still listening for it and will apply the config at that
time.
2014-08-29 16:03:37 -05:00
Dan Williams
c69531041a core: apply manual IPv6 configuration earlier when RA is also used (rh #1101809)
Reporter left SLAAC enabled (because it's default and requires being
explicitly turned off) and added manual IPv6 address.  They expected that
address to be assigned very soon after starting the connection, but it was
not assigned.

This happened because NM waits for RA before assigning any IPv6 configuration,
including the manually specified addresses.  In the reporters case, there was
no IPv6 router on the network, so NM waited indefinitely for a router
advertisement and never applied any IPv6 configuration.

It seems reasonable to apply any IPv6 configuration we have available, when
we have it.  We already apply RA configuration before starting DHCP, and
apply DHCP configuration if/when we get that.
2014-08-29 16:03:37 -05:00
Dan Williams
17e323fd22 core: sync IPv6 pre-commit hook with IPv4 behavior
The IPv4 pre-commit hook was called right before the config was
committed, while the IPv6 one was called before commit in only
one case (from nm_device_activate_ip6_config_commit).  The IPv4
behavior is the intended behavior.

Note that this doesn't have any actual effect yet, since nothing
actually implements the IPv6 pre-commit hook
2014-08-29 16:03:36 -05:00
Dan Williams
7c9d4e8f5a rdisc: add RA wait timeout
Add an advisory timeout when waiting for router advertisements so
we can fail IPv6 addressing attempts when no router advertisement
has been received.
2014-08-29 16:03:36 -05:00
Jiří Klimeš
bc18992dd8 contrib/rpm: add BuildRequires for perl YAML module in spec
The module is used for building man pages by generate-plugin-docs.pl script.
1c2174a libnm-util: generate-plugin-docs.pl script for extracting plugin docs
2014-08-29 14:38:12 +02:00
Jiří Klimeš
7917b4d431 Merge code for documenting 'keyfile' and 'ifcfg-rh' plugins (bgo #683111)
The resulting documentation is in manual pages:
nm-settings-keyfile(5)
nm-settings-ifcfg-rh(5)
2014-08-29 14:11:30 +02:00
Jiří Klimeš
291674d82e libnm-util: add ifcfg-rh specific description for properties
as comments in libnm-util/nm-setting-*.c files
The comments are parsed by generate-plugin-docs.pl script.
2014-08-29 13:59:54 +02:00
Jiří Klimeš
71e07344ab libnm-util: add keyfile specific description for properties
as comments in libnm-util/nm-setting-*.c files
The comments are parsed by generate-plugin-docs.pl script.
2014-08-29 13:59:54 +02:00
Jiří Klimeš
f27fac5109 man: generate nm-settings-ifcfg-rh(5) manual page 2014-08-29 13:59:54 +02:00
Jiří Klimeš
24edee2772 man: generate nm-settings-keyfile(5) manual page
man/nm-settings-keyfile.xml is generated via an XSLT stylesheet applied to
libnm-util/nm-keyfile-docs.xml. Then a manual page is generated from the XML.
2014-08-29 13:59:54 +02:00
Jiří Klimeš
1c2174a802 libnm-util: generate-plugin-docs.pl script for extracting plugin docs
The scripts extracts plugin description from document comments for particular
properties and builds a XML file out of the data. The XML file can be used
later for generating manual pages or other documentation.

Unfortunately, gtk-doc won't allow descriptions that would be separated from
the main gtk-doc stuff. But it is still useful to have plugin description bits
co-located with property definitions. We use our home-grown comments and parse
them ourself. Afterall it's not that bad, and in addition it brings us a
freedom in shaping the comments to our needs.
2014-08-29 13:59:44 +02:00
Jiří Klimeš
def5d6c3a7 trivial: only use spaces in nm-setting.xml
Do not mix tabs and spaces for indentation, only use spaces.
2014-08-28 19:04:14 +02:00
Jiří Klimeš
f6b4ab7d3b settings: fix a crash in emit_updated() accessing invalid pointer
by disconnecting signal handlers in dispose().

Commit 6a19e68a moved nm_connection_clear_secrets() from plugins' finalize() to
NMSettingsConnection's dispose(). But clearing secrets emits "changed" signal
which cause changed_cb() to be called and emit_updated() scheduled. And
emit_updated() was called later after finalize() on released object.

The crash can be invoked by having two keyfile connection files with the same
uuid in them.

Backtrace:
 (NetworkManager:12262): GLib-GObject-WARNING **: attempt to retrieve private data for invalid type 'NMSettingsConnection'
 Program received signal SIGSEGV, Segmentation fault.
 emit_updated (self=0xf38dd0 [NMSettingConnection]) at settings/nm-settings-connection.c:401
 401		NM_SETTINGS_CONNECTION_GET_PRIVATE (self)->updated_idle_id = 0;
 (gdb) bt
 #0  emit_updated (self=0xf38dd0 [NMSettingConnection]) at settings/nm-settings-connection.c:401
 #1  0x0000003c49647825 in g_main_dispatch (context=0x785970) at gmain.c:2539
 #2  g_main_context_dispatch (context=context@entry=0x785970) at gmain.c:3075
 #3  0x0000003c49647b58 in g_main_context_iterate (context=0x785970, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3146
 #4  0x0000003c49647f52 in g_main_loop_run (loop=0x7857c0) at gmain.c:3340
 #5  0x000000000042d4e9 in main (argc=1, argv=0x7fffffffe508) at main.c:679
2014-08-28 09:44:04 +02:00
Dan Winship
94758eb688 nmtui: fix sensitivity of "Add" button in address lists (rh #1131434)
When you first click "Add" in an address list, it adds a new field,
and the "Add" button becomes insensitive (because the new field is
empty, and thus not valid). But if you then clicked "Remove", "Add"
stayed insensitive. Fix that.
2014-08-27 14:55:52 -04:00
Dan Winship
d168363aa2 trivial: remove a stray prototype
libnm/nm-device-bridge.h had a prototype for nm_device_bridge_new(),
which doesn't exist.
2014-08-27 13:04:04 -04:00
Thomas Haller
4b9dc30988 gitignore: ignore /libgsystem/
When switching to and fro old branches, you end up with
the (now removed) libgsystem submodule. As `git clean -fd`
refuses to remove git-repositories, this is especially annoying.

Tell git to ignore it.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-27 17:26:30 +02:00
Geoffrey Thomas
cf10c8de8e supplicant/ifnet: fix spelling of "private_key2_passwd" option
This wpa_supplicant option is not named "private_key_passwd2". Looks
like this regressed in e5ed391f28.

Signed-off-by: Geoffrey Thomas <gthomas@mokafive.com>
2014-08-27 09:20:02 -05:00
Thomas Haller
86ffea8004 libnm: ensure auto-registration only when not yet registered
Calling nm_secret_agent_register() on an already registered
instance leads to a warning. Ensure to call register during
auto-registration only when needed.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-27 08:52:25 +02:00
Piotr Drąg
509ac4cae7 po: update Polish (pl) translation (bgo #735470)
https://bugzilla.gnome.org/show_bug.cgi?id=735470

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-27 08:46:00 +02:00
Dan Winship
4c14b3db2a trivial: reorganize .gitignore
alphabetize by subdir; no other changes
2014-08-26 14:42:01 -04:00
Dan Winship
2f50c9752d trivial: remove nonexistent items from .gitignore 2014-08-26 14:42:01 -04:00
Thomas Haller
e1de236db1 build: add configure option not to install udev rules
Previously, user could only change the udev base directory,
but not disabling installation entirely.

Support this now with:
  ./configure --with-udev-dir=no
or
  ./configure --without-udev-dir

Also, just passing '--with-udev-dir' equals '--with-udev-dir=yes'.
Treat 'yes' equal to the default '/lib/udev'.

Also, check that the path is an absolute path starting with a '/'.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-26 19:37:51 +02:00
Thomas Haller
fb7b08388e glib-compat: fix compatibility wrapper for g_type_ensure()
The previous implementaiton of the compatibility wrapper failed
with clang when used inside a macro. This seems like a compiler
error not to ignore the deprecation. Workaround by refactoring
the g_type_ensure() wrapper.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-25 22:05:23 +02:00
Thomas Haller
ed20177d27 core: refactor nm_utils_complete_generic() not to use a dynamic format string
For NMDeviceWifi and NMDeviceWimax, the printf format string for
nm_utils_complete_generic() was created based on ssid/nsp. Since
these input strings are untrusted, this is a serious bug.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-25 16:46:14 +02:00
Jiří Klimeš
6de4a548df po: fix an error in a plural form of a Russian translation (bgo #735186)
The error was produced by:
msgfmt -vc ru.po

https://bugzilla.gnome.org/show_bug.cgi?id=735186
2014-08-25 09:47:54 +02:00
Jiří Klimeš
a1907ec257 cli: simplify do_connections() now that we don't wait for "connection-read"
nm_remote_settings_list_connections() ensures the connections are loaded first.
We check "help" commands before getting connections, because it is time
intensive action.
2014-08-22 23:33:04 +02:00
Jiří Klimeš
3cf1131e89 cli: fix 'nmcli connection' so that it returns correct exit code
It was broken by commit 57e802f3aa, which made
nmcli always return success.

For example:
$ nmcli con add type blabla
2014-08-22 23:33:04 +02:00
Dan Winship
bc0c1247ee libnm-core: fix compile warning about unused-result 2014-08-22 23:11:59 +02:00
Thomas Haller
fdef81207f Merge branch 'th/bgo696936_normalize_settings'
https://bugzilla.gnome.org/show_bug.cgi?id=696936

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-22 15:30:50 +02:00
Thomas Haller
0fe0e62d68 libnm-util: properly disconnect "notify" signal for settings in NMConnection
When removing/replacing a NMSetting in an NMConnection, we have
to disconnect setting_changed_cb() from the "notify" signal.

Backport commit dfba4ce1e1 from
libnm-core.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-22 15:26:34 +02:00
Thomas Haller
8bb4c54090 libnm-core: fix NMSettingConnection:verify() not to modify interface-name
verify() used to modify interface-name of the base settings. This is
discouraged, because verify() should not touch the connection.

For libnm-core we can change behavior and only modify the connection
in normalize().

Also, be more strict not to verify() sucessfully on invalid
interface-name.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-22 15:24:31 +02:00
Thomas Haller
4f8b45e802 libnm-core: allow nm_setting_verify() to succeed individually without @all_settings
When calling nm_setting_verify() without providing any settings in @all_settings,
we assume that the setting on its own might be valid.
Only when checked together with all settings, we want to consider the setting
in the full context. nm_connection_verify() ensures to pass on a list of settings.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-22 15:24:31 +02:00
Thomas Haller
66d88dc00f libnm-core: add normalize of MTU for NMSettingInfiniband
Previously, NMSettingInfiniband:verify() silently modifies the
setting for invalid MTU. verify() should not do that.

For libnm-core we can change behavior and implement normalization
of MTU. This changes behavior for NMSettingInfiniband:verify() so
that MTU gets no longer fixed by verify() alone. Instead verify()
fails with a verification error.

Due the possibility to normalize the MTU, NM still can receive
invalid settings and fix it.

For libnm-core we don't change behavior, merely add a code comment.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-22 15:24:31 +02:00
Thomas Haller
6163263b42 libnm-core: make failure cases for nm_connection_normalize() more robust against bugs
We would expect that attempts to normalize a connection
are successful as verify() indicates. This way, a connection
is not modified if it cannot be fixed, and a connection will
be valid and modified after attempts to normalization.

However, there might be subtle, unexpected ways how this can fail.

For example, if NMSettingConnection:verify() detects a missing base type
setting, it returns NORMALIZABLE_ERROR if it finds a valid
NMSettingConnection:type. Normalization then adds an empty, default
setting. However, a new verify() might fail due to other reasons.
This would be a bug in NMSettingConnection:verify() which must not
indicate that it is able to normalize the connection, when it actually
is unable to do so.

Such bugs need fixing, but the code should be more robust to this case
because there might be complex, unanticipated situations.
Especially since NM relies on having a valid connection after normalize(),
so a strict error-out behavior is important.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-22 15:24:31 +02:00
Thomas Haller
c9be5a32da keyfile/tests: test reading minimal keyfiles that needs normalization of type and slave-type
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-22 15:24:31 +02:00
Thomas Haller
b8a475ba3f tests: refactor tests to use g_test framework (g_test_add_func)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-22 15:24:31 +02:00