NetworkManager/clients/cli
Thomas Haller 50a12ce2d5 core: also return unknown permission check result
For example with

  mount -o remount,rw,hidepid=1 /proc/

all permission checks will fail with an error. Internally, we map the
failure to NM_AUTH_CALL_RESULT_UNKNOWN.

    <trace> [1575645672.5958] auth: call[1069]: CheckAuthorization(org.freedesktop.NetworkManager.enable-disable-connectivity-check), subject=unix-process[pid=468316, uid=1000, start=1912881]
    <trace> [1575645672.6295] auth: call[1069]: completed: failed: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dfile_2derror_2dquark.Code4: Failed to open file “/proc/468316/status”: No such file or directory
    <debug> [1575645672.6296] manager: unknown auth chain result 0

First of all, we should not log a debug message about that (we already log the
result of permission checks separately).

Also, we should include the unknown result in the response. The permission was
checked, and omitting it from GetPermissions() result seems wrong (even if we
failed to get the result).

Note that "unknown" is now a new possible return value on D-Bus. But
see how nm_permission_result_to_client() would map such a value to
"unknown" as well. So, it's probably a fine extension of the D-Bus API.

Note that NMClient API is currently quite limited. The user won't know
whether permissions were received (and if they were received, they
could not distinguish between UNKNOWN and absent). Hence, returning
all permissions as unknown (or not at all) causes `nmcli general permissions`
to hang. The solution here is to improve NMClient API to allow the user
to know when the permissions are received. But this patch doesn't
fix the hanging of nmcli nor the limitation of NMClient's API.
2019-12-10 07:53:25 +01:00
..
agent.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
agent.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
common.c libnm,client: use nm_g_task_new() to set source-tag and check it 2019-10-16 08:56:00 +02:00
common.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
connections.c nmcli: show IP interface name when doing 'nmcli connection show <PROFILE>' 2019-11-06 21:08:23 +01:00
connections.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
devices.c client/cli: add support for OWE key management flag 2019-12-05 14:00:10 +01:00
devices.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
general.c core: also return unknown permission check result 2019-12-10 07:53:25 +01:00
general.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
meson.build meson: Improve nmcli build 2019-10-01 09:49:33 +02:00
nmcli-completion cli: make nmcli do its own command completion 2017-02-13 16:32:15 +01:00
nmcli.c cli: honor NO_COLOR environment variable to prevent automatic ASCII colors 2019-10-08 12:18:20 +02:00
nmcli.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
polkit-agent.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
polkit-agent.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
settings.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
settings.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
utils.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
utils.h all: add device carrier flag 2019-11-22 10:18:27 +01:00