aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <paulo.alcantara@openbossa.org>2012-05-24 17:07:30 -0300
committerPaulo Alcantara <paulo.alcantara@openbossa.org>2012-05-25 11:58:16 -0300
commit53e6475aa9eecc5b79018a33faab4c79ed0e0745 (patch)
tree1e7a03a5b27cb28a4f1062c58b4fc5123863352b
parent03225ee371b3a50a52c6d9ff37d6a3cd202fd6c1 (diff)
downloadbluez-backup.tar.gz
bluez-backup.tar.xz
bluez-backup.zip
core: Remove entries from "blocked" filebackup
We must also make sure that older entries (those that use the old storage format) get removed as well as entries that use the new storage format.
-rw-r--r--src/device.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 89a78cf7..cbbadccb 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1157,6 +1157,7 @@ static void device_remove_stored(struct btd_device *device)
bdaddr_t src;
char key[20];
DBusConnection *conn = get_dbus_connection();
+ gboolean removed_blocked;
adapter_get_address(device->adapter, &src);
ba2str(&device->bdaddr, key);
@@ -1165,6 +1166,8 @@ static void device_remove_stored(struct btd_device *device)
delete_entry(&src, "profiles", key);
delete_entry(&src, "trusts", key);
+ removed_blocked = !delete_entry(&src, "blocked", key) ? TRUE : FALSE;
+
if (device_is_bonded(device)) {
delete_entry(&src, "linkkeys", key);
@@ -1179,6 +1182,12 @@ static void device_remove_stored(struct btd_device *device)
device->bdaddr_type);
}
+ if (!key[17])
+ sprintf(&key[17], "#%hhu", device->bdaddr_type);
+
+ if (removed_blocked == FALSE)
+ delete_entry(&src, "blocked", key);
+
delete_all_records(&src, &device->bdaddr);
delete_device_service(&src, &device->bdaddr, device->bdaddr_type);