diff options
| author | Michael Biebl <biebl@debian.org> | 2020-04-11 21:28:04 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2020-04-11 21:28:04 +0200 |
| commit | 1e5977b62f896e844b548c3007ace9e1dfa7f9ed (patch) | |
| tree | 7a7416ed410e72b6200f3d860fd315ec11cc106b /src/nm-auth-utils.c | |
| parent | b012fa6e1d808e0736c009799c62d835cbfcc1dd (diff) | |
New upstream version 1.23.90 upstream/1.23.90
Diffstat (limited to 'src/nm-auth-utils.c')
| -rw-r--r-- | src/nm-auth-utils.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/nm-auth-utils.c b/src/nm-auth-utils.c index a5b951ab..ca2870db 100644 --- a/src/nm-auth-utils.c +++ b/src/nm-auth-utils.c @@ -9,13 +9,14 @@ #include "nm-glib-aux/nm-c-list.h" #include "nm-setting-connection.h" -#include "nm-auth-subject.h" +#include "nm-libnm-core-intern/nm-auth-subject.h" #include "nm-auth-manager.h" #include "nm-session-monitor.h" +#include "nm-dbus-manager.h" /*****************************************************************************/ -struct NMAuthChain { +struct _NMAuthChain { CList parent_lst; @@ -265,6 +266,14 @@ nm_auth_chain_get_subject (NMAuthChain *self) return self->subject; } +GDBusMethodInvocation * +nm_auth_chain_get_context (NMAuthChain *self) +{ + g_return_val_if_fail (self, NULL); + + return self->context; +} + /*****************************************************************************/ static void @@ -341,8 +350,10 @@ nm_auth_chain_add_call_unsafe (NMAuthChain *self, g_return_if_fail (!self->is_finishing); g_return_if_fail (!self->is_destroyed); g_return_if_fail (permission && *permission); - nm_assert ( nm_auth_subject_is_unix_process (self->subject) - || nm_auth_subject_is_internal (self->subject)); + nm_assert ( nm_auth_subject_get_subject_type (self->subject) + == NM_AUTH_SUBJECT_TYPE_UNIX_PROCESS + || nm_auth_subject_get_subject_type (self->subject) + == NM_AUTH_SUBJECT_TYPE_INTERNAL); /* duplicate permissions are not supported, also because nm_auth_chain_get_result() * can only return one-permission. */ @@ -395,7 +406,7 @@ nm_auth_chain_new_context (GDBusMethodInvocation *context, g_return_val_if_fail (context, NULL); nm_assert (done_func); - subject = nm_auth_subject_new_unix_process_from_context (context); + subject = nm_dbus_manager_new_auth_subject_from_context (context); if (!subject) return NULL; @@ -416,8 +427,10 @@ nm_auth_chain_new_subject (NMAuthSubject *subject, NMAuthChain *self; g_return_val_if_fail (NM_IS_AUTH_SUBJECT (subject), NULL); - nm_assert ( nm_auth_subject_is_unix_process (subject) - || nm_auth_subject_is_internal (subject)); + nm_assert ( nm_auth_subject_get_subject_type (subject) + == NM_AUTH_SUBJECT_TYPE_UNIX_PROCESS + || nm_auth_subject_get_subject_type (subject) + == NM_AUTH_SUBJECT_TYPE_INTERNAL); nm_assert (done_func); self = g_slice_new (NMAuthChain); @@ -504,10 +517,12 @@ nm_auth_is_subject_in_acl (NMConnection *connection, g_return_val_if_fail (connection, FALSE); g_return_val_if_fail (NM_IS_AUTH_SUBJECT (subject), FALSE); - nm_assert ( nm_auth_subject_is_internal (subject) - || nm_auth_subject_is_unix_process (subject)); + nm_assert ( nm_auth_subject_get_subject_type (subject) + == NM_AUTH_SUBJECT_TYPE_INTERNAL + || nm_auth_subject_get_subject_type (subject) + == NM_AUTH_SUBJECT_TYPE_UNIX_PROCESS); - if (nm_auth_subject_is_internal (subject)) + if (nm_auth_subject_get_subject_type (subject) == NM_AUTH_SUBJECT_TYPE_INTERNAL) return TRUE; uid = nm_auth_subject_get_unix_process_uid (subject); |