auth: remove session monitor argument
There's no need to call `nm_session_monitor_get()` individually for each call to `nm_auth_is_subject_in_acl()`. Acked-By: Thomas Haller <thaller@redhat.com>
This commit is contained in:
@@ -419,7 +419,6 @@ nm_auth_chain_unref (NMAuthChain *self)
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
nm_auth_is_subject_in_acl (NMConnection *connection,
|
nm_auth_is_subject_in_acl (NMConnection *connection,
|
||||||
NMSessionMonitor *smon,
|
|
||||||
NMAuthSubject *subject,
|
NMAuthSubject *subject,
|
||||||
char **out_error_desc)
|
char **out_error_desc)
|
||||||
{
|
{
|
||||||
@@ -428,7 +427,6 @@ nm_auth_is_subject_in_acl (NMConnection *connection,
|
|||||||
gulong uid;
|
gulong uid;
|
||||||
|
|
||||||
g_return_val_if_fail (connection != NULL, FALSE);
|
g_return_val_if_fail (connection != NULL, FALSE);
|
||||||
g_return_val_if_fail (smon != NULL, FALSE);
|
|
||||||
g_return_val_if_fail (NM_IS_AUTH_SUBJECT (subject), FALSE);
|
g_return_val_if_fail (NM_IS_AUTH_SUBJECT (subject), FALSE);
|
||||||
g_return_val_if_fail (nm_auth_subject_is_internal (subject) || nm_auth_subject_is_unix_process (subject), FALSE);
|
g_return_val_if_fail (nm_auth_subject_is_internal (subject) || nm_auth_subject_is_unix_process (subject), FALSE);
|
||||||
|
|
||||||
|
@@ -89,7 +89,6 @@ void nm_auth_chain_unref (NMAuthChain *chain);
|
|||||||
|
|
||||||
/* Caller must free returned error description */
|
/* Caller must free returned error description */
|
||||||
gboolean nm_auth_is_subject_in_acl (NMConnection *connection,
|
gboolean nm_auth_is_subject_in_acl (NMConnection *connection,
|
||||||
NMSessionMonitor *smon,
|
|
||||||
NMAuthSubject *subect,
|
NMAuthSubject *subect,
|
||||||
char **out_error_desc);
|
char **out_error_desc);
|
||||||
|
|
||||||
|
@@ -1462,7 +1462,6 @@ device_auth_request_cb (NMDevice *device,
|
|||||||
|
|
||||||
/* Ensure the subject has permissions for this connection */
|
/* Ensure the subject has permissions for this connection */
|
||||||
if (connection && !nm_auth_is_subject_in_acl (connection,
|
if (connection && !nm_auth_is_subject_in_acl (connection,
|
||||||
nm_session_monitor_get (),
|
|
||||||
subject,
|
subject,
|
||||||
&error_desc)) {
|
&error_desc)) {
|
||||||
error = g_error_new_literal (NM_MANAGER_ERROR,
|
error = g_error_new_literal (NM_MANAGER_ERROR,
|
||||||
@@ -2666,7 +2665,6 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError *
|
|||||||
subject = nm_active_connection_get_subject (active);
|
subject = nm_active_connection_get_subject (active);
|
||||||
if (existing_connection &&
|
if (existing_connection &&
|
||||||
!nm_auth_is_subject_in_acl (existing_connection,
|
!nm_auth_is_subject_in_acl (existing_connection,
|
||||||
nm_session_monitor_get (),
|
|
||||||
subject,
|
subject,
|
||||||
&error_desc)) {
|
&error_desc)) {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
@@ -2958,7 +2956,6 @@ nm_manager_activate_connection (NMManager *self,
|
|||||||
|
|
||||||
/* Ensure the subject has permissions for this connection */
|
/* Ensure the subject has permissions for this connection */
|
||||||
if (!nm_auth_is_subject_in_acl (connection,
|
if (!nm_auth_is_subject_in_acl (connection,
|
||||||
nm_session_monitor_get (),
|
|
||||||
subject,
|
subject,
|
||||||
&error_desc)) {
|
&error_desc)) {
|
||||||
g_set_error_literal (error,
|
g_set_error_literal (error,
|
||||||
@@ -3012,7 +3009,6 @@ validate_activation_request (NMManager *self,
|
|||||||
|
|
||||||
/* Ensure the subject has permissions for this connection */
|
/* Ensure the subject has permissions for this connection */
|
||||||
if (!nm_auth_is_subject_in_acl (connection,
|
if (!nm_auth_is_subject_in_acl (connection,
|
||||||
nm_session_monitor_get (),
|
|
||||||
subject,
|
subject,
|
||||||
&error_desc)) {
|
&error_desc)) {
|
||||||
g_set_error_literal (error,
|
g_set_error_literal (error,
|
||||||
@@ -3542,7 +3538,6 @@ impl_manager_deactivate_connection (NMManager *self,
|
|||||||
|
|
||||||
/* Ensure the subject has permissions for this connection */
|
/* Ensure the subject has permissions for this connection */
|
||||||
if (!nm_auth_is_subject_in_acl (connection,
|
if (!nm_auth_is_subject_in_acl (connection,
|
||||||
nm_session_monitor_get (),
|
|
||||||
subject,
|
subject,
|
||||||
&error_desc)) {
|
&error_desc)) {
|
||||||
error = g_error_new_literal (NM_MANAGER_ERROR,
|
error = g_error_new_literal (NM_MANAGER_ERROR,
|
||||||
|
@@ -697,7 +697,7 @@ connection_request_add_agent (Request *parent, NMSecretAgent *agent)
|
|||||||
/* Ensure the caller's username exists in the connection's permissions,
|
/* Ensure the caller's username exists in the connection's permissions,
|
||||||
* or that the permissions is empty (ie, visible by everyone).
|
* or that the permissions is empty (ie, visible by everyone).
|
||||||
*/
|
*/
|
||||||
if (!nm_auth_is_subject_in_acl (req->connection, nm_session_monitor_get (), subject, NULL)) {
|
if (!nm_auth_is_subject_in_acl (req->connection, subject, NULL)) {
|
||||||
nm_log_dbg (LOGD_AGENTS, "(%s) agent ignored for secrets request %p/%s (not in ACL)",
|
nm_log_dbg (LOGD_AGENTS, "(%s) agent ignored for secrets request %p/%s (not in ACL)",
|
||||||
nm_secret_agent_get_description (agent),
|
nm_secret_agent_get_description (agent),
|
||||||
parent, parent->detail);
|
parent, parent->detail);
|
||||||
|
@@ -1071,7 +1071,6 @@ auth_start (NMSettingsConnection *self,
|
|||||||
|
|
||||||
/* Ensure the caller can view this connection */
|
/* Ensure the caller can view this connection */
|
||||||
if (!nm_auth_is_subject_in_acl (NM_CONNECTION (self),
|
if (!nm_auth_is_subject_in_acl (NM_CONNECTION (self),
|
||||||
priv->session_monitor,
|
|
||||||
subject,
|
subject,
|
||||||
&error_desc)) {
|
&error_desc)) {
|
||||||
error = g_error_new_literal (NM_SETTINGS_ERROR,
|
error = g_error_new_literal (NM_SETTINGS_ERROR,
|
||||||
@@ -1434,7 +1433,6 @@ impl_settings_connection_update_helper (NMSettingsConnection *self,
|
|||||||
* invisible to yourself.
|
* invisible to yourself.
|
||||||
*/
|
*/
|
||||||
if (!nm_auth_is_subject_in_acl (tmp ? tmp : NM_CONNECTION (self),
|
if (!nm_auth_is_subject_in_acl (tmp ? tmp : NM_CONNECTION (self),
|
||||||
priv->session_monitor,
|
|
||||||
subject,
|
subject,
|
||||||
&error_desc)) {
|
&error_desc)) {
|
||||||
error = g_error_new_literal (NM_SETTINGS_ERROR,
|
error = g_error_new_literal (NM_SETTINGS_ERROR,
|
||||||
|
@@ -306,7 +306,6 @@ impl_settings_get_connection_by_uuid (NMSettings *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!nm_auth_is_subject_in_acl (NM_CONNECTION (connection),
|
if (!nm_auth_is_subject_in_acl (NM_CONNECTION (connection),
|
||||||
nm_session_monitor_get (),
|
|
||||||
subject,
|
subject,
|
||||||
&error_desc)) {
|
&error_desc)) {
|
||||||
error = g_error_new_literal (NM_SETTINGS_ERROR,
|
error = g_error_new_literal (NM_SETTINGS_ERROR,
|
||||||
@@ -1183,7 +1182,6 @@ nm_settings_add_connection_dbus (NMSettings *self,
|
|||||||
* or that the permissions is empty (ie, visible by everyone).
|
* or that the permissions is empty (ie, visible by everyone).
|
||||||
*/
|
*/
|
||||||
if (!nm_auth_is_subject_in_acl (connection,
|
if (!nm_auth_is_subject_in_acl (connection,
|
||||||
nm_session_monitor_get (),
|
|
||||||
subject,
|
subject,
|
||||||
&error_desc)) {
|
&error_desc)) {
|
||||||
error = g_error_new_literal (NM_SETTINGS_ERROR,
|
error = g_error_new_literal (NM_SETTINGS_ERROR,
|
||||||
|
Reference in New Issue
Block a user