public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] plugins/admin: Fix storage file location
@ 2026-01-23 16:42 Frédéric Danis
  2026-01-23 17:40 ` [BlueZ] " bluez.test.bot
  2026-01-26 23:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Frédéric Danis @ 2026-01-23 16:42 UTC (permalink / raw)
  To: linux-bluetooth

The admin policy is set per adapter, as stated in
doc/settings-storage.txt and doc/org.bluez.AdminPolicySet.rst but
currently stored directly under STORAGEDIR.
---
 doc/settings-storage.txt |  2 +-
 plugins/admin.c          | 20 ++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/doc/settings-storage.txt b/doc/settings-storage.txt
index 0a2cc706c..15f55f9ed 100644
--- a/doc/settings-storage.txt
+++ b/doc/settings-storage.txt
@@ -56,7 +56,7 @@ So the directory structure is:
     /var/lib/bluetooth/<adapter address>/
         ./settings
         ./attributes
-	./admin_policy_settings
+        ./admin_policy_settings
         ./cache/
             ./<remote device address>
             ./<remote device address>
diff --git a/plugins/admin.c b/plugins/admin.c
index 6ab3cba56..76c65d068 100644
--- a/plugins/admin.c
+++ b/plugins/admin.c
@@ -34,7 +34,6 @@
 
 #define ADMIN_POLICY_SET_INTERFACE	"org.bluez.AdminPolicySet1"
 #define ADMIN_POLICY_STATUS_INTERFACE	"org.bluez.AdminPolicyStatus1"
-#define ADMIN_POLICY_STORAGE		STORAGEDIR "/admin_policy_settings"
 
 #define DBUS_BLUEZ_SERVICE		"org.bluez"
 #define BTD_DEVICE_INTERFACE		"org.bluez.Device1"
@@ -248,7 +247,7 @@ static void store_policy_settings(struct btd_admin_policy *admin_policy)
 {
 	GKeyFile *key_file = NULL;
 	GError *gerr = NULL;
-	char *filename = ADMIN_POLICY_STORAGE;
+	char filename[PATH_MAX];
 	char *key_file_data = NULL;
 	char **uuid_strs = NULL;
 	gsize length, num_uuids;
@@ -268,16 +267,14 @@ static void store_policy_settings(struct btd_admin_policy *admin_policy)
 					(const gchar * const *)uuid_strs,
 					num_uuids);
 
-	if (create_file(ADMIN_POLICY_STORAGE, 0600) < 0) {
-		btd_error(admin_policy->adapter_id, "create %s failed, %s",
-						filename, strerror(errno));
-		goto failed;
-	}
+	create_filename(filename, PATH_MAX, "/%s/admin_policy_settings",
+			btd_adapter_get_storage_dir(admin_policy->adapter));
+	create_file(filename, 0600);
 
 	key_file_data = g_key_file_to_data(key_file, &length, NULL);
-	if (!g_file_set_contents(ADMIN_POLICY_STORAGE, key_file_data, length,
+	if (!g_file_set_contents(filename, key_file_data, length,
 								&gerr)) {
-		error("Unable set contents for %s: (%s)", ADMIN_POLICY_STORAGE,
+		error("Unable set contents for %s: (%s)", filename,
 								gerr->message);
 		g_error_free(gerr);
 	}
@@ -342,9 +339,12 @@ static void load_policy_settings(struct btd_admin_policy *admin_policy)
 {
 	GKeyFile *key_file;
 	GError *gerr = NULL;
-	char *filename = ADMIN_POLICY_STORAGE;
+	char filename[PATH_MAX];
 	struct stat st;
 
+	create_filename(filename, PATH_MAX, "/%s/admin_policy_settings",
+			btd_adapter_get_storage_dir(admin_policy->adapter));
+
 	if (stat(filename, &st) < 0)
 		store_policy_settings(policy_data);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [BlueZ] plugins/admin: Fix storage file location
  2026-01-23 16:42 [PATCH BlueZ] plugins/admin: Fix storage file location Frédéric Danis
@ 2026-01-23 17:40 ` bluez.test.bot
  2026-01-26 23:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-01-23 17:40 UTC (permalink / raw)
  To: linux-bluetooth, frederic.danis

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

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

---Test result---

Test Summary:
CheckPatch                    PENDING   0.37 seconds
GitLint                       PENDING   0.37 seconds
BuildEll                      PASS      20.23 seconds
BluezMake                     PASS      647.61 seconds
MakeCheck                     PASS      18.58 seconds
MakeDistcheck                 PASS      240.22 seconds
CheckValgrind                 PASS      292.37 seconds
CheckSmatch                   PASS      350.13 seconds
bluezmakeextell               PASS      181.61 seconds
IncrementalBuild              PENDING   0.35 seconds
ScanBuild                     PASS      1032.07 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ] plugins/admin: Fix storage file location
  2026-01-23 16:42 [PATCH BlueZ] plugins/admin: Fix storage file location Frédéric Danis
  2026-01-23 17:40 ` [BlueZ] " bluez.test.bot
@ 2026-01-26 23:00 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2026-01-26 23:00 UTC (permalink / raw)
  To: =?utf-8?b?RnLDqWTDqXJpYyBEYW5pcyA8ZnJlZGVyaWMuZGFuaXNAY29sbGFib3JhLmNvbT4=?=
  Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 23 Jan 2026 17:42:57 +0100 you wrote:
> The admin policy is set per adapter, as stated in
> doc/settings-storage.txt and doc/org.bluez.AdminPolicySet.rst but
> currently stored directly under STORAGEDIR.
> ---
>  doc/settings-storage.txt |  2 +-
>  plugins/admin.c          | 20 ++++++++++----------
>  2 files changed, 11 insertions(+), 11 deletions(-)

Here is the summary with links:
  - [BlueZ] plugins/admin: Fix storage file location
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2d5afe34bb05

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-26 23:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 16:42 [PATCH BlueZ] plugins/admin: Fix storage file location Frédéric Danis
2026-01-23 17:40 ` [BlueZ] " bluez.test.bot
2026-01-26 23:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox