summaryrefslogtreecommitdiff
path: root/clients
AgeCommit message (Collapse)AuthorFilesLines
2018-02-13cli: fix connections completionBeniamino Galvani1-10/+11
Let the matching continue when we are autocompleting arguments and we have already found 'id', 'uuid' or 'path'. Before: # nmcli connection modify path<TAB> path After: # nmcli connection modify path<TAB> path pathfinder-wifi
2018-02-13cli: fix completion of help sub-commandBeniamino Galvani1-3/+2
'help' is completed without considering other alternatives: # nmcli connection modify h<TAB> help After the patch: # nmcli connection modify h<TAB> help home-wifi Fixes: 29bb6ae4fec37db177418bae9d9462b577d3b2fd
2018-02-13cli/polkit-agent: drop an extra newlineLubomir Rintel1-1/+0
It looks bad and makes everyone super-sad: $ nmcli --ask c modify 'Oracle HQ' 802-11-wireless-security.psk solaris666 System policy prevents modification of network settings for all users (action_id: org.freedesktop.NetworkManager.settings.modify.system) Password (lkundrak): ********* $
2018-02-13cli/connections: avoid using synchronous get_secrets()Lubomir Rintel1-12/+40
With --ask it might call back to nmcli's agent, causing a deadlock while the client is waiting for the response. Let's give the client a chance to service the agent requests while waiting: $ nmcli --ask --show-secrets c show 'Oracle HQ' <hang> This is probably still rather suboptimal and inefficient, since we still serialize the calls and block on response. However, if we submit multiple calls to GetSecrets, the daemon would start authorizing the first one and fail the other ones immediately before the authorization succeeds. This could perhaps be addressed in the daemon, but let's settle for a fix that's compatible with the current daemon for now.
2018-02-12nmcli: team: do strict checking on runner-tx-hashesFrancesco Giudici1-14/+19
Substrings matching the heading of valid values were allowed if not ambiguous (e.g.: "et" for "eth"). Moreover, upper case variants were accepted too. Do a plain string comparison check against the valid values. Improve also the error message: give a list of valid tx-hashes.
2018-02-12client: fix nmc_string_is_valid ambiguous detectionFrancesco Giudici1-9/+11
when input matched the heading of two allowed values the match was reported as ambiguous without checking if there was a perfect match following: fixed. Example of a failing input: const char **allowed = [ "ipv4, ipv6, ip" ]; const char *input = "ip"; "ip" was detected as ambiguous.
2018-02-12nmcli: team: clear runner-tx-hash before adding new hashesFrancesco Giudici1-0/+3
https://bugzilla.redhat.com/show_bug.cgi?id=1541922
2018-02-08all: fix -Wcast-function-type warningsLubomir Rintel1-1/+1
GCC 8.0's -Wcast-function-type objects casting function pointers to ones with incompatible prototypes. Sometimes we do that on purpose though. Notably, the g_source_set_callback()'s func argument can point to functions of various prototypes. Also, libnm-glib/nm-remote-connection is perhaps just not worth reworking, that would just be a waste of time. A cast to void(*)(void) avoids the GCC warning, let's use it.
2018-02-07all: drop trailing spacesThomas Haller5-5/+5
2018-02-07all: replace non-leading tabs with spacesThomas Haller8-22/+22
We commonly only allow tabs at the beginning of a line, not afterwards. The reason for this style is so that the code looks formated right with tabstop=4 and tabstop=8.
2018-02-05libnm-core: team: add support to runner "random"Francesco Giudici1-0/+1
https://bugzilla.redhat.com/show_bug.cgi?id=1538699
2018-01-24nmcli: fix signal handlingLubomir Rintel1-8/+10
Hook the signal handlers right before the main loop. Prior to that the default handlers are good enough and our one crashes (due to loop being instantialized). Also, set the return value properly to indicate a termination by a signal.
2018-01-24nmcli/agent: fix handling of polkit agent failureLubomir Rintel1-1/+7
On "nmcli agent all", when the polkit agent fails (while the NM agent succeeds), the failure is not communicated until the client exits.
2018-01-22doc: fix describe message for team link watchersFrancesco Giudici1-2/+2
2018-01-22nmcli: clear link-watchers before adding the new ones we want to setFrancesco Giudici1-0/+2
2018-01-18all: require glib 2.40Lubomir Rintel4-16/+2
RHEL 7.1 and Ubuntu 14.04 LTS both have this. https://bugzilla.gnome.org/show_bug.cgi?id=792323
2018-01-16cli: add support for FILSMasashi Honma1-0/+8
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2018-01-16wifi: add support for FILSMasashi Honma1-0/+1
The FILS(Fast Initial Link Setup) is a specification defined by IEEE 802.11ai to speed up roaming. This patch adds support of it. I have tested with these cases. +-----+-------------------------+----------------+ | STA | AP | | |FILS | key-mgmt | result | +-----+-------------------------+----------------+ | 1 | WPA-EAP | O | +-----+-------------------------+----------------+ | 1 | WPA-EAP-SHA256 | O | +-----+-------------------------+----------------+ | 1 | FILS-SHA256 | X | +-----+-------------------------+----------------+ | 1 | FILS-SHA384 | X | +-----+-------------------------+----------------+ | 1 | WPA-EAP WPA-EAP-SHA256 | O | | | FILS-SHA256 FILS-SHA384 | WPA-EAP-SHA256 | +-----+-------------------------+----------------+ | 2 | WPA-EAP | O | +-----+-------------------------+----------------+ | 2 | WPA-EAP-SHA256 | O | +-----+-------------------------+----------------+ | 2 | FILS-SHA256 | O | +-----+-------------------------+----------------+ | 2 | FILS-SHA384 | O | +-----+-------------------------+----------------+ | 2 | WPA-EAP WPA-EAP-SHA256 | O | | | FILS-SHA256 FILS-SHA384 | FILS-SHA384 | +-----+-------------------------+----------------+ | 3 | WPA-EAP | X | +-----+-------------------------+----------------+ | 3 | WPA-EAP-SHA256 | X | +-----+-------------------------+----------------+ | 3 | FILS-SHA256 | O | +-----+-------------------------+----------------+ | 3 | FILS-SHA384 | O | +-----+-------------------------+----------------+ | 3 | WPA-EAP WPA-EAP-SHA256 | O | | | FILS-SHA256 FILS-SHA384 | FILS-SHA384 | +-----+-------------------------+----------------+ Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2018-01-15cli: get team defaults from setting header filesFrancesco Giudici1-4/+4
this allows centralizing default values definition and allows quicker and safer update of default values.
2018-01-12libnm-core: docs update requires also settings-docs.h.in updateFrancesco Giudici1-1/+1
Fixes: 112f8bd5aff2c5d543699d968f56c7f98be07eec
2018-01-12dns: introduce routing domainsBeniamino Galvani1-2/+2
Similarly to what systemd-resolved does, introduce the concept of "routing" domain, which is a domain in the search list that is used only to decide the interface over which a query must be forwarded, but is not used to complete unqualified host names. Routing domains are those starting with a tilde ('~') before the actual domain name. Domains without the initial tilde are used both for completing unqualified names and for the routing decision.
2018-01-12build: Rename settings-docs.c fileIñigo Martínez3-2/+2
The `settings-docs.c` file is generated by processing the `nm-property-docs.xml` file. Although this works in autotools, the `.c` extension makes meson not to handle it properly. Given the fact that it only contains a number of defines it makes sense to change its extension to `.h` an use it as a header. This also makes meson to handle it properly and build it before its used. https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00057.html
2018-01-11build/meson: use variables for ldflags and linker-scriptThomas Haller3-15/+3
2018-01-10build/meson: unconditionally use linker version scriptsThomas Haller3-12/+9
We also unconditionally use them with autotools. Also, the detection for have_version_script does not seem correct to me. At least, it didn't work with clang.
2018-01-10meson: Use string variables extensivelyIñigo Martínez2-4/+8
The strings holding the names used for libraries have also been moved to different variables. This way they would be less error as these variables can be reused easily and any typing error would be quickly detected.
2018-01-10meson: Improve dependency systemIñigo Martínez6-57/+28
Some targets are missing dependencies on some generated sources in the meson port. These makes the build to fail due to missing source files on a highly parallelized build. These dependencies have been resolved by taking advantage of meson's internal dependencies which can be used to pass source files, include directories, libraries and compiler flags. One of such internal dependencies called `core_dep` was already in use. However, in order to avoid any confusion with another new internal dependency called `nm_core_dep`, which is used to include directories and source files from the `libnm-core` directory, the `core_dep` dependency has been renamed to `nm_dep`. These changes have allowed minimizing the build details which are inherited by using those dependencies. The parallelized build has also been improved.
2018-01-09mdns: add new connection property.Ismo Puustinen2-0/+9
Add support for mDNS as a connection-level property. Update ifcfg-rh and keyfile plugins to support it.
2018-01-08clients: drop redundant #include "NetworkManager.h"Thomas Haller24-43/+0
This header is already included by "nm-default.h".
2018-01-08build: refine the NETWORKMANAGER_COMPILATION defineThomas Haller5-13/+20
Note that: - we compile some source files multiple times. Most notably those under "shared/". - we include a default header "shared/nm-default.h" in every source file. This header is supposed to setup a common environment by defining and including parts that are commonly used. As we always include the same header, the header must behave differently depending one whether the compilation is for libnm-core, NetworkManager or libnm-glib. E.g. it must include <glib/gi18n.h> or <glib/gi18n-lib.h> depending on whether we compile a library or an application. For that, the source files need the NETWORKMANAGER_COMPILATION #define to behave accordingly. Extend the define to be composed of flags. These flags are all named NM_NETWORKMANAGER_COMPILATION_WITH_*, they indicate which part of the build are available. E.g. when building libnm-core.la itself, then WITH_LIBNM_CORE, WITH_LIBNM_CORE_INTERNAL, and WITH_LIBNM_CORE_PRIVATE are available. When building NetworkManager, WITH_LIBNM_CORE_PRIVATE is not available but the internal parts are still accessible. When building nmcli, only WITH_LIBNM_CORE (the public part) is available. This granularily controls the build.
2018-01-05ip-tunnel: add support for tunnel flagsBeniamino Galvani2-0/+9
Implement support for IP tunnel flags. Currently only some IPv6 tunnel flags are supported. Example: # nmcli connection add type ip-tunnel mode ip6ip6 \ ip-tunnel.flags ip6-ign-encap-limit,ip6-use-orig-tclass \ ifname abc ip-tunnel.parent ens8 ipv4.method disabled \ ipv6.method manual ipv6.address ::8888 remote ::42 # ip -d l 61: abc@ens8: <NOARP,UP,LOWER_UP> mtu 1460 qdisc noqueue ... link/tunnel6 :: brd ::42 promiscuity 0 ip6tnl ip6ip6 remote ::42 local :: dev ens8 encaplimit none hoplimit 0 tclass inherit ... https://bugzilla.gnome.org/show_bug.cgi?id=791846
2018-01-02build: Remove default install directoriesIñigo Martínez3-6/+3
The install directories of those targets that match the default install directories have been removed because they are redundant. This also allows a simple meson build files and it is unnecessary to create some paths. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00078.html
2017-12-21all: add more meaningful error code for unsupported IP methodBeniamino Galvani1-1/+2
Add a new device state reason code for unsupported IP method. It is returned, for example, when users select manual IP configuration for WWAN connections: # nmcli connection mod Gsm ipv4.method manual ipv4.address 1.2.3.4/32 # nmcli connection up Gsm Error: Connection activation failed: The selected IP method is not supported compared to the old: Error: Connection activation failed: IP configuration could not be reserved (no available address, timeout, etc.) Note that we could instead fail the connection validation if the method is not supported by the connection type, but adding such limitation now could make existing connections invalid. https://bugzilla.redhat.com/show_bug.cgi?id=1459529
2017-12-18build: Remove documentation generation workaroundsIñigo Martínez1-3/+1
Documentation was not working in meson due to problems with files generated in `libnm`. To avoid these problems, workarounds were used. This problems have been recently fixed so these workarounds are not necessary anymore. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00061.html
2017-12-18clients/cli: use a nicer password promptLubomir Rintel3-12/+46
Makes sense in order for the user to know that they're actually typing the password (edited just to illustrate the point, the actual output was shamefully messy and perhaps needs fixing too): $ nmcli c up Wrathmosphere Passwords or encryption keys are required to access the wireless network 'Wrathmosphere'. Password (802-1x.password): *********
2017-12-18libnm-core: move detection of UTF-8 capable terminals to clients/Lubomir Rintel4-3/+62
Having it in libnm doesn't make any sense and prevents using it for more internal functionality. Too bad nm_utils_wifi_strength_bars() is already a public API. No problem -- replace it with a compatible yet dumber equivalent.
2017-12-18clients/cli: don't store a password in historyLubomir Rintel1-0/+5
History is probably even not useful at all outside the interactive edit mode, but that is another story. This just avoids awkward surprises, such as: https://bugzilla.gnome.org/show_bug.cgi?id=791200
2017-12-18all: get rid of a handful of unused-but-set variablesLubomir Rintel3-17/+0
2017-12-18build: use template files for enum types' sources generationIñigo Martínez5-6/+6
Source files for enum types are generated by passing segments of the source code of the files to the `glib-mkenums` command. This patch removes those parameters where source code is used from meson build files by moving those segmeents to template files. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00057.html
2017-12-15cli: fix editor crashBeniamino Galvani1-1/+1
Ensure @cmd_arg0 is not freed when returning it. Fixes: 886994359411e08d66a6b4bc8bacb68360d5176a
2017-12-14build: rename unit tests with the `test-` patternIñigo Martínez1-4/+2
There are some tests located in different directories which are using the same name. To avoid any confussion a prefix was used to name the test and the target. This patch uses the prefix just for the target, to avoid any collision that may happen, and uses the `test-` pattern as the name. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00051.html
2017-12-13build: add initial support for meson build systemIñigo Martínez6-0/+330
meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools. [thaller@redhat.com: rebased patch and adjusted for iwd support] https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00022.html
2017-12-12cli: drop nmc_strsplit_set()Thomas Haller7-249/+223
In most cases, it copies the entire strv needlessly. We can do better. Also, the max_tokens argument is handled wrongly (albeit not used anywhere anymore).
2017-12-12cli: refactor splitting of first command line argumentThomas Haller1-64/+90
nmc_strsplit_set() handles max_token wrong. It cannot call g_strsplit_set() with max_token first, and then split empty words. You cannot use g_strsplit_set() to achieve what nmc_strsplit_set() wants to do, unless you first split all tokens, then them construct them together again -- thereby loosing the delimiters. Anyway, there are just a few caller that do essentially the same. Refactor the code to not use nmc_strsplit_set().
2017-12-12cli: rework DEFINE_SETTER_PRIV_KEY()Thomas Haller1-17/+15
nmc_strsplit_set()'s max_token argument is broken, because it *first* calls g_strsplit_set() and then removes empty tokens. It wasn't an issue, because DEFINE_SETTER_PRIV_KEY() would first already remove leading spaces, and who uses multiple spaces anyway... Anyway, refactor DEFINE_SETTER_PRIV_KEY() to not use it.
2017-12-12cli: avoid out-of-bounds-read for show_device_info()Thomas Haller1-2/+2
Probably not critical, because it will still include the terminating NULL, and just continue to fill the temporary buffer with static addresses. Found by coverity. Fixes: bfb9fd0d2f3d602a69537fe7776426ee9202ce9e
2017-12-11clients: add tc tfilter supportLubomir Rintel1-0/+83
What works: nmcli c add con-name dum0 ifname dum0 type dummy \ tc.tfilters 'parent 1234: matchall action drop, parent ffff: matchall action drop' nmcli c modify dum0 -tc.tfilters 'parent ffff: matchall action drop' nmcli c modify dum0 +tc.tfilters 'parent ffff: matchall action simple sdata Hello'
2017-12-11libnm-core: add traffic filter support to NMSettingTCConfigLubomir Rintel1-0/+1
2017-12-11clients: add tc qdisc supportLubomir Rintel3-3/+96
What works: nmcli c add con-name dum0 ifname dum0 type dummy \ tc.qdiscs 'ingress, root pfifo_fast' nmcli c modify dum0 -tc.qdiscs 'root pfifo_fast' nmcli c modify dum0 +tc.qdiscs 'root handle 666: fq_codel'
2017-12-11libnm-core: add NMSettingTCConfig with qdisc supportLubomir Rintel1-0/+2
Currently is only able to hold the queueing disciplines.
2017-12-08cli: fix integer types in get-functions to match libnm originThomas Haller1-6/+6
The num/i variables are initialized from libnm API and used back at them. The integer types should match.