Commit graph

28 commits

Author SHA1 Message Date
Beniamino Galvani 6074ab1e00 nm-sudo: rename to nm-priv-helper
The name "nm-sudo" reminds of the "sudo" tool, and this is a bit
confusing because it's not related. Rename the service to
"nm-priv-helper", which stands for "NM privileged helper".

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/938
(cherry picked from commit d68ab6b8f0)
2022-01-11 22:41:04 +01:00
Thomas Haller d25a33f604
dispatcher: support enabling debug logging via environment variable
The advantage of environment variables is that the user can use
`systemctl edit NetworkManager-dispatcher.service` for setting them,
without need to change the ExecStart= line.

Also, enabling debugging from the start is useful, despite that debug
logging can be enabled per-request.

Also, there is a difference whether we want verbose logging or whether
we want to log to stdout. There should be a flag, that only increases the
logging verbosity, but does not change the logging backend.
2021-08-04 09:41:11 +02:00
Thomas Haller f137b32d31
sudo: introduce nm-sudo D-Bus service
NetworkManager runs as root and has lots of capabilities.
We want to reduce the attach surface by dropping capabilities,
but there is a genuine need to do certain things.

For example, we currently require dac_override capability, to open
the unix socket of ovsdb. Most users wouldn't use OVS, so we should
find a way to not require that dac_override capability. The solution
is to have a separate, D-Bus activate service (nm-sudo), which
has the capability to open and provide the file descriptor.

For authentication, we only rely on D-Bus. We watch the name owner
of NetworkManager, and only accept requests from that service. We trust
D-Bus to get it right a request from that name owner is really coming
from NetworkManager. If we couldn't trust that, how could PolicyKit
or any authentication via D-Bus work? For testing, the user can set
NM_SUDO_NO_AUTH_FOR_TESTING=1.

https://bugzilla.redhat.com/show_bug.cgi?id=1921826
2021-07-26 15:31:46 +02:00
Thomas Haller 71f0511b1f
cloud-setup: move from "clients/cloud-setup/" to "src/nm-cloud-setup/" 2021-03-15 17:10:53 +01:00
Thomas Haller ad91579bb8
shared: move "nm-vpn-editor-plugin-call.h" to "src/contrib/" 2021-02-24 12:48:51 +01:00
Thomas Haller fa288f65f6
shared: move "nm-vpn-plugin-utils.c" to "src/contrib/"
This file is not actually to be used by NetworkManager itself.
Instead, every (glib based) VPN plugin will want something like this,
hence we have a copy here.

Move it to a new directory "src/contrib/".
2021-02-24 12:48:46 +01:00
Thomas Haller 02513e4b5d
nm-online: allow configuring timeout via NM_ONLINE_TIMEOUT environment
https://bugzilla.redhat.com/show_bug.cgi?id=1828458

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/484
(cherry picked from commit e468b48ab7)
2020-04-30 21:47:30 +02:00
Thomas Haller 69f048bf0c cloud-setup: add tool for automatic IP configuration in cloud
This is a tool for automatically configuring networking in a cloud
environment.

Currently it only supports IPv4 on EC2, but it's intended for extending
to other cloud providers (Azure). See [1] and [2] for how to configure
secondary IP addresses on EC2. This is what the tool currently aims to
do (but in the future it might do more).

[1] https://aws.amazon.com/premiumsupport/knowledge-center/ec2-ubuntu-secondary-network-interface/

It is inspired by SuSE's cloud-netconfig ([1], [2]) and ec2-net-utils
package on Amazon Linux ([3], [4]).

[1] https://www.suse.com/c/multi-nic-cloud-netconfig-ec2-azure/
[2] https://github.com/SUSE-Enceladus/cloud-netconfig
[3] https://github.com/aws/ec2-net-utils
[4] https://github.com/lorengordon/ec2-net-utils.git

It is also intended to work without configuration. The main point is
that you boot an image with NetworkManager and nm-cloud-setup enabled,
and it just works.
2019-11-28 19:52:18 +01:00
Thomas Haller be13c75a3c po: skip translation for file in meson build directory
Otherwise, having a meson build directory along autotools,
lets `make check` fail with

    The following files contain translations and are currently not in use. Please
    consider adding these to the POTFILES.in file, located in the po/ directory.

    build/data/org.freedesktop.NetworkManager.policy.in

    If some of these files are left out on purpose then please add them to
    POTFILES.skip instead of POTFILES.in. A file 'missing' containing this list
    of left out files has been written in the current directory.
    Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager
    if [ -r missing -o -r notexist ]; then \
      exit 1; \
    fi

Yes, meson does not require that the build directory is named "build"
and this fix only works for the default case.
2018-01-12 09:51:12 +01:00
Thomas Haller 4be9b4a2cb build: move policy file from "policy/" to "data/" 2016-11-03 14:18:23 +01:00
Thomas Haller 5d55492bac shared: add "nm-utils/nm-vpn-plugin-utils.h"
This file is only used by plugins and copied between them.

It's purpose is to contain general utility functions that are
only relevant for implementing NetworkManager's VPN plugins.

In principle the utility functions could be part of libnm, however,
there are a few problems with that:
  - if they are part of libnm, adding and using a new utility function
    requires the plugin to bump the required libnm version. Since you
    usally can work around/reimplement utility functions, this results
    in not using the API from libnm, not adding the API to libnm,
    and reimplementing it over and over in the plugin.
  - plugins compile both against libnm and libnm-glib. Thus, either
    the utility function would also be needed in libnm-glib, or again,
    it is not usable by the plugin.

