summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-10-10keyfile/tests: drop unused variablesHEADmasterThomas Haller1-2/+0
Fixes: e886e5364eba64b2a143f02930b646e3d9d30619
2018-10-10platform/netlink: fix overrun in attribute iteration in nla_ok()Thomas Haller1-1/+1
See-also: https://github.com/thom311/libnl/commit/123dc07bcc3f402a500edf370d2000e171c91b34 See-also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1045b03e07d85f3545118510a587035536030c1c
2018-10-10cli: merge branch 'th/cli-drop-some-global'Thomas Haller13-190/+265
https://github.com/NetworkManager/NetworkManager/pull/225
2018-10-10cli: don't needlessly cast function pointer for rl_attempted_completion_functionThomas Haller2-4/+4
2018-10-10cli: don't access global nm_cli variable from nmc_setting_set_property()Thomas Haller3-23/+29
2018-10-10cli: don't use global variable nm_cli in nmc_terminal_spawn_pager()Thomas Haller6-18/+26
print_required_fields() still accesses the global variable. We can only move the uses of globals up the call-stack, one bit at a time.
2018-10-10cli: don't use global nm_cli in nmc_readline_*()Thomas Haller6-135/+194
Globals are bad. Don't let nmc_readline_helper() access nm_cli. Instead, pass nmc_config along. nmc_config albeit being a complex struct, is much more begning: - the configuration nmc_config is initialized early on and afterwards immutable. - it only contains simple fields, which affect the behavior. - it's not a global. While passing around the complex configuration struct, it is clear that all callpaths don't access additional global information.
2018-10-10cli: don't pass complex info argument to active_connection_hint()Thomas Haller1-10/+12
Untangle the amount or agruments passed to active_connection_hint().
2018-10-09devices/olpc: correct the signal handler argumentsLubomir Rintel1-1/+1
Commit 631ca806 ("devices/wifi: flip meaning of scanning allowed signal") added a "periodic" argument, but the OLPC companion handler was not adjusted. Fix it now. https://github.com/NetworkManager/NetworkManager/pull/222 Fixes: 631ca80692e4caec0b90e2301bbe5378889ad944
2018-10-09cli: fix memory leakBeniamino Galvani1-0/+4
activate_connection_editor_cb() must free @info and unref the device.
2018-10-09cli: fix cleanup after activation from editorBeniamino Galvani1-4/+6
progress_activation_editor_cb() is called multiple times every 120 milliseconds and it must free resources only the last time. Fixes: f0a26865458a42dd35975efd9bf6fdd2d9445c08 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/51
2018-10-08libnm-core: fix other int comparisons in team settingBeniamino Galvani1-7/+7
I forgot to update them when applying commit 72b454177121. Fixes: 72b45417712186b0247ba5a69e42d54a27763fb0
2018-10-07merge: branch 'lr/wpan-channel'Lubomir Rintel12-27/+249
https://github.com/NetworkManager/NetworkManager/pull/209
2018-10-07cli: add support for wpan.page and wpan.channel propertiesLubomir Rintel2-2/+32
2018-10-07devices/wpan: set channel on activationLubomir Rintel1-0/+10
2018-10-07platform/wpan: allow setting channelLubomir Rintel5-0/+40
2018-10-07core/setting-wpan: add page and channel propertiesLubomir Rintel4-3/+137
2018-10-07core/setting-wpan: fix some whitespace errorsLubomir Rintel1-15/+15
2018-10-07contrib/checkpatch: remove the first character off a diffLubomir Rintel1-1/+1
Otherwise the leading whitespace checks won't work on patches.
2018-10-07contrib/checkpatch: check some more whitespace troubleLubomir Rintel1-1/+9
2018-10-07contrib/checkpatch: correctly separate indentation across hunksLubomir Rintel1-6/+6
2018-10-07merge: branch 'bg/covscan'Beniamino Galvani9-22/+49
Some coverity fixes. https://github.com/NetworkManager/NetworkManager/pull/220
2018-10-07libnm-core: fix int comparisons in team settingThomas Haller2-3/+30
2018-10-06libnm-core: remove unneeded comparisonsBeniamino Galvani1-2/+2
a_gendata and b_gendata cannot be NULL. This makes coverity happy.
2018-10-06shared/nm-utils: avoid a coverity warningBeniamino Galvani1-1/+1
1. NetworkManager-1.14.0/shared/nm-utils/nm-shared-utils.c:1242: value_overwrite: Overwriting previous write to "ch" with value from "v". 2. NetworkManager-1.14.0/shared/nm-utils/nm-shared-utils.c:1239: assigned_value: Assigning value from "++str[0]" to "ch" here, but that stored value is overwritten before it can be used. # 1237| if (ch >= '0' && ch <= '7') { # 1238| v = v * 8 + (ch - '0'); # 1239|-> ch = (++str)[0]; # 1240| } # 1241| } Don't assign ch when it is going to be overwritten.
2018-10-06device: fix a wrong comparisonBeniamino Galvani1-1/+1
'i <= G_MAXINT' is always true.
2018-10-06dispatcher: fix shellcheck warningsBeniamino Galvani1-2/+2
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. And likewise, prefer [ p ] || [ q ] over [ p -o q ]. https://github.com/koalaman/shellcheck/wiki/SC2166
2018-10-06libnm-core: use g_variant_type_equal() to compare variant typesBeniamino Galvani2-2/+2
Even if a direct pointer comparison should be fine, use the proper function. GVariantType documentation says: "Two types may not be compared by value; use g_variant_type_equal() or g_variant_type_is_subtype_of()." This also fixes coverity warnings.
2018-10-06libnm-core: fix coverity warningBeniamino Galvani1-11/+11
3. NetworkManager-1.14.0/libnm-core/nm-utils.c:4944: var_compare_op: Comparing "str" to null implies that "str" might be null. 4. NetworkManager-1.14.0/libnm-core/nm-utils.c:4958: var_deref_op: Dereferencing null pointer "str". # 4956| # 4957| /* do some very basic validation to see if this might be a JSON object. */ # 4958|-> if (str[0] == '{') { # 4959| gsize l; # 4960|
2018-10-05systemd: merge branch systemd into masterThomas Haller36-435/+621
https://github.com/NetworkManager/NetworkManager/pull/186
2018-10-05systemd: comment out unused code in utf8.cThomas Haller1-1/+11
Unused code is nice, because on update we don't need to check whether a patch affects behavior. Mark code that is unused as such.
2018-10-05dhcp6: fix an off-by-one error in dhcp6_option_parse_domainnameEvgeny Vereshchagin1-1/+1
==14==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200055fa9c at pc 0x0000005458f1 bp 0x7ffc78940d90 sp 0x7ffc78940d88 READ of size 1 at 0x60200055fa9c thread T0 #0 0x5458f0 in dhcp6_option_parse_domainname /work/build/../../src/systemd/src/libsystemd-network/dhcp6-option.c:555:29 #1 0x54706e in dhcp6_lease_set_domains /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-lease.c:242:13 #2 0x53fce0 in client_parse_message /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-client.c:984:29 #3 0x53f3bc in client_receive_advertise /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-client.c:1083:13 #4 0x53d57f in client_receive_message /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-client.c:1182:21 #5 0x7f0f7159deee in source_dispatch /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:3042:21 #6 0x7f0f7159d431 in sd_event_dispatch /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:3455:21 #7 0x7f0f7159ea8d in sd_event_run /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:3512:21 #8 0x531f2b in fuzz_client /work/build/../../src/systemd/src/fuzz/fuzz-dhcp6-client.c:44:9 #9 0x531bc1 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-dhcp6-client.c:53:9 #10 0x57bec8 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:570:15 #11 0x579d67 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:479:3 #12 0x57dc92 in fuzzer::Fuzzer::MutateAndTestOne() /src/libfuzzer/FuzzerLoop.cpp:707:19 #13 0x580ca6 in fuzzer::Fuzzer::Loop(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /src/libfuzzer/FuzzerLoop.cpp:838:5 #14 0x55e968 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:764:6 #15 0x551a1c in main /src/libfuzzer/FuzzerMain.cpp:20:10 #16 0x7f0f701a082f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) #17 0x41e928 in _start (/out/fuzz-dhcp6-client+0x41e928) https://github.com/systemd/systemd/pull/10200 https://github.com/systemd/systemd/commit/b387d3c1327a3ad2a2509bd3d3491e674392ff21
2018-10-05dhcp6: check option length before reading valuesYu Watanabe3-7/+8
Fixes oss-fuzz#10746 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10746. https://github.com/systemd/systemd/pull/10213 https://github.com/systemd/systemd/commit/84452783b8bcc44e0dbb7fa6ddc6dad8c064bdfe
2018-10-05systemd: update code from upstream (2018-10-04)Thomas Haller44-460/+645
This is a direct dump from systemd git. ====== SYSTEMD_DIR=../systemd COMMIT=b62f9008668a5330c61b4de7e0d48147bcd1edf7 ( cd "$SYSTEMD_DIR" git checkout "$COMMIT" git reset --hard git clean -fdx ) git ls-files :/src/systemd/src/ \ :/shared/nm-utils/unaligned.h | \ xargs -d '\n' rm -f nm_copy_sd() { mkdir -p "./src/systemd/$(dirname "$1")" cp "$SYSTEMD_DIR/$1" "./src/systemd/$1" } nm_copy_sd_shared() { mkdir -p "./shared/nm-utils/" cp "$SYSTEMD_DIR/$1" "./shared/nm-utils/${1##*/}" } nm_copy_sd "src/basic/alloc-util.c" nm_copy_sd "src/basic/alloc-util.h" nm_copy_sd "src/basic/async.h" nm_copy_sd "src/basic/env-util.c" nm_copy_sd "src/basic/env-util.h" nm_copy_sd "src/basic/escape.c" nm_copy_sd "src/basic/escape.h" nm_copy_sd "src/basic/ether-addr-util.c" nm_copy_sd "src/basic/ether-addr-util.h" nm_copy_sd "src/basic/extract-word.c" nm_copy_sd "src/basic/extract-word.h" nm_copy_sd "src/basic/fileio.c" nm_copy_sd "src/basic/fileio.h" nm_copy_sd "src/basic/fd-util.c" nm_copy_sd "src/basic/fd-util.h" nm_copy_sd "src/basic/fs-util.c" nm_copy_sd "src/basic/fs-util.h" nm_copy_sd "src/basic/hash-funcs.c" nm_copy_sd "src/basic/hash-funcs.h" nm_copy_sd "src/basic/hashmap.c" nm_copy_sd "src/basic/hashmap.h" nm_copy_sd "src/basic/hexdecoct.c" nm_copy_sd "src/basic/hexdecoct.h" nm_copy_sd "src/basic/hostname-util.c" nm_copy_sd "src/basic/hostname-util.h" nm_copy_sd "src/basic/in-addr-util.c" nm_copy_sd "src/basic/in-addr-util.h" nm_copy_sd "src/basic/io-util.c" nm_copy_sd "src/basic/io-util.h" nm_copy_sd "src/basic/list.h" nm_copy_sd "src/basic/log.h" nm_copy_sd "src/basic/macro.h" nm_copy_sd "src/basic/mempool.h" nm_copy_sd "src/basic/mempool.c" nm_copy_sd "src/basic/parse-util.c" nm_copy_sd "src/basic/parse-util.h" nm_copy_sd "src/basic/path-util.c" nm_copy_sd "src/basic/path-util.h" nm_copy_sd "src/basic/prioq.h" nm_copy_sd "src/basic/prioq.c" nm_copy_sd "src/basic/process-util.h" nm_copy_sd "src/basic/process-util.c" nm_copy_sd "src/basic/random-util.c" nm_copy_sd "src/basic/random-util.h" nm_copy_sd "src/basic/refcnt.h" nm_copy_sd "src/basic/set.h" nm_copy_sd "src/basic/signal-util.h" nm_copy_sd "src/basic/siphash24.h" nm_copy_sd "src/basic/socket-util.c" nm_copy_sd "src/basic/socket-util.h" nm_copy_sd "src/basic/sparse-endian.h" nm_copy_sd "src/basic/stat-util.c" nm_copy_sd "src/basic/stat-util.h" nm_copy_sd "src/basic/stdio-util.h" nm_copy_sd "src/basic/string-table.c" nm_copy_sd "src/basic/string-table.h" nm_copy_sd "src/basic/string-util.c" nm_copy_sd "src/basic/string-util.h" nm_copy_sd "src/basic/strv.c" nm_copy_sd "src/basic/strv.h" nm_copy_sd "src/basic/time-util.c" nm_copy_sd "src/basic/time-util.h" nm_copy_sd "src/basic/umask-util.h" nm_copy_sd_shared "src/basic/unaligned.h" nm_copy_sd "src/basic/utf8.c" nm_copy_sd "src/basic/utf8.h" nm_copy_sd "src/basic/util.c" nm_copy_sd "src/basic/util.h" nm_copy_sd "src/libsystemd-network/arp-util.c" nm_copy_sd "src/libsystemd-network/arp-util.h" nm_copy_sd "src/libsystemd-network/dhcp6-internal.h" nm_copy_sd "src/libsystemd-network/dhcp6-lease-internal.h" nm_copy_sd "src/libsystemd-network/dhcp6-network.c" nm_copy_sd "src/libsystemd-network/dhcp6-option.c" nm_copy_sd "src/libsystemd-network/dhcp6-protocol.h" nm_copy_sd "src/libsystemd-network/dhcp-identifier.c" nm_copy_sd "src/libsystemd-network/dhcp-identifier.h" nm_copy_sd "src/libsystemd-network/dhcp-internal.h" nm_copy_sd "src/libsystemd-network/dhcp-lease-internal.h" nm_copy_sd "src/libsystemd-network/dhcp-network.c" nm_copy_sd "src/libsystemd-network/dhcp-option.c" nm_copy_sd "src/libsystemd-network/dhcp-packet.c" nm_copy_sd "src/libsystemd-network/dhcp-protocol.h" nm_copy_sd "src/libsystemd-network/lldp-internal.h" nm_copy_sd "src/libsystemd-network/lldp-neighbor.c" nm_copy_sd "src/libsystemd-network/lldp-neighbor.h" nm_copy_sd "src/libsystemd-network/lldp-network.c" nm_copy_sd "src/libsystemd-network/lldp-network.h" nm_copy_sd "src/libsystemd-network/network-internal.c" nm_copy_sd "src/libsystemd-network/network-internal.h" nm_copy_sd "src/libsystemd-network/sd-dhcp6-client.c" nm_copy_sd "src/libsystemd-network/sd-dhcp6-lease.c" nm_copy_sd "src/libsystemd-network/sd-dhcp-client.c" nm_copy_sd "src/libsystemd-network/sd-dhcp-lease.c" nm_copy_sd "src/libsystemd-network/sd-ipv4ll.c" nm_copy_sd "src/libsystemd-network/sd-ipv4acd.c" nm_copy_sd "src/libsystemd-network/sd-lldp.c" nm_copy_sd "src/libsystemd/sd-event/sd-event.c" nm_copy_sd "src/libsystemd/sd-id128/id128-util.c" nm_copy_sd "src/libsystemd/sd-id128/id128-util.h" nm_copy_sd "src/libsystemd/sd-id128/sd-id128.c" nm_copy_sd "src/shared/dns-domain.c" nm_copy_sd "src/shared/dns-domain.h" nm_copy_sd "src/systemd/_sd-common.h" nm_copy_sd "src/systemd/sd-dhcp6-client.h" nm_copy_sd "src/systemd/sd-dhcp6-lease.h" nm_copy_sd "src/systemd/sd-dhcp-client.h" nm_copy_sd "src/systemd/sd-dhcp-lease.h" nm_copy_sd "src/systemd/sd-event.h" nm_copy_sd "src/systemd/sd-ndisc.h" nm_copy_sd "src/systemd/sd-id128.h" nm_copy_sd "src/systemd/sd-ipv4acd.h" nm_copy_sd "src/systemd/sd-ipv4ll.h" nm_copy_sd "src/systemd/sd-lldp.h"
2018-10-04keyfile: merge branch 'th/keyfile-various'Thomas Haller21-421/+387
https://github.com/NetworkManager/NetworkManager/pull/218
2018-10-04keyfile: split automatically setting ID/UUID for keyfileThomas Haller13-70/+111
keyfile already supports omitting the "connection.id" and "connection.uuid". In that case, the ID would be taken from the keyfile's name, and the UUID was generated by md5 hashing the full filename. No longer do this during nm_keyfile_read(), instead let all callers call nm_keyfile_read_ensure_*() to their liking. This is done for two reasons: - a minor reason is, that one day we want to expose keyfile API as public API. That means, we also want to read keyfiles from stdin, where there is no filename available. The implementation which parses stdio needs to define their own way of auto-generating ID and UUID. Note how nm_keyfile_read()'s API no longer takes a filename as argument, which would be awkward for the stdin case. - Currently, we only support one keyfile directory, which (configurably) is "/etc/NetworkManager/system-connections". In the future, we want to support multiple keyfile dirctories, like "/var/run/NetworkManager/profiles" or "/usr/lib/NetworkManager/profiles". Here we want that a file "foo" (which does not specify a UUID) gets the same UUID regardless of the directory it is in. That seems better, because then the UUID won't change as you move the file between directories. Yes, that means, that the same UUID will be provided by multiple files, but NetworkManager must already cope with that situation anyway. Unfortunately, the UUID generation scheme hashes the full path. That means, we must hash the path name of the file "foo" inside the original "system-connections" directory. Refactor the code so that it accounds for a difference between the filename of the keyfile, and the profile_dir used for generating the UUID.
2018-10-04keyfile: refactor setting default ID/UUID in nm_keyfile_read()Thomas Haller2-14/+51
Split out the functionality for auto-detecting the ID and UUID of a connection. First of all, nm_keyfile_read() is already overcomplicated. The next commit will require the caller to explicitly call these functions.
2018-10-04keyfile: refactor check whether filename starts with a dotThomas Haller1-12/+5
check_prefix() was only ever called with "." as prefix. Simplify the implementation to explicitly check for a leading dot.
2018-10-04keyfile: move file permission check of keyfile to helper functionThomas Haller3-21/+72
2018-10-04keyfile/tests: assert against auto generated UUID for keyfileThomas Haller1-3/+6
The algorithm for generating the UUID must be stable. Assert against that.
2018-10-04keyfile/tests: refactor loading of keyfiles in testsThomas Haller1-295/+50
2018-10-04core: add code comment to nm_utils_read_link_absolute() and minor cleanupThomas Haller1-5/+9
2018-10-04shared: avoid invoking g_free() with NULL from gs_free cleanup attributeThomas Haller2-6/+6
In general, it's fine to pass %NULL to g_free(). However, consider: char * foo (void) { gs_free char *value = NULL; value = g_strdup ("hi"); return g_steal_pointer (&value); } gs_free, gs_local_free(), and g_steal_pointer() are all inlinable. Here the compiler can easily recognize that we always pass %NULL to g_free(). But with the previous implementation, the compiler would not omit the call to g_free(). Similar patterns happen all over the place: gboolean baz (void) { gs_free char *value = NULL; if (!some_check ()) return FALSE; value = get_value (); if (!value) return FALSE; return TRUE; } in this example, g_free() is only required after setting @value to non-NULL. Note that this does increase the binary side a bit (4k for libnm, 8k for NetworkManager, with "-O2").
2018-10-04shared: add nm_strndup_a() helperThomas Haller1-0/+31
2018-10-04acd/tests: skip NAcd tests under valgrindThomas Haller2-2/+53
Under valgrind, we cannot create an NAcd instance. --10916-- WARNING: unhandled amd64-linux syscall: 321 --10916-- You may be able to write your own handler. --10916-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --10916-- Nevertheless we consider this a bug. Please report --10916-- it at http://valgrind.org/support/bug_reports.html. This limitation already poses a problem, because running NetworkManager under valgrind might fail. However, for tests it doesn't matter and we can just skip them.
2018-10-03device: always cancel WPS when secret-request failsThomas Haller1-13/+30
See the logfile at [1], for how NetworkManager first attempts to connect using WPS (which takes about 30 seconds). However, early on, the user logs into KDE and a secret agent would register, which possibly could provide secrets to connect. I think it is problematic to wait for WPS (which is unlikely to succeed) if a secret agent shows up in the meantime. A possible fix would be that when - WPS is pending - the secret request already failed - another secret-agent registers then the activation (and WPS) is aborted and autoconnect may be tried again, possibly with secrets provided by the new secret-agent. However, this patch goes a step further: it always cancels activation when the secret request fails. That means, WPS only works while the user is also prompted for a secret. That makes sense to me, because an action from the user is required. However, without secret prompt, the user wouldn't be aware of that and is unlikely to press the WPS push botton. [1] https://bugzilla.opensuse.org/show_bug.cgi?id=1079672#c33 https://github.com/NetworkManager/NetworkManager/pull/216
2018-10-01build: silence message in "tools/create-exports-NetworkManager.sh" about ↵Thomas Haller1-2/+2
missing directory When building with meson -Dppp=false, the following message is printed during build: [623/671] Generating NetworkManager.ver with a custom command. find: ‘./src/ppp/’: No such file or directory The message is harmless. Hide it. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/43
2018-10-01mailmap: update userThomas Haller1-0/+1
2018-10-01core: fix typo in commentFrédéric Danis1-1/+1
Not refering to the right function https://mail.gnome.org/archives/networkmanager-list/2018-October/msg00000.html
2018-10-01platform: bring back the interface name to log messagesLubomir Rintel1-3/+6
Fixes: ecf607cce69158bcf78dd4e568c38427c82381fc