core: assume root always has a session for connection visibility
Normally, users which are not part of a login session can't access connections. Root won't always be part of a login session, so allow root to bypass visibility checks. The code already bypassed the ACL checks for root, but in multiple places. Consolidate those checks into one function.
This commit is contained in:
@@ -512,6 +512,10 @@ nm_auth_uid_in_acl (NMConnection *connection,
|
||||
g_return_val_if_fail (connection != NULL, FALSE);
|
||||
g_return_val_if_fail (smon != NULL, FALSE);
|
||||
|
||||
/* Root gets a free pass */
|
||||
if (0 == uid)
|
||||
return TRUE;
|
||||
|
||||
s_con = nm_connection_get_setting_connection (connection);
|
||||
g_assert (s_con);
|
||||
|
||||
|
Reference in New Issue
Block a user