[Bluez PATCH v1] plugins/admin: add uuid duplicate check

Subsystems: the rest

STALE1854d REVIEWED: 1 (0M)

1 review trailer.

2 messages, 2 authors, 2021-08-11 · open the first message on its own page

[Bluez PATCH v1] plugins/admin: add uuid duplicate check

From: Howard Chung <hidden>
Date: 2021-08-11 07:18:43

From: Yun-Hao Chung <redacted>

SetServiceAllowlist should ignore those duplicated UUIDs.

Reviewed-by: Miao-chen Chou <redacted>
---
Test steps:
1. set service allow list to ["1800", "1800", "180A"] via D-Bus
2. check service allow list is ["1800", "180A"]

 plugins/admin.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/plugins/admin.c b/plugins/admin.c
index 428a5528cc88..aea33cb71ac2 100644
--- a/plugins/admin.c
+++ b/plugins/admin.c
@@ -85,6 +85,14 @@ static void admin_policy_free(void *data)
 	g_free(admin_policy);
 }
 
+static bool uuid_match(const void *data, const void *match_data)
+{
+	const bt_uuid_t *uuid = data;
+	const bt_uuid_t *match_uuid = match_data;
+
+	return bt_uuid_cmp(uuid, match_uuid) == 0;
+}
+
 static struct queue *parse_allow_service_list(struct btd_adapter *adapter,
 							DBusMessage *msg)
 {
@@ -119,9 +127,15 @@ static struct queue *parse_allow_service_list(struct btd_adapter *adapter,
 			goto failed;
 		}
 
+		dbus_message_iter_next(&arr_iter);
+
+		if (queue_find(uuid_list, uuid_match, uuid)) {
+			g_free(uuid);
+			continue;
+		}
+
 		queue_push_head(uuid_list, uuid);
 
-		dbus_message_iter_next(&arr_iter);
 	} while (true);
 
 	return uuid_list;
-- 
2.32.0.605.g8dce9f2422-goog

RE: [Bluez,v1] plugins/admin: add uuid duplicate check

From: <hidden>
Date: 2021-08-11 07:35:55

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=529641

---Test result---

Test Summary:
CheckPatch                    PASS      0.49 seconds
GitLint                       PASS      0.12 seconds
Prep - Setup ELL              PASS      47.72 seconds
Build - Prep                  PASS      0.15 seconds
Build - Configure             PASS      8.39 seconds
Build - Make                  PASS      212.01 seconds
Make Check                    PASS      9.57 seconds
Make Distcheck                PASS      249.30 seconds
Build w/ext ELL - Configure   PASS      8.40 seconds
Build w/ext ELL - Make        PASS      199.45 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help