summary refs log tree commit diff
path: root/src/core/nm-auth-utils.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2024-01-25 09:46:18 +0100
committerMichael Biebl <biebl@debian.org>2024-01-25 09:46:18 +0100
commit70e18d99b8e3e77bb37e218d7ac582130156f8ef (patch)
treed40c587e6d3f0e094ff558e415f1bb9803643214 /src/core/nm-auth-utils.c
parentd4d8b2b91f7ba000d97a8b2aab48c85000c11314 (diff)
New upstream version 1.45.90 upstream/1.45.90
Diffstat (limited to 'src/core/nm-auth-utils.c')
-rw-r--r--src/core/nm-auth-utils.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/core/nm-auth-utils.c b/src/core/nm-auth-utils.c
index 7739f443..aa2547b3 100644
--- a/src/core/nm-auth-utils.c
+++ b/src/core/nm-auth-utils.c
@@ -8,6 +8,7 @@
 #include "nm-auth-utils.h"
 
 #include "libnm-glib-aux/nm-c-list.h"
+#include "libnm-core-intern/nm-core-internal.h"
 #include "nm-setting-connection.h"
 #include "libnm-core-aux-intern/nm-auth-subject.h"
 #include "nm-auth-manager.h"
@@ -603,7 +604,6 @@ gboolean
 nm_auth_is_subject_in_acl(NMConnection *connection, NMAuthSubject *subject, char **out_error_desc)
 {
     NMSettingConnection *s_con;
-    gs_free char        *user = NULL;
     gulong               uid;
 
     g_return_val_if_fail(connection, FALSE);
@@ -621,13 +621,6 @@ nm_auth_is_subject_in_acl(NMConnection *connection, NMAuthSubject *subject, char
     if (0 == uid)
         return TRUE;
 
-    user = nm_utils_uid_to_name(uid);
-    if (!user) {
-        NM_SET_OUT(out_error_desc,
-                   g_strdup_printf("Could not determine username for uid %lu", uid));
-        return FALSE;
-    }
-
     s_con = nm_connection_get_setting_connection(connection);
     if (!s_con) {
         /* This can only happen when called from AddAndActivate, so we know
@@ -637,7 +630,7 @@ nm_auth_is_subject_in_acl(NMConnection *connection, NMAuthSubject *subject, char
     }
 
     /* Match the username returned by the session check to a user in the ACL */
-    if (!nm_setting_connection_permissions_user_allowed(s_con, user)) {
+    if (!nm_setting_connection_permissions_user_allowed_by_uid(s_con, uid)) {
         NM_SET_OUT(out_error_desc,
                    g_strdup_printf("uid %lu has no permission to perform this operation", uid));
         return FALSE;