Commit Graph

83 Commits

Author SHA1 Message Date
Alfonso Sanchez-Beato
6fb0de0a8b auth: check when setting statistics refresh rate 2016-08-17 16:08:20 +02:00
Thomas Haller
2cb18efaea permissions: properly add checkpoint-rollback permission
Fixes: a52d4654ec
2016-08-17 15:50:20 +02:00
Lubomir Rintel
8c4b749355 cli/networking: add subcommand completion 2016-08-01 13:52:36 +02:00
Lubomir Rintel
b37c109ee4 cli/radio: add subcommand completion 2016-08-01 13:52:36 +02:00
Lubomir Rintel
5305dfdf19 cli/radio: use nmc_do_cmd() 2016-08-01 13:52:36 +02:00
Lubomir Rintel
2b860e4e95 cli/general: add subcommand completion 2016-08-01 13:52:36 +02:00
Lubomir Rintel
7b6ded8cc4 cli/general: use nmc_do_cmd() 2016-08-01 13:52:36 +02:00
Lubomir Rintel
9827725210 cli: get rid of the global command completion whitelist
We're going to implement most of the missing pieces; the rest is going
to handle inability to complete itself.
2016-08-01 13:52:36 +02:00
Beniamino Galvani
e7bd55afdd cli: fix typo in overview output
Fixes: f14845cc20
2016-07-20 09:31:11 +02:00
Lubomir Rintel
f14845cc20 cli: output a short summary of devices when called without arguments
This aims to be somewhat similar to what "ifconfig" does.

https://bugzilla.gnome.org/show_bug.cgi?id=766426
2016-07-19 14:29:05 +02:00
Thomas Haller
466bf2f633 build: avoid compiler warnings about non-constant format strings (-Wformat-nonliteral) 2016-06-05 12:22:01 +02:00
Thomas Haller
8e54cfdb27 all: move NM_AUTH_PERMISSION_* defines to "nm-common-macros.h" header 2016-06-01 19:06:35 +02:00
Thomas Haller
1d0e0eeffd manager: add Reload() D-Bus command
Add new Reload D-Bus command to reload NetworkManager configuration.

For now, this is like sending SIGHUP to the process. There are several
advantages here:

  - it is guarded via PolicyKit authentication while signals
    can only be sent by root.

  - the user can wait for the reload to be complete instead of sending
    an asynchronous signal. For now, we operation completes after
    nm_config_reload() returns, but later we could delay the response
    further until specific parts are fully reloaded.

  - SIGHUP reloads everything including re-reading configuration from
    disk while SIGUSR1 reloads just certain parts such as writing out DNS
    configuration anew.
    Now, the Reload command has a flags argument which is more granular
    in selecting parts which are to be reloaded. For example, via
    signals the user can:

      1) send SIGUSR1: this writes out the DNS configuration to
         resolv.conf and possibly reloads other parts without
         re-reading configuration and without restarting the DNS plugin.
      2) send SIGHUP: this reloads configuration from disk,
         writes out resolv.conf and restarts the DNS plugin.

    There is no way, to only restart the DNS plugin without also reloading
    everything else.
2016-06-01 19:06:34 +02:00
Thomas Haller
8913585397 libnm: implement missing NM_AUTH_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS 2016-06-01 19:06:34 +02:00
Francesco Giudici
3c67a1ec5e cli: remove version check against NM
When performing NM package upgrade the new version of nmcli will be immediately
available while NM daemon will not, as it would not restart in order to avoid
to disrupt connectivity. This could create issues with tools leveraging
on nmcli output (till reboot). As apart from this case it is very unlikely
that a user can have this nmcli / NM daemon version mismatch situation,
the check could cause more harm than benefit in real user case
scenarios.

https://bugzilla.redhat.com/show_bug.cgi?id=1291785
2016-04-28 09:35:20 +02:00
Thomas Haller
8bace23beb all: cleanup includes and let "nm-default.h" include "config.h"
- All internal source files (except "examples", which are not internal)
  should include "config.h" first. As also all internal source
  files should include "nm-default.h", let "config.h" be included
  by "nm-default.h" and include "nm-default.h" as first in every
  source file.
  We already wanted to include "nm-default.h" before other headers
  because it might contains some fixes (like "nm-glib.h" compatibility)
  that is required first.

- After including "nm-default.h", we optinally allow for including the
  corresponding header file for the source file at hand. The idea
  is to ensure that each header file is self contained.

- Don't include "config.h" or "nm-default.h" in any header file
  (except "nm-sd-adapt.h"). Public headers anyway must not include
  these headers, and internal headers are never included after
  "nm-default.h", as of the first previous point.

- Include all internal headers with quotes instead of angle brackets.
  In practice it doesn't matter, because in our public headers we must
  include other headers with angle brackets. As we use our public
  headers also to compile our interal source files, effectively the
  result must be the same. Still do it for consistency.

