summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cli: initialize readline before installing the redisplay handlerlr/readline-initLubomir Rintel2018-10-231-0/+4
| | | | | | | | | | | | | | | | | | | Otherwise readline decides to initialize terminal handling at the first readline call, and if that happens at the point it sees our non-echoing rl_redisplay. At that point, unless already intialized, readline wrongly convinces itself we do our own handling of terminal peculiarities (such as cursor movement, or erases). We do not -- we merely wrap the stock rl_redisplay(), temporarily hiding the actual characters. The rl_initialize() in nmc_readline_echo()s fixes broken line editing in password prompts that weren't preceded a previous non-password prompt. The other one is there for consistency only. (I guess we should be initializing readline before use anyway; although it seems to initialize itself anyway if we fail to do so...) https://github.com/NetworkManager/NetworkManager/pull/241
* Revert "keyfile: drop with_extension argument from _internal_write_connection()"Thomas Haller2018-10-231-2/+5
| | | | | | | | | | | For upstream, we changed behavior here. However, I think certain downstream don't want to do that, and revert patch "d37ad15f12 keyfile: also add ".nmconnection" extension when writing keyfiles in /etc". For that to make easier, keep the upstream sources closer to what was. Revert. This reverts commit e93d8cdb74d1bcd6d23ba33b4a1601b0e6dd8b99.
* contrib: adjust NM-log for changes to platform loggingThomas Haller2018-10-231-2/+2
| | | | Fixes: 8f107f5c00258c7a4fb780a25f299af6f116f575
* wifi/iwd: merge branch 'balrog-kun/iwd-fixes' (#236)Thomas Haller2018-10-232-114/+261
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/236
| * wifi/iwd: check priv->dbus_obj in is_availableAndrew Zaborowski2018-10-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | is_available would recently return true after IWD had disconnected if a connection was active because it would check that priv->dbus_station_proxy was non-NULL (i.e. that the DBus interface was still visible, which it wasn't) but that check would be overridden if the NMDevice state was activated. Now require priv->dbus_obj to be non-NULL, which would even be enough on its own although I'm leaving the previous check there too to catch potential IWD states we don't support in which priv->dbus_station_proxy is NULL without an active connection.
| * wifi/iwd: add a sanity check for duplicate Networks on DBusAndrew Zaborowski2018-10-231-3/+12
| | | | | | | | | | | | | | | | | | Sanity check networks received from the Station.GetOrderedNetworks() DBus method. Duplicates shouldn't happen but the code should be safe against bogus data received over DBus. There was a recent bug in a library used by IWD causing occasional duplicates to be returned which would cause invalid memory accesses reported by valgrind in NM because g_hash_table_insert would free what we passed as the key.
| * wifi/iwd: start a scan immediately after device appearsAndrew Zaborowski2018-10-231-18/+30
| | | | | | | | | | Start a new scan with 0 delay after a device goes into the disconnected state, goes UP or freshly appears on DBus instead of waiting 10 seconds.
| * wifi/iwd: handle forgetting connection profilesAndrew Zaborowski2018-10-231-13/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Watch for connection-removed events and delete corresponding IWD network configs if found. This mainly changes anything for 802.1X networks where the deleted NM connections might annoyingly re-appear after a restart. For PSK networks though it'll make IWD forget the password which, until now, would be remembered by IWD even if it was removed or changed in the NM profile, which is a bug. This is still fragile because we don't handle "connection-updated" events so the data->mirror_connection pointer for a known network record may after some time point to an NMSettingsConnection with a different SSID or security type and there are corner cases where the IWD-side profile will not be forgotten. At least I'm trying to make sure we don't crash and don't wrongly remove any IWD profile which could also be annoying for complicated EAP configs.
| * wifi/iwd: print warning if known network exists in interface-addedAndrew Zaborowski2018-10-231-2/+5
| | | | | | | | | | | | | | Something is possibly wrong with the DBus signal handling if a newly added KnownNetwork interface already has an entry in priv->known_networks, but since we handle this case add a warning and update the GDBusProxy pointer for that existing entry.
| * wifi/iwd: return existing connection from mirror_8021x_connectionAndrew Zaborowski2018-10-231-7/+25
| | | | | | | | | | | | | | | | | | interface_added expects mirror_8021x_connection() to return the pointer to the existing connection if one exists, and NULL on error, rather than NULL if a conneciton exists. While touching that, add logic to return specifically a connection with EAP method set to 'external' if one exists even though this should not affect any other logic we have currently.
| * wifi/iwd: use nm_act_request_get_secrets if no PSK for AP foundAndrew Zaborowski2018-10-231-22/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | Some internal logic causes the secrets in a connection to be occasionally moved to NMSettingConnection's priv->system_secrets after a connection attempt so we need to use nm_act_request_get_secrets to get them added to the device's settings connection and applied connection if the PSK is missing during an AP or AdHoc mode activation (in infrastructure mode we already do secret requests though they're cached by IWD in most cases). The common steps for the PSK available and unavailable scenarios is moved from act_stage2_config to act_set_mode.
| * wifi/iwd: skip creating a GVariant for DBus calls with no paramsAndrew Zaborowski2018-10-231-10/+8
| | | | | | | | | | g_dbus_proxy_call and other GDBus function can accept a NULL as the method call parameters.
| * wifi/iwd: use g_variant_lookup in property change handlersAndrew Zaborowski2018-10-231-41/+12
|/ | | | | | This simplifies the code by using g_variant_lookup. In this handler where we parse more than one property this is probably slower although the number of string comparisons will be the same.
* core,libnm: merge branch 'th/setting-hash'Thomas Haller2018-10-2316-83/+128
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/29
| * libnm: hash settings in NMConnection by gtypeThomas Haller2018-10-231-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NMConnection keeps a list (hash table) of all settings. There are two lookup methods to find a setting in a connection: - nm_connection_get_setting() by GType - nm_connection_get_setting_by_name() by name Note, that nm_connection_get_setting_by_name() first converts the name to a GType, and then looks up the setting by GType. But then, nm_connection_get_setting() would again convert the GType to the type name, and hash the name. That is pointless, just index by GType directly. Maybe, using a hash table is anyway overkill because commonly there are only a handful of settings in a connection. Regardless of that, change the hashing.
| * core: don't cast return value of nm_device_get_applied_setting()Thomas Haller2018-10-2314-66/+89
| |
| * device: return void pointer from nm_device_get_applied_setting()Thomas Haller2018-10-233-4/+10
|/ | | | | Literally ever use of nm_device_get_applied_setting() requires a cast. Just don't.
* keyfile: merge branch 'th/keyfile-filename-utils'Thomas Haller2018-10-239-185/+177
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/239
| * keyfile: move and rename NM_CONFIG_KEYFILE_PATH_DEFAULT defineThomas Haller2018-10-232-3/+3
| |
| * keyfile: drop with_extension argument from _internal_write_connection()Thomas Haller2018-10-231-5/+2
| | | | | | | | | | | | | | For non-test code, we always passed TRUE. For test code, setting with_extension is fine too, so drop the argument.
| * initrd: use keyfile util for creating filenameThomas Haller2018-10-231-6/+4
| |
| * keyfile/trivial: rename keyfile related functionsThomas Haller2018-10-236-28/+28
| | | | | | | | | | | | NM_CONFIG_KEYFILE_PATH_IN_MEMORY is now called NMS_KEYFILE_PATH_NAME_RUN. This name seems odd in the current context, it will be more suitable when we also have NMS_KEYFILE_PATH_NAME_LIB (for /usr/lib).
| * keyfile: move keyfile utilities from src/ to libnm-core/Thomas Haller2018-10-235-134/+135
| | | | | | | | | | | | | | These utilities are concerned with valid file names (as NetworkManager daemon requires it). This is relevant for everybody who wants to write keyfile files directly. Hence, move it to libnm-core. Still as internal API.
| * initrd: use cleanup attribute and return early from output_conn()Thomas Haller2018-10-231-27/+23
|/
* core: merge branch 'th/file-is-in-path'Thomas Haller2018-10-2312-68/+239
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/238
| * core: use nm_utils_file_is_in_path() for checking pathsThomas Haller2018-10-232-58/+5
| | | | | | | | | | | | | | For one, re-use the helper function instead of re-implementing the check at multiple places. Also, with this duplicate path separators are accepted.
| * core: add nm_utils_file_is_in_path() for checking pathsThomas Haller2018-10-234-0/+91
| | | | | | | | | | | | | | | | Add a helper function for the common check whether a file is inside a path. Also, this function handles special cases like repeated file separators. However, as it is still entirely text based, it also cannot recognize if two (literally) different paths reference the same inode/file.
| * systemd: fix handling special cases kill_dots and path_simplify()Thomas Haller2018-10-232-13/+21
| | | | | | | | | | | | | | Previously, paths like ".", "./", ./." would all result in an empty path. That is wrong, one dot must be kept. https://github.com/systemd/systemd/commit/afbae3e9f23dc6682d48a1cc3585e8429ef07d8b
| * core: add "nm-sd-utils.h" to access system internal helperThomas Haller2018-10-236-3/+128
|/ | | | | | | | | | | | | | | | | | We have a fork of a lot of useful systemd helper code. However, until now we shyed away from using it aside from the bits that we really need. That means, although we have some really nice implementations in our source-tree, we didn't use them. Either we were missing them, or we had to re-implement them. Add "nm-sd-utils.h" header to very carefully make internal systemd API accessible to the rest of core. This is not intended as a vehicle to access all of internal API. Instead, this must be used with care, and only a hand picked selection of functions must be exposed. Use with caution, but where it makes sense.
* initrd: cmdline-reader: fix setting uint propertiesBeniamino Galvani2018-10-231-3/+11
| | | | | | | | | | Previously a uint property was assigned with a guint64 value, which has a different size. Fix this and add a warning when the read value can't be converted. Fixes: ecc074b2f8a6240d50f590c898b33158806b51a1 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/66
* ndisc: mark a keep-alive variable unusedLubomir Rintel2018-10-221-1/+1
| | | | | | | | | Fixed build with clang: src/ndisc/nm-lndp-ndisc.c:494:27: error: unused variable 'ndisc_keep_alive' [-Werror,-Wunused-variable] gs_unref_object NMNDisc *ndisc_keep_alive = g_object_ref (ndisc); ^ Fixes: 9aa628cedb707e9c4f0e0dba437ec22375a0032e
* checkpatch: quote variable in "checkpatch-feature-branch.sh"Thomas Haller2018-10-221-3/+3
|
* merge: branch 'lr/auth-dialog'Lubomir Rintel2018-10-222-26/+364
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/173
| * clients/secret-agent-simple: support auth helperslr/auth-dialogLubomir Rintel2018-10-221-6/+312
| | | | | | | | | | | | | | | | | | This makes it possible to utilize agents in the "external UI" mode instead of hardcoded handling of VPN secrets requests. Ideally this would be turned into a library so that nm-applet can share the code, but figuring out the right API might be a non-trivial undertaking.
| * service-plugin: add a warning here and thereLubomir Rintel2018-10-221-2/+14
| | | | | | | | | | We're basically rather careless when parsing the auth-dialog protocol. Let's add some warning so we get an early alert when something's wrong.
| * service-plugin: allow continuations in the auth-dialog protocolLubomir Rintel2018-10-221-20/+40
|/ | | | | | | | | | | | | | Equals sign was picked as a continuation character arbitratily. It would simplify parsing, if we cared. DATA_KEY=some-key DATA_VAL=string =continued after a line break SECRET_KEY=key names =can have =continuations too SECRET_VAL=value DONE
* contrib/rpm: don't depend NetworkManager-ovs package on openvswitch on RHELThomas Haller2018-10-221-0/+2
| | | | | | | | | | | | | On RHEL, openvswitch package is not in the base set of packages. Hence, we cannot depend NetworkManager-ovs package on openvswitch. This isn't really a problem, because NetworkManager's OVS plugin must anyway behave graceful when openvswich service is not running or not available. It only means, that a user who wants to use the OVS plugin needs to explicitly install the openvswitch package. https://bugzilla.redhat.com/show_bug.cgi?id=1629178 https://bugzilla.redhat.com/show_bug.cgi?id=1633190
* test/meson: increase timeout for some testsThomas Haller2018-10-222-4/+6
| | | | | During gitlab-ci, some tests may take a long time. Increase the default timeout.
* checkpatch: support ranges for "checkpatch-feature-branch.sh"Thomas Haller2018-10-221-10/+19
| | | | | Improve "checkpatch-feature-branch.sh" to support accepting range as argument.
* core/trivial: fix whitespaceThomas Haller2018-10-221-1/+1
|
* platform/tests: extend timeout for link-linux tests with mesonThomas Haller2018-10-221-1/+1
| | | | | Our gitlab CI sometimes takes a long time with the "/link/create-many-links/1000" test.
* checkpatch: fix "checkpatch-feature-branch.sh" for master branchThomas Haller2018-10-221-1/+5
| | | | | | | | | | | | | The main purpose of "checkpatch-feature-branch.sh" is to test all patches of a feature branch. When we run the script against master (or nm-1-*), then there is no feature branch. Previously, the script would just error out. That is not very useful, in particular as we call this from gitlab-ci, which also runs on master. Instead, in that case, test the HEAD.
* gitlab: merge branch 'th/gitlab-ci'Thomas Haller2018-10-229-28/+180
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/25
| * gitlab: add .gitlab-ci.yml for gitlab CIThomas Haller2018-10-221-0/+91
| | | | | | | | See-also: https://docs.gitlab.com/ee/ci/yaml/
| * checkpatch: add "contrib/scripts/checkpatch-feature-branch.sh" scriptThomas Haller2018-10-222-0/+39
| | | | | | | | | | | | | | | | | | This takes current HEAD branch, and finds all the commits what are not on master or one of the nm-1-* branches, and runs checkpatch.pl on each. The use is to run checkpatch.pl on all patches of a feature branch.
| * contrib: make "contrib/fedora/REQUIRED_PACKAGES" executable scriptThomas Haller2018-10-222-4/+21
| | | | | | | | It will be called by .gitlab-ci.yml to install the packages.
| * meson: Fix platform testsJan Alexander Steffens (heftig)2018-10-223-21/+24
| | | | | | | | | | All platform tests were run twice with the `linux` platform, instead of `fake` and `linux`, as expected.
| * platform/tests: fix test-nmp-object when running on system without udevThomas Haller2018-10-221-2/+4
| | | | | | | | | | Fix the test, to check that the nmp-object was deleted. It is no longer visible and no longer alive.
| * platform/tests: don't compare dangling pointer in "test-nmp-object.c"Thomas Haller2018-10-221-1/+1
|/ | | | | | This wouldn't even dereference the dangling pointer, but merely comparing it for pointer equality. Still, it's actually undefined behavior. Avoid it.
* ppp: check ppp status against correct typeSven Schwermer2018-10-221-1/+1
| | | | | | ppp_status is of type NMPPPStatus whereas PHASE_RUNNING is pppd's type. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/28