about summary refs log tree commit diff
path: root/src/settings/nm-settings-connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/nm-settings-connection.c')
-rw-r--r--src/settings/nm-settings-connection.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c
index d3415862..e2aa9845 100644
--- a/src/settings/nm-settings-connection.c
+++ b/src/settings/nm-settings-connection.c
@@ -959,15 +959,13 @@ check_user_in_acl (NMConnection *connection,
 	}
 
 	/* Make sure the UID can view this connection */
-	if (0 != sender_uid) {
-		if (!nm_auth_uid_in_acl (connection, session_monitor, sender_uid, &error_desc)) {
-			g_set_error_literal (error,
-			                     NM_SETTINGS_ERROR,
-			                     NM_SETTINGS_ERROR_PERMISSION_DENIED,
-			                     error_desc);
-			g_free (error_desc);
-			return FALSE;
-		}
+	if (!nm_auth_uid_in_acl (connection, session_monitor, sender_uid, &error_desc)) {
+		g_set_error_literal (error,
+		                     NM_SETTINGS_ERROR,
+		                     NM_SETTINGS_ERROR_PERMISSION_DENIED,
+		                     error_desc);
+		g_free (error_desc);
+		return FALSE;
 	}
 
 	if (out_sender_uid)
@@ -1426,8 +1424,7 @@ gboolean
 nm_settings_connection_get_timestamp (NMSettingsConnection *connection,
                                       guint64 *out_timestamp)
 {
-	g_return_val_if_fail (connection != NULL, 0);
-	g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (connection), 0);
+	g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (connection), FALSE);
 
 	if (out_timestamp)
 		*out_timestamp = NM_SETTINGS_CONNECTION_GET_PRIVATE (connection)->timestamp;
@@ -1455,6 +1452,8 @@ nm_settings_connection_update_timestamp (NMSettingsConnection *connection,
 	gsize len;
 	GError *error = NULL;
 
+	g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection));
+
 	/* Update timestamp in private storage */
 	priv->timestamp = timestamp;
 	priv->timestamp_set = TRUE;
@@ -1504,6 +1503,8 @@ nm_settings_connection_read_and_fill_timestamp (NMSettingsConnection *connection
 	GError *err = NULL;
 	char *tmp_str;
 
+	g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection));
+
 	/* Get timestamp from database file */
 	timestamps_file = g_key_file_new ();
 	g_key_file_load_from_file (timestamps_file, SETTINGS_TIMESTAMPS_FILE, G_KEY_FILE_KEEP_COMMENTS, NULL);