We must avoid that the utility functions diverge and no local
modifications to these files should be made in the plugin.
Instead, one special location of the utility functions shall be
extended and re-imported (copied) to the plugin as needed.

Add the files to NetworkManager's repository. Although they are not
needed for NetworkManager itself, they are a different API provided
by NetworkManager. An API that is reused and shared by copying the files
around.
2016-06-16 10:45:54 +02:00
Thomas Haller 4b288136e1 shared: move shared files to subdirectory "shared/nm-utils/"
The "shared" directory contains files that are possibly used by all components
of NetworkManager repository.

Some of these files are even copied as-is to other projects (VPN plugins, nm-applet)
and used there without modification. Move those files to a separate directory.
By moving them to a common directory, it is clearer that they belong
together. Also, you can easier compare the copied versions to their
original via

  $ diff -r ./shared/nm-utils/ /path/to/nm-vpn-plugin/shared/nm-utils/
2016-06-16 10:45:53 +02:00
Thomas Haller cf34211c90 libnm/vpn: add nm_vpn_editor_plugin_load_vt()
Let VPN plugins return a virtual function table to extend
the API while bypassing libnm. This allows to add and use
new functionality to VPN plugins without updating libnm.

The actual definitions are in a header-only file
"nm-vpn-editor-plugin-call.h", which can be copied to the
caller/plugin.
2016-06-15 15:01:12 +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
Jiří Klimeš b8d6bd1a98 clients: move clients/tui/vpn-helpers.c to clients/common/nm-vpn-helpers.c
The file has not been used up to now. But it is going to be used by both
nmtui and nmcli later.
2015-11-26 11:08:44 +01:00
Lubomir Rintel 66c3b673e3 build: work around automake-1.15 & intltool complaining about translations in build dir
make distcheck runs a build in dist directory subtirs and then runs intltool -m
which in turn complains about translations in a built file:

  The following files contain translations and are currently not in use. Please
  consider adding these to the POTFILES.in file, located in the po/ directory.

  sub/policy/org.freedesktop.NetworkManager.policy.in

The issue is reported to intltool upstream already:
https://bugs.launchpad.net/intltool/+bug/1117944
2015-05-05 13:34:19 +02:00
Thomas Haller 1f61cb82de po/test: add contrib/rpm directory to POTFILES.skip
Add contrib/fedora/rpm/ directory to POTFILES.skip.
Otherwise, after building an RPM, make check would fail
due to the source files from the rpmbuild.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-11-07 21:50:43 +01:00
Dan Winship 3d25d70461 clients: reorganize source tree, put all the installed clients together
Create a new clients/ subdirectory at the top level, and move cli/ and
tui/ into it, as well as nm-online.c (which was previously in test/,
which made no sense).

cli/ was split into two subdirectories, src/ and completion/. While
this does simplify things (given that the completion file and the
binary both need to be named "nmcli"), it bloats the source tree, and
we can work around it by just renaming the completion file at install
time. Then we can combine the two directories into one and just have
it all under clients/cli/.
2014-07-30 15:56:19 -04:00
Dan Williams 14227fda8b po: fix handling of not-yet-used tui/vpn-helpers.c
tui/vpn-helpers.c is not yet used, so it shouldn't be translated yet.
Having it in po/POTFILES fails distcheck because, since it is not
yet used, it's not distributed, and thus can't be found in the
distcheck build.
2013-12-17 11:50:58 -06:00
Dan Winship 7005762f50 build: "make check" fixes 2012-10-04 09:07:49 -04:00
Dan Williams a8c14b1d38 simplify POTFILES.skip (bgo #544428)
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3866 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-27 21:32:45 +00:00
Gil Forcada 6ea351fd10 Fixed po/POTFILES.skip
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3849 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-25 16:56:54 +00:00
Kjartan Maraas 9228a199fd 2008-07-10 Kjartan Maraas <kmaraas@gnome.org>
* POTFILES.in: Move file from here to
	* POTFILES.skip: here.

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3818 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-10 15:41:37 +00:00
Dan Williams d02e8b4886 2007-08-13 Dan Williams <dcbw@redhat.com>
Patch from Michael Biebl <biebl@debian.org>

	* po/POTFILES.in
	  po/POTFILES.skip
		- Update for vpn-properties move



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2676 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-14 03:46:40 +00:00
Dan Williams 23527a52f7 2006-12-03 Dan Williams <dcbw@redhat.com>
Patch from Gabor Kelemen <kelemeng@gnome.hu>  (Gnome.org #381890)

	* po/POTFILES.in
	  po/POTFILES.skip
		- Move VPN-related translatables to .skip

	* vpn-daemons/pptp/po/POTFILES.in
		- Update with new translatables


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2153 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-12-03 19:13:45 +00:00
Adam Weinberger 9a680fdef1 2006-01-11 Adam Weinberger <adamw@gnome.org>
* en_CA.po: Updated Canadian English translation.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1315 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-01-11 17:55:04 +00:00
Robert Love f3311defbc Move sv translations pertaining to the vpn-daemons to their po/, where they
belong.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@838 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-08-12 18:28:45 +00:00
Adam Weinberger 8e3651f935 2005-08-06 Adam Weinberger <adamw@gnome.org>
* POTFILES.skip: Add with obsoleted files.
	* en_CA.po: Updated Canadian English translation.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@826 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-08-07 02:28:08 +00:00