linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] android/gatt: Support find request in permission check
@ 2014-05-30 13:19 Jakub Tyszkowski
  2014-05-30 13:19 ` [PATCH 2/2] android/gatt: Fix not setting request as done on direct db read Jakub Tyszkowski
  2014-05-30 14:47 ` [PATCH 1/2] android/gatt: Support find request in permission check Szymon Janc
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Tyszkowski @ 2014-05-30 13:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski

Permissions check was failing on those requests.
---
 android/gatt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/android/gatt.c b/android/gatt.c
index fcc91ff..a61d702 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -4007,6 +4007,8 @@ static uint8_t check_device_permissions(struct gatt_device *device,
 	case ATT_OP_READ_BLOB_REQ:
 	case ATT_OP_READ_MULTI_REQ:
 	case ATT_OP_READ_BY_GROUP_REQ:
+	case ATT_OP_FIND_BY_TYPE_REQ:
+	case ATT_OP_FIND_INFO_REQ:
 		if (!(permissions & GATT_PERM_READ))
 			return ATT_ECODE_READ_NOT_PERM;
 
-- 
1.9.3


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

* [PATCH 2/2] android/gatt: Fix not setting request as done on direct db read
  2014-05-30 13:19 [PATCH 1/2] android/gatt: Support find request in permission check Jakub Tyszkowski
@ 2014-05-30 13:19 ` Jakub Tyszkowski
  2014-05-30 14:47 ` [PATCH 1/2] android/gatt: Support find request in permission check Szymon Janc
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Tyszkowski @ 2014-05-30 13:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski

Previously if read was succesfull - request was not marked as completed
because no callback was called for direct db read.
---
 android/gatt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/android/gatt.c b/android/gatt.c
index a61d702..46dc7f6 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -4086,10 +4086,11 @@ static void read_requested_attributes(void *data, void *user_data)
 
 	/* We have value here already if no callback will be called */
 	if (value_len >= 0) {
+		resp_data->state = REQUEST_DONE;
+
 		resp_data->value = malloc0(value_len);
 		if (!resp_data->value) {
 			/* If data cannot be copied, act like when read fails */
-			resp_data->state = REQUEST_DONE;
 			resp_data->error = ATT_ECODE_INSUFF_RESOURCES;
 			return;
 		}
-- 
1.9.3


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

* Re: [PATCH 1/2] android/gatt: Support find request in permission check
  2014-05-30 13:19 [PATCH 1/2] android/gatt: Support find request in permission check Jakub Tyszkowski
  2014-05-30 13:19 ` [PATCH 2/2] android/gatt: Fix not setting request as done on direct db read Jakub Tyszkowski
@ 2014-05-30 14:47 ` Szymon Janc
  1 sibling, 0 replies; 3+ messages in thread
From: Szymon Janc @ 2014-05-30 14:47 UTC (permalink / raw)
  To: Jakub Tyszkowski; +Cc: linux-bluetooth

Hi Jakub,

On Friday 30 of May 2014 15:19:41 Jakub Tyszkowski wrote:
> Permissions check was failing on those requests.
> ---
>  android/gatt.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index fcc91ff..a61d702 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -4007,6 +4007,8 @@ static uint8_t check_device_permissions(struct
> gatt_device *device, case ATT_OP_READ_BLOB_REQ:
>  	case ATT_OP_READ_MULTI_REQ:
>  	case ATT_OP_READ_BY_GROUP_REQ:
> +	case ATT_OP_FIND_BY_TYPE_REQ:
> +	case ATT_OP_FIND_INFO_REQ:
>  		if (!(permissions & GATT_PERM_READ))
>  			return ATT_ECODE_READ_NOT_PERM;

Both patches applied, thanks.

-- 
BR
Szymon Janc

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

end of thread, other threads:[~2014-05-30 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-30 13:19 [PATCH 1/2] android/gatt: Support find request in permission check Jakub Tyszkowski
2014-05-30 13:19 ` [PATCH 2/2] android/gatt: Fix not setting request as done on direct db read Jakub Tyszkowski
2014-05-30 14:47 ` [PATCH 1/2] android/gatt: Support find request in permission check Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).