[Bluez PATCH v1] plugin/admin: fix set empty allowlist no persistence issue

Subsystems: the rest

STALE1796d REVIEWED: 1 (0M)

1 review trailer.

3 messages, 3 authors, 2021-09-01 · open the first message on its own page

[Bluez PATCH v1] plugin/admin: fix set empty allowlist no persistence issue

From: Howard Chung <hidden>
Date: 2021-08-31 05:39:10

From: Yun-Hao Chung <redacted>

This patch fixes a bug when setting empty service allowlist, the
allowlist sets successfully but it fails to be stored in the file.

Reviewed-by: Miao-chen Chou <redacted>
---
Test procedure:
1. set empty service allowlist via bluetoothctl
2. cat /var/lib/bluetooth/admin_policy_settings
3. restart bluetoothd
4. get service allowlist via bluetoothctl

 plugins/admin.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/plugins/admin.c b/plugins/admin.c
index aea33cb71ac2..02fec04568ba 100644
--- a/plugins/admin.c
+++ b/plugins/admin.c
@@ -196,12 +196,17 @@ static char **new_uuid_strings(struct queue *allowlist, gsize *num)
 	char **uuid_strs = NULL;
 	gsize i = 0, allowlist_num;
 
+	allowlist_num = queue_length(allowlist);
+	if (!allowlist_num) {
+		*num = 0;
+		return NULL;
+	}
+
 	/* Set num to a non-zero number so that whoever call this could know if
 	 * this function success or not
 	 */
 	*num = 1;
 
-	allowlist_num = queue_length(allowlist);
 	uuid_strs = g_try_malloc_n(allowlist_num, sizeof(char *));
 	if (!uuid_strs)
 		return NULL;
-- 
2.33.0.259.gc128427fd7-goog

RE: [Bluez,v1] plugin/admin: fix set empty allowlist no persistence issue

From: <hidden>
Date: 2021-08-31 06:40:37

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=539553

---Test result---

Test Summary:
CheckPatch                    PASS      0.28 seconds
GitLint                       PASS      0.11 seconds
Prep - Setup ELL              PASS      44.12 seconds
Build - Prep                  PASS      0.10 seconds
Build - Configure             PASS      7.31 seconds
Build - Make                  PASS      180.67 seconds
Make Check                    PASS      8.61 seconds
Make Distcheck                PASS      214.06 seconds
Build w/ext ELL - Configure   PASS      7.34 seconds
Build w/ext ELL - Make        PASS      167.81 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

Re: [Bluez,v1] plugin/admin: fix set empty allowlist no persistence issue

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2021-09-01 00:57:49

Hi Howard,

On Mon, Aug 30, 2021 at 11:42 PM [off-list ref] wrote:
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=539553

---Test result---

Test Summary:
CheckPatch                    PASS      0.28 seconds
GitLint                       PASS      0.11 seconds
Prep - Setup ELL              PASS      44.12 seconds
Build - Prep                  PASS      0.10 seconds
Build - Configure             PASS      7.31 seconds
Build - Make                  PASS      180.67 seconds
Make Check                    PASS      8.61 seconds
Make Distcheck                PASS      214.06 seconds
Build w/ext ELL - Configure   PASS      7.34 seconds
Build w/ext ELL - Make        PASS      167.81 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
Applied, thanks.

-- 
Luiz Augusto von Dentz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help