From: "Frédéric Danis" <frederic.danis@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 3/4] adapter: Convert storage trusts
Date: Wed, 14 Nov 2012 11:16:05 +0100 [thread overview]
Message-ID: <1352888166-7391-3-git-send-email-frederic.danis@linux.intel.com> (raw)
In-Reply-To: <1352888166-7391-1-git-send-email-frederic.danis@linux.intel.com>
All entry in trusts file are set to [all] (if a device is not trusted
it does not have entry in this file).
So, we do not need to check entry value and set device (entry key) as
trusted.
---
src/adapter.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/adapter.c b/src/adapter.c
index ea7b8ff..99d58b5 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2544,6 +2544,11 @@ static void convert_aliases_entry(GKeyFile *key_file, void *value)
g_key_file_set_string(key_file, "General", "Alias", value);
}
+static void convert_trusts_entry(GKeyFile *key_file, void *value)
+{
+ g_key_file_set_boolean(key_file, "General", "Trusted", TRUE);
+}
+
static void convert_entry(char *key, char *value, void *user_data)
{
struct device_converter *converter = user_data;
@@ -2619,6 +2624,9 @@ static void convert_device_storage(struct btd_adapter *adapter)
/* Convert aliases */
convert_file("aliases", address, convert_aliases_entry);
+
+ /* Convert trusts */
+ convert_file("trusts", address, convert_trusts_entry);
}
static void convert_config(struct btd_adapter *adapter, const char *filename,
--
1.7.9.5
next prev parent reply other threads:[~2012-11-14 10:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-14 10:16 [PATCH 1/4] adapter: Convert storage aliases Frédéric Danis
2012-11-14 10:16 ` [PATCH 2/4] device: Use new storage for device alias Frédéric Danis
2012-11-14 10:16 ` Frédéric Danis [this message]
2012-11-14 10:16 ` [PATCH 4/4] device: Use new storage for device trust Frédéric Danis
2012-11-14 10:45 ` [PATCH 1/4] adapter: Convert storage aliases Johan Hedberg
2012-11-14 11:04 ` Frederic Danis
2012-11-14 11:11 ` Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352888166-7391-3-git-send-email-frederic.danis@linux.intel.com \
--to=frederic.danis@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.