| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the plugin supports interactive mode, but the VPN binary (like vpnc
or openvpn) doesn't support it, then the plugin should return
NM_VPN_PLUGIN_ERROR_INTERACTIVE_NOT_SUPPORTED from its connect_interactive()
hook. This lets NetworkManager know to fall back to plain Connect().
Since this notification is done through an error return, the VPN service
plugin code sees the failure and moves the plugin state back to
STOPPED. NetworkManager sees that state change, and terminates the
connection attempt while waiting for a reply to the Connect() method.
(VPN service plugins that don't support interactive mode at all don't
have this problem because that error is returned before the plugin's
state is moved to STARTING.)
To fix this, do two things:
1) if the connect_interactive() hook fails and returns the error
NM_VPN_PLUGIN_ERROR_INTERACTIVE_NOT_SUPPORTED, postpone the STOPPED
state change for a few seconds to allow NM time to fall back to
plain Connect(). We still want to move the plugin state back to
STOPPED eventually, because otherwise it could stay in STARTING
forever.
2) change state to STARTING only if the connect/connect_interactive
plugin hooks were successful. Otherwise the plugin would still be
in STARTING state, and it's not valid to call Connect()/ConnectInteractive()
during the STARTING state.
https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00091.html
https://bugzilla.redhat.com/show_bug.cgi?id=1298732
(cherry picked from commit abc700c5c71f474730f703c648b0b8dab455d7ba)
|
|
|
|
|
|
|
|
| |
This time in init_async_got_permissions().
Thereby, just use gs_unref_hash and gs_free_error for cleanup.
(cherry picked from commit 8029f59e4fcefe9786fb79d04ede5ea10e3c33c2)
|
|
|
|
|
|
|
|
|
| |
If the D-Bus call failed with error, @permissions would stay uninitialized.
Fixes: f2399a69760e8d14b91e523127eb187d6337530f
Fixes: 808f0126035a09c946c559c9b1c464c4523a8a0e
(cherry picked from commit e0601d501a09d2ea24c7d9d966056cb8042a49b3)
|
|
|
|
| |
(cherry picked from commit f2399a69760e8d14b91e523127eb187d6337530f)
|
|
|
|
|
|
|
|
| |
If the plugin didn't succeed connecting once, don't let the old timer fire
during a subsequent connection.
https://bugzilla.redhat.com/show_bug.cgi?id=1271973
(cherry picked from commit 842889bc5b588d191aa2c2cbcb73452ac8971cf5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now (since 3272ff6 libnm/libnm-glib: don't quit in the middle of asking for
secrets) always hook on the quit timer when NM asks the plugin if it needs
secrets. The timer is 20 seconds, which seems too short.
Let's make it three minutes. Don't bother adding another timer or using a
distinct timeout: it does no harm for the plugin to remain unused for three
minutes on a bus.
Another option would be to completely unhook it; however the plugin wouldn't
learn if the user cancelled the NM's secrets request and would remain unused
on the bus forever.
(cherry picked from commit b1512221bc29f24b86d464dc5117439c366fd299)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"nm-version-macros.h"
For libnm library, "nm-dbus-interface.h" contains defines like the D-Bus
paths of NetworkManager. It is desirable to have this header usable without
having a dependency on "glib.h", for example for a QT application. For that,
commit c0852964a890cf43cc2dcaeff41ac6edc5028f24 removed that dependancy.
For libnm-glib library, the analog to "nm-dbus-interface.h" is
"NetworkManager.h", and the same applies there. Commit
159e827a72f420048e12d318f8ba1edd3f641fc8 removed that include.
However, that broke build on PackageKit [1] which expected to get the
version macros by including "NetworkManager.h". So at least for libnm-glib,
we need to preserve old behavior so that a user including
"NetworkManager.h" gets the version macros, but not "glib.h".
Extract the version macros to a new header file "nm-version-macros.h".
This header doesn't include "glib.h" and can be included from
"NetworkManager.h". This gives as previous behavior and a glib-free
include.
For libnm we still don't include "nm-version-macros.h" to "nm-dbus-interface.h".
Very few users will actually need the version macros, but not using
libnm.
Users that use libnm, should just include (libnm's) "NetworkManager.h" to
get all headers.
As a special case, a user who doesn't want to use glib/libnm, but still
needs both "nm-dbus-interface.h" and "nm-version-macros.h", can include
them both separately.
[1] https://github.com/hughsie/PackageKit/issues/85
Fixes: 4545a7fe9670ce4d7c259c11c2cc853bfae6729b
(cherry picked from commit 7bf10a75db84655e65fe6216d248f7775c58ca23)
|
|
|
|
|
|
|
| |
Python is just too slow on some machines. Needed around twice the previous
limit on BCM2835 with Pidora 20, let's add some safety margin too.
(cherry picked from commit 81cc4d27b117d3d41947d1c974cc03ec521cb83b)
|
|
|
|
|
|
| |
nm_access_point_get_last_seen()
Fixes: cdb8a44a6e669d11e1d7f68cbdb2e576ef3e6eb4
|
|
|
|
| |
https://mail.gnome.org/archives/networkmanager-list/2015-April/msg00053.html
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the VPN plugin terminated and the user started it again, then the
quit timer will still be running and it sometimes happens that the
VPN plugin will quit while the UI is asking the user for secrets.
That's not very nice, so don't do that.
Reproducer: while connect to the VPN, suspend your laptop. Then
resume it, and immediately re-start the VPN connection. Watch the
secrets dialog disappear within a very short time.
https://bugzilla.gnome.org/show_bug.cgi?id=752237
|
|
|
|
| |
Use nm_clear_g_source().
|
|
|
|
|
|
|
|
|
|
|
|
| |
5. NetworkManager-1.0.3/libnm-glib/nm-remote-settings.c:493: var_compare_op: Comparing "error" to null implies that "error" might be null.
8. NetworkManager-1.0.3/libnm-glib/nm-remote-settings.c:508: var_deref_op: Dereferencing null pointer "error".
# 506| g_hash_table_remove (priv->pending, path);
# 507|
# 508|-> if (print_once && error->code == DBUS_GERROR_LIMITS_EXCEEDED) {
# 509| g_printerr ("Warning: libnm-glib:%s(): a D-Bus limit exceeded: %s. The application might not work properly.\n"
# 510| "Consider increasing max_replies_per_connection limit in /etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf "
(cherry picked from commit c157e3233d638dcd355ba1006031de6b98f3b679)
|
|
|
|
|
|
|
| |
No TAP support for previous versions and --tap argument is silently ignored,
confusing the TAP driver.
(cherry picked from commit c47c06470a0de70f5495d8919fd7f6b5369a5070)
|
|
|
|
|
|
| |
The test results in standard format are easily integrated into CI systems.
(cherry picked from commit 6463ce5dd9ffc1aae3ca9ddc4dac4e25fd815237)
|
|
|
|
|
|
| |
This will make it possible to use the TAP formatter.
(cherry picked from commit 380ed633180a1e20cb70b2cfde482a1cda8278e0)
|
|
|
|
|
|
| |
Parallel test runs would not be possible without this.
(cherry picked from commit d0e25ac8be339e4ddcae93978281493d6dee551c)
|
|
|
|
|
| |
This causes incorrect application behaviour, so libnm-glib should warn
at least.
|
|
|
|
|
|
|
|
|
| |
dbus_g_proxy_call() should set GError if returning FALSE. But apparently there
is a bug in dbus-glib and the error can be NULL.
https://bugzilla.redhat.com/show_bug.cgi?id=1224819
(cherry picked from commit f46eb1fc2086fe0bb952da52c276a1b6ded868dc)
|
|
|
|
|
|
| |
Touches a weak spot on clang's soul.
(cherry picked from commit fd41aa451bc83d17565bfd57f68558c9aff6358f)
|
|
|
|
|
| |
Fixes: e7356ef0a6fa94b20850d6f8ca73bfac17589510
(cherry picked from commit b0b15e47183eaf7526628efdf4dfdd25391cbfad)
|
|
|
|
| |
(cherry picked from commit e7356ef0a6fa94b20850d6f8ca73bfac17589510)
|
|
|
|
| |
(cherry picked from commit 76745817c3e77b7d6c22290a7564b73224147516)
|
|
|
|
| |
(cherry picked from commit c50f30e79c67593532392f0f251d662e4294f5b2)
|
|
|
|
|
|
|
|
|
| |
Otherwise, if the caller doesn't provide a cancellable we'll try to
access a bogus ccd->cancellable in check_connectivity_data_free() and
crash.
https://bugzilla.gnome.org/show_bug.cgi?id=740841
(cherry picked from commit 8c32ea916ba0c86c4c50d6d4c7b6021adfbfdf02)
|
|
|
|
|
|
|
|
| |
NMRemoteSettings queues a bunch of async NMRemoteConnection creations,
but wasn't doing anything to ensure that it was still alive when they
completed. Pointed out by Cosimo Cecchi.
https://bugzilla.gnome.org/show_bug.cgi?id=742138
|
|
|
|
| |
libnm-util.so.2.7.0, libnm-glib.so.4.9.0
|
|
|
|
| |
Cleans up all of the warnings that aren't overly annoying to clean up.
|
|
|
|
|
|
|
|
| |
Error: CHECKED_RETURN (CWE-252): [#def12]
NetworkManager-0.9.11.0/libnm-core/tests/test-general.c:348: check_return: Calling "nm_setting_verify" without checking return value (as is done elsewhere 37 out of 45 times).
...
(cherry picked from commit 6603e7ffde2b6a90206ea2e321cdff33d5b1c680)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Libraries need to include <gi18n-lib.h>, not <gi18n.h>, so that _()
will get defined to "dgettext (GETTEXT_DOMAIN, string)" rather than
"gettext (string)" (which will use the program's default domain, which
works fine for programs in the NetworkManager tree, but not for
external users). Likewise, we need to call bindtextdomain() so that
gettext can find the translations if the library is installed in a
different prefix from the program using it (and
bind_textdomain_codeset(), so it will know the translations are in
UTF-8 even if the locale isn't).
(The fact that no one noticed this was broken before is because the
libraries didn't really start returning useful translated strings much
until 0.9.10, and none of the out-of-tree clients have been updated to
actually show those strings to users yet.)
|
|
|
|
|
|
|
|
|
|
|
| |
config.h should be included from every .c file, and it should be
included before any other include. Fix that.
(As a side effect of how I did this, this also changes us to
consistently use "config.h" rather than <config.h>. To the extent that
it matters [which is not much], quotes are more correct anyway, since
we're talking about a file in our own build tree, not a system
include.)
|
|
|
|
|
|
| |
They require a tty or X11 displays, thus are not suitable for headless runs
(such as in mock). Furthermore, they die with the tty or X11 session, which
is somehow late -- a lot of them may accumulate. Let's kill them right away.
|
|
|
|
|
|
|
|
| |
When using a private bus connection, the service is never marked
as running when settings are initialized asynchronously. Successfully
opening a socket in NM's runtime directory should already imply
a running service, so just mark it as such (as we already do in
the synchronous path).
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Several nm-device-*.c files apparently originally used
nm-device-ethernet.c as a template, but missed a reference to "eth" in
class_init.
|
|
|
|
|
|
|
| |
_nm_client_is_object_path() had been copied from
g_variant_is_object_path() with a note that it should be replaced when
we depended on GLib > 2.24, but it got missed when we actually updated
the dependency. Fix it now. (Also fix a nearby typo.)
|
|
|
|
|
|
|
| |
NMRemoteSettings:service-running
Test that the code to track whether NetworkManager is running works
correctly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NMObjectCache was assuming there would never be more than one object
with the same path, but since NMClient is an NMObject, it was getting
cached too, so if you created two clients and then unreffed one of
them, it's possible the wrong one could get left in the cache, causing
a crash the next time the other one called nm_object_cache_clear().
Fix this by only adding NMObjects to the cache in the codepaths where
we also check to see if the object was already in the cache.
(This also means we can remove the "except" argument to
nm_object_cache_clear(), since the NMClient won't be cached any more.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
parent
test-nm-client.c and test-remote-settings-client.c were using their
own assertion macros so they could kill the test service on assertion
failure. Except that some new code didn't get the memo and used the
g_assert* macros. Not to mention that sometimes the tests would crash
outside of an assertion macro.
We can make test-networkmanager-service.py notice that its parent has
crashed by opening a pipe between them and taking advantage of the
fact that the pipe will be automatically closed if the parent crashes.
So then test-networkmanager-service.py just has to watch for that, and
exit if the pipe closes.
Then that lets us drop the test_assert* macros and just use g_assert*
instead.
|
| |
|
|
|
|
|
|
|
|
| |
Use "TESTS = tests-nm-client test-remote-settings-client" rather than
overriding "check-local".
Add a script "libnm-test-launch.sh" that will handle redirecting the
test via dbus-launch if needed.
|
|
|
|
|
|
|
|
| |
Rather than passing the path to the test service on the command line,
compile it into the test programs.
(Among other things, this makes it easier to run the test directly
from the command line.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang warns:
make[4]: Entering directory `./NetworkManager/libnm-glib'
CC libnm_glib_la-nm-remote-connection.lo
nm-remote-connection.c:77:3: error: redefinition of typedef 'RemoteCall' is a C11 feature [-Werror,-Wtypedef-redefinition]
} RemoteCall;
^
nm-remote-connection.c:67:27: note: previous definition is here
typedef struct RemoteCall RemoteCall;
^
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
| |
- register a weak references and ensure that the connection
is removed when expected.
- disconnect the vis_new_connection_cb() handler
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
| |
test_make_invisible() forgot to disconnect handler invis_removed_cb().
Later, during test_remove_connection(), the connection will be eventually
removed and the callback will corrupt the stack by writing to the '&done'
user data.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
call has ended (bgo #733915)
We cannot rely on connectivity data freeing to disconnect the signal,
because the simple async result might be kept alive by external
code (for example the language runtime for JS), but we must not
call dbus_g_proxy_cancel_call() if that cancellable is cancelled or
reused afterwards.
https://bugzilla.gnome.org/show_bug.cgi?id=733915
|
|
|
|
|
|
|
|
|
|
| |
Move libnm-glib's test-fake-nm.py and test-remote-settings-service.py
to tools/, merge them together into a single program, and fix a few
bugs (notably some missing signal emissions in the Settings service).
Although they are currently only used by libnm-glib's tests, they are
generic enough that they could be used by other code in the future
(and in particular, they will be used by libnm's tests as well).
|