- Except for <config.h> itself. Include it with angle brackets as suggested by
  https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
2016-02-19 17:53:25 +01:00
Jiří Klimeš
56518bb8a1 cli: monitor whether NetworkManager is running
Print a message when NetworkManager is not running upon 'nmcli monitor' start.
2015-12-14 16:37:57 +01:00
Jiří Klimeš
800bd1aa18 cli: primary connection is not NMConnection, but NMActiveConnection
And use nm_client_get_primary_connection() accessor function instead of reading
NM_CLIENT_PRIMARY_CONNECTION property directly.

(process:31760): libnm-CRITICAL **: nm_connection_get_id: assertion 'NM_IS_CONNECTION (connection)' failed
(process:31760): libnm-CRITICAL **: nm_connection_get_uuid: assertion 'NM_IS_CONNECTION (connection)' failed

Fixes: d03f347b9d
2015-12-14 16:04:49 +01:00
Lubomir Rintel
d03f347b9d cli: add nmcli monitor
https://bugzilla.redhat.com/show_bug.cgi?id=1034158
2015-12-05 12:16:23 +01:00
Lubomir Rintel
88ae8d2b13 cli: turn should_wait into a semaphore
Count the exit blockers. We'll want to terminate the device monitor in case all
monitored devices vanish.
2015-12-05 12:05:17 +01:00
Jiří Klimeš
9294962cc4 cli: remove static width parameter from fields definition
The width is no longer needed because the actual field's width is computed
dynamically just before printing.
(as of commit e6870789b5)
2015-09-25 12:09:51 +02:00
Dan Winship
22e1a97e12 all: drop includes to <glib/gi18n.h> for "nm-default.h"
The localization headers are now included via "nm-default.h".

Also fixes several places, where we wrongly included <glib/gi18n-lib.h>
instead of <glib/gi18n.h>. For example under "clients/" directory.
2015-08-05 15:35:51 +02:00
Thomas Haller
19c3ea948a all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
Dan Winship
3452ee2a0e all: rename nm-glib-compat.h to nm-glib.h, use everywhere
Rather than randomly including one or more of <glib.h>,
<glib-object.h>, and <gio/gio.h> everywhere (and forgetting to include
"nm-glib-compat.h" most of the time), rename nm-glib-compat.h to
nm-glib.h, include <gio/gio.h> from there, and then change all .c
files in NM to include "nm-glib.h" rather than including the glib
headers directly.

(Public headers files still have to include the real glib headers,
since nm-glib.h isn't installed...)

Also, remove glib includes from header files that are already
including a base object header file (which must itself already include
the glib headers).
2015-07-24 13:25:47 -04:00
Dan Winship
721e917cb6 wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.

So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.

For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.

nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-17 12:42:23 -04:00
Jiří Klimeš
126bc15f34 nmcli: colorize 'general', 'radio' and 'networking' outputs 2015-02-23 09:24:21 +01:00
Jiří Klimeš
3a551664df cli: add 'nmcli agent' command (bgo #739568)
Synopsis:
nmcli agent { secret | polkit | all }

The command runs separate NetworkManager secret agent or session polkit agent, or both.
It is useful when
- no other secret agent is available (such as GUI nm-applet, gnome-shell, KDE applet)
- no other polkit agent is available (such as polkit-gnome-authentication-agent-1,
  polkit-kde-authentication-agent-1 or lxpolkit)

https://bugzilla.gnome.org/show_bug.cgi?id=739568
2014-11-07 11:58:25 +01:00
Dan Winship
2ff4a7d4b0 libnm: strip GDBus gunk from GErrors
Call g_dbus_error_strip_remote_error() on all errors returned from
gdbus calls. (Blah!)
2014-10-22 08:29:10 -04:00
Lubomir Rintel
461da6fe1a cli: fix getting/setting hostname (bgo #738796)
Create a client instance before it's used.

$ nmcli g hostname
(process:13615): GLib-GObject-CRITICAL **: g_object_get: assertion 'G_IS_OBJECT (object)' failed

https://bugzilla.gnome.org/show_bug.cgi?id=738796
2014-10-20 10:05:59 +02:00
Dan Winship
6f3d1f9526 libnm: merge NMRemoteSettings into NMClient
Make NMRemoteSettings internal and have NMClient wrap all of its APIs,
just like it does with NMManager.
2014-10-10 12:40:19 -04:00
Jiří Klimeš
7e67fd2b24 libnm: return errors in nm_client_networking_set_enabled()
and do not print an error in the library. The caller can decide what to do
on an error.
2014-10-01 11:53:07 +02:00
Jiří Klimeš
8919a8572a cli: strip errors from D-Bus before presenting to a user 2014-10-01 11:53:07 +02:00
Jiří Klimeš
f585085907 cli: rename network-manager.[ch] to general.[ch] 2014-10-01 11:53:07 +02:00