* [PATCH BlueZ] obexd: reject to accept file when replying reject message
@ 2023-03-15 10:04 Aaron_shen
2023-03-15 11:10 ` [BlueZ] " bluez.test.bot
2023-03-21 16:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Aaron_shen @ 2023-03-15 10:04 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Aaron_shen
It will accept file when obex agent replied any message
event though the message is org.bluez.obex.Error.Rejected.
The patch helps to reject a Bluetooth object push request if
user replied "org.bluez.obex.Error.Rejected" message according
to the doc/obex-agent-api.txt.
---
obexd/src/manager.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 01741fe62..849928603 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -38,6 +38,7 @@
#define TRANSFER_INTERFACE OBEXD_SERVICE ".Transfer1"
#define SESSION_INTERFACE OBEXD_SERVICE ".Session1"
#define AGENT_INTERFACE OBEXD_SERVICE ".Agent1"
+#define OBEX_ERROR_REJECT "org.bluez.obex.Error.Rejected"
#define TIMEOUT 60*1000 /* Timeout for user response (miliseconds) */
@@ -45,6 +46,7 @@ struct agent {
char *bus_name;
char *path;
gboolean auth_pending;
+ gboolean auth_reject;
char *new_name;
char *new_folder;
unsigned int watch_id;
@@ -631,6 +633,9 @@ static void agent_reply(DBusPendingCall *call, void *user_data)
if (dbus_error_has_name(&derr, DBUS_ERROR_NO_REPLY))
agent_cancel();
+ if (dbus_error_has_name(&derr, OBEX_ERROR_REJECT))
+ agent->auth_reject = TRUE;
+
dbus_error_free(&derr);
dbus_message_unref(reply);
return;
@@ -694,6 +699,7 @@ int manager_request_authorization(struct obex_transfer *transfer,
dbus_message_unref(msg);
agent->auth_pending = TRUE;
+ agent->auth_reject = FALSE;
got_reply = FALSE;
/* Catches errors before authorization response comes */
@@ -716,7 +722,7 @@ int manager_request_authorization(struct obex_transfer *transfer,
dbus_pending_call_unref(call);
- if (!agent || !agent->new_name)
+ if (!agent || !agent->new_name || agent->auth_reject)
return -EPERM;
*new_folder = agent->new_folder;
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [BlueZ] obexd: reject to accept file when replying reject message
2023-03-15 10:04 [PATCH BlueZ] obexd: reject to accept file when replying reject message Aaron_shen
@ 2023-03-15 11:10 ` bluez.test.bot
2023-03-21 16:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2023-03-15 11:10 UTC (permalink / raw)
To: linux-bluetooth, aarongt.shen
[-- Attachment #1: Type: text/plain, Size: 945 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=730253
---Test result---
Test Summary:
CheckPatch PASS 0.51 seconds
GitLint PASS 0.33 seconds
BuildEll PASS 26.74 seconds
BluezMake PASS 755.96 seconds
MakeCheck PASS 10.87 seconds
MakeDistcheck PASS 151.05 seconds
CheckValgrind PASS 243.76 seconds
CheckSmatch PASS 326.15 seconds
bluezmakeextell PASS 98.46 seconds
IncrementalBuild PASS 612.42 seconds
ScanBuild PASS 975.66 seconds
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ] obexd: reject to accept file when replying reject message
2023-03-15 10:04 [PATCH BlueZ] obexd: reject to accept file when replying reject message Aaron_shen
2023-03-15 11:10 ` [BlueZ] " bluez.test.bot
@ 2023-03-21 16:00 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2023-03-21 16:00 UTC (permalink / raw)
To: Aaron_shen; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Wed, 15 Mar 2023 18:04:35 +0800 you wrote:
> It will accept file when obex agent replied any message
> event though the message is org.bluez.obex.Error.Rejected.
> The patch helps to reject a Bluetooth object push request if
> user replied "org.bluez.obex.Error.Rejected" message according
> to the doc/obex-agent-api.txt.
> ---
> obexd/src/manager.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
Here is the summary with links:
- [BlueZ] obexd: reject to accept file when replying reject message
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=338ba4352b6c
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:[~2023-03-21 16:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-15 10:04 [PATCH BlueZ] obexd: reject to accept file when replying reject message Aaron_shen
2023-03-15 11:10 ` [BlueZ] " bluez.test.bot
2023-03-21 16